• Post Reply Bookmark Topic Watch Topic
  • New Topic

@Temporal annotation

 
Nibin Jacob Panicker
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Someone please explain me the use of @Temporal annotation in entities. ejb persistence spec says we should use this annotation for properties of type java.util.Date and java.util.Calendar. I tried with and without this annotation and could not figure any difference.
 
Mark Spritzler
ranger
Sheriff
Posts: 17290
9
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically this comes down to the Time classes in Java and how Databases store time. Some Databases store just TimeStamp, some just dates, some dates and time but not as a timestamp. So the Temporal annotation is to annotate the conversion from the database to Java class and the other way around.

Maybe the annotation you added was the smart default without the annotation.

Mark
 
Nibin Jacob Panicker
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok.. thank you mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!