Java Programming Blog. All about the daily issues of a Software developer. Including Database, Scripting, Tools and code snippets
Showing posts with label integer. Show all posts
Showing posts with label integer. Show all posts
Monday, January 28, 2013
java hibernate nullable integer fields
To be able to use a nullable integer field with hibernate code generation hbm2java, you just have to change the type since java 1.5 to the java.lang.Integer class.
Before:
<property name="weightInGramm" type="int"/>
After:
<property name="weightInGramm" type="java.lang.Integer" not-null="false"/>
Subscribe to:
Posts (Atom)