Today, when using hibernate operation, the query operation also made this error. I couldn’t figure out the solution. Finally, I found the ending method on the Internet, which should not be regarded as the method. That’s the reason.
First, I use the following HQL statement
String hql="select new PO(。。。。) from 。。。";
This error is largely due to the time format. The reasons are as follows
1. In Oracle, what is the return time of using hibernate query java.util.Date Yes.
2. When using struts1, the time plug-ins in the foreground must be string in the form, otherwise an error will be reported.
3. Use BeanUtils.copyProperties Method, the string time in form can only be converted to java.sql.Date Type.
4. Due to the reason of 3, the time type of Po entity class should be java.sql.Date Type.
5. Oracle return java.util.Date , Po is java.sql.Date So the problem arises.
The current solution is to transform in the construction method, and another method is to implement string to java.util.Date But what I’m doing now is an old project. There was a lot of code before, and it would be troublesome if I made a mistake. So it’s relatively safe to use the construction method to convert.
We have to make complaints about the problems in our project, which are basically caused by the time type related to the database, and the conflict of jar packages in the project.
Read More:
- Linux novice: unable to locate package error solution
- E: unable to locate package MySQL server error solution
- Depending on the custom component jar package, unable to read meta data for class appears after startup
- After verifying parameters with validation, springboot reports an error: no constructor found in package name + class name
- (20200915 solved) vscope appears unable to open ‘hashable’_ class_ helper.pxi ‘
- Git clone appears fatal: unable to access’ https://github.com/… The solution to the problem
- mongo Failed to instantiate *** constructor NO_CONSTRUCTOR with arguments
- Unable to locate executable for jre1.8.0_261
- Vs compiling OpenGL project, the solution of unable to open the source file “GL / glaux. H” appears
- When IntelliJ idea is programmed, 1. Black thick line or black cursor appears; 2. The solution of carriage return unable to wrap. (practical recommendation method 2)
- Pychar reported an error. Unable to set the python SDK in Python 3.8. This SDK appears to be invalid.
- 0001: unable to locate the content swf directory: app:/mod/win
- Solutions to the problem of unable to locate package
- Solution to “An error occurred while loading the archive” appears when decompressing the rar file compressed package
- Kotlin reported an error jsonexception using fastjason: default constructor not found
- RuntimeError: Unable to locate turbojpeg library automatically. You may specify the turbojpeg librar
- Solution to msxml3.dll error ‘800c0008’ the system cannot locate the resource specified
- When installing oracle12c, the problem of “unable to check whether the specified location is on CFS” appears
- Solve the problem of unable to locate package python3.6 when upgrading from python3.5 to python3.6 in ubantu16.04
- Idea error: unable to find or load the main class