Does JPA 1.0 support the mapping of the Gregorian calendar ? I did not find anything in the mapping file specification of JPA 1.0 about the Gregorian calendar . What about JPA 2.0?
JPA supports java.util.Calendar and its subclasses. The only warning is that you should use @temporal annotations to indicate how the field is stored in the database. Both versions of the spec require that there is a section from the JPA 2.0 space here:
11.1.47 temporal annotations
should be specified for temporal annotations Constant areas or properties type java.util.Date and java.util.Calendar It can only be specified for these types of areas or properties.
The original description, ID annotation, or element collection can be used in conjunction with the [111] annotation (when the element's collection value is such a temporary type)
TemporalType enum In Defines mapping of temporary types.
Public Anonymous temporal type {DATE, //java.sql.Date TIME, //java.sql.Time TIMESTAMP //java.sql.Timestamp} Otherwise there is nothing special that you have to do. Your organization might look something like this:
@intexty public class person {//. . . @temporal (temral type. TIMESTAMP) Private Gregorian calendar final update; // . . }
Comments
Post a Comment