csell (6) [Avatar] Offline
#1
right below listing 10.4, it says this:

JPA only considers java.sql.Timestamp portable. This is less attractive, as you'd
have to import that JDBC class in your domain model.


Why do you consider java.sql.Timestamp unattractive in a domain model (except for aesthetical reasons, if you dont like the "sql" package name)? Technically, I see no reason to advise against it. The class is always present, always visible, and works as expected

Message was edited by:
csell
Christian Bauer (56) [Avatar] Offline
#2
Re: java.sql.Timestamp unattractive?
This is less attractive, as you'd have to
import that JDBC class in your domain model. You should try to keep implementation
details such as JDBC out of the domain model classes, so they can be tested,
instantiated, cross-compiled (to JavaScript with GWT, for example), serialized, and
deserialized in as many environments as possible.