I noticed that Middlegen puts the "length" attribute into the XDoclet mappings of properties of type Date (or its java.sql.* subclasses.) I have several questions related to that:
1. Is there any meaning to "length" attribute when used in Date-typed properties?
2. What exactly does Hibernate do with them?
3. If those length attributes are used to tell Hibernate whether this Date property should hold just the date vs. just the time vs. both, isn't it better to specify type="date"/type="time"/type="datetime" instead? Or is there any value in using both type and length attributes together in this context?
Thanks in advance.
Eugene
P.S. BTW, Middlegen Hibernate plugin generates type="java.sql.Timestamp", type="java.sql.Date", etc. in the .hbm.xml mappings, but hbm2java then ignores it and creates java.lang.Date typed properties. Which one is right, i.e. which one is preferable to use with Hibernate? (I guess it's Q#4. :)
|