I personally would choose Double instead double, Integer instead int, Long instead long.... etc. For example, if you have a nullable column in the database, that is mapped to a double... this gets weird, because primitive values can't be null, instead they have default values.

With JDK5's new autoboxing functionality, it's a little cleaner to go back and forth between the primitive and the boxed wrapper in the code.
http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html

Fan wrote:
Ohh...thanks bryan.

That link is really what I have been looking for.

By the way, for a property to keep amount, should I use Double or double ?
What's the difference will have for choosing object Type or primitive type ?



Bryan Noll-2 wrote:
I would go with java.util.Date or java.util.Calendar.

'Two primary keys' doesn't exactly make sense. Do you mean a composite key... aka... two columns, when put together, represent the uniqueness of the row? Assuming that's what you're looking for, look at Chapter 10 of this:

http://downside.ch/hibernate/hibernatetutorial-1.4.pdf

html if you prefer:
http://tinyurl.com/y849oa



Fan wrote:
If I want to make a Date type property in POJO, should I use
java.sql.Date or
java.util.Date ?


What if I want to have two primary keys in a table, i.e. ID & transaction
date, what's the @hibernate.* tags should I use ?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Reply via email to