Wednesday, 20 April 2016

Scenario : Omitting type in mapping for numeric


Scenario

In my application, I have to map a student bean to student table.
I have a field by name score which is of type 'Double'. (in STUDENT table the SCORE column type is float)

The class is mapped using XML mapping file.

What if the file just includes <property name="score" column="SCORE"/> in it omitting type="double" from property tag ?


Answer

The score will be saved as Float automatically.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.