Home > Back-end >  @ DateTimeFormat use problems
@ DateTimeFormat use problems

Time:09-20

Entity class when database field type for the Time corresponding to Java, SQL, Time type, Java, SQL, Time inherited Java. Util. Date types, annotations can be used in Java source said. The util. Date, Java. Util. Calendar, Java, lang. Long this three types, then @ DatiTimeFormat (pattern="HH: mm: ss")
Private Time startTime. If you have any questions?

CodePudding user response:

Entity classes in Java. Util. Date, no other problems

 
@ DatiTimeFormat (pattern="HH: mm: ss")
private Date startTime;

CodePudding user response:

reference Enchanter, 1/f, response:
entity classes in Java. The util. Date, no other problems

 
@ DatiTimeFormat (pattern="HH: mm: ss")
private Date startTime;

I want to ask the Java. SQL. Time type can use this annotation?

CodePudding user response:

refer to the second floor Java_ far day warsong reply:
Quote: refer to 1st floor Enchanter, response:
entity classes in Java. Util. Date, no other problems

 
@ DatiTimeFormat (pattern="HH: mm: ss")
private Date startTime;

I want to ask the Java. SQL. Time type can use this annotation?


Can, but generally do development, not in time, will involve a lot of conversion issues

CodePudding user response:

reference 3 floor Enchanter, response:
Quote: refer to the second floor Java_ far day warsong reply:

Quote: refer to 1st floor Enchanter, response:
entity classes in Java. The util. Date, no other problems

 
@ DatiTimeFormat (pattern="HH: mm: ss")
private Date startTime;

I want to ask the Java. SQL. Time type can use this annotation?


Can, but generally do development, not in time, will involve a lot of transformation problem

Database time type should be converted to that type is better
  • Related