The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

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.