Problem: The Date type stored in the database is only year, month, and day. I have tried several methods without hour, minute, and second. The result is year, month, and day. It is clear that there can be hour, minute, and second in some places... later I thought that I did not pay attention to any time-related point. I use the object generated by the hibernate plug-in of jboss and the hbm. xml configuration file. Although I have configured the primary key
Problem: The Date type stored in the database is only year, month, and day. I have tried several methods without hour, minute, and second. The result is year, month, and day. It is clear that there can be hour, minute, and second in some places... later I thought that I did not pay attention to any time-related point. I use the object generated by the hibernate plug-in of jboss and the hbm. xml configuration file. Although I have configured the primary key
Problem:The Date type stored in the database is year, month, day, and no hour, minute, and second.
I have tried several methods, and the result is year, month, and day. It is clear that there are hours, minutes, And seconds in some places...
Later I thought that I did not pay attention to any time-related point. I use the hibernate plug-in of jboss to generate objects and hbm. in the xml configuration file, although I have configured the primary key type, I use the default values for other fields and check hbm. xml file.
Cause:Hibernate uses basic types when generating this configuration file.
The String type is not written in java. lang. String, but in string.
The Date type is not written in java. util. Date, but in date.
This applies to other types.
(This date and string look strange. I don't know where it comes from... Maybe it's hibernate ?)
Solution:Instantly discover the problem, change it to the correct type, and try again.
In the past, when myeclipse was used, the configuration files of the hibernate plug-in were not manually configured and are directly generated. Using the Eclipse + plug-in, I did not expect to manually configure so much content.
Attach a configuration file: