I want to retrieve the java data types of the columns of a table in MySql using hibernate so that I can dynamically convert my input data to corresponding data type while inserting into database.
One way is to read the class-name.hbm.xml
and retrieve the data type information but I want the data types straight from the database and not from any config XMLs as the XMLs can be erroneous.
Another way is using AbstractEntityPersister.getPropertyType(column-name).toString()
but that returns the hibernate data type instead of the corresponding java types.
Is there any way I can achieve this ?