1, before the project, the database was designed with PowerDesigner, because at the time of the design did not notice, the type of int did not give length
When you build the database, Oracle defaults to the type that you generate, which is a large type of bigdecimal. I felt nothing at the time. In the background, the new one bigdecimal out and then it's saved.
But then a colleague in the statistical data record, COUNT (*) Statistics is also bigdecimal this time with hibernate turn very troublesome
If it is of type int then hibernate goes in the way:
int count = ((Long) createquery (HQL). Uniqueresult ()). Invalue ()
But if it's the one I made a small mistake on,
That's how it should turn out:
BigDecimal b=new BigDecimal ((Long) createquery (HQL). Uniqueresult ()). Invalue ());
int I=b.intvalue ();
At this point i is the int type, before because the type of bigdecimal has not been processed. Although help him to solve, but do not know there is no easy way, if you have a point of view
A small detail when creating an Oracle table will cause you to handle the Java Type conversion it's time for the egg to hurt.