I just had a problem with Brother eight thousand. This is a strange problem that has plagued me for so long. Ah, sorry.
I used the three frameworks to write the complete settings. As a result, when I obtained the foreground number today, I found that one of the values could not be passed.
I started to use the data named cows. Then I changed the database and added some fields. The database name was named mycows.
The problem starts from now on. cows has a piece of data from 1 to 16, which is from 1 to 18 in mycows. However, in any case, the program obtains values from 1 to 16. After testing, if the problem is solved by using the value of hibernate, it will be taken from the cows database. If it is written in jdbc, it is the correct value in mycows.
We used various methods to check the configuration file, check the path, and even restart the database. After a long time, we had to give up.
Finally, I looked at the object class. Because it is an entity class generated by the annotation, eight thousand brother saw the problem.
"Serial" = "t_role", catalog = "cows" TRole Integer roleId;
Catalog = "cows "!!!
Ah, this specifies the database ....
Because myeclipse is used for reverse generation, the database is cows, but now it is changed to mycows, so data in cows is always queried.
I personally think that the design of the framework is a bit problematic. Since the database is specified in the configuration xml of hibernate, different catalog can be used in this entity class, and no error is reported, this problem is really a headache.
The problem has been solved, but a small problem is really confusing. I hope you will not share the same mistakes.