• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem using Hibernate Native Statement

 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Native for my primary key and from what i heard its suppose to generate the primary key


<id name="jobId" type="java.lang.Integer">
<column name="JOB_ID" />
<generator class="native" />
</id>

but anytime i run this i get

***>java.sql.SQLException: Field 'JOB_ID' doesn't have a default value
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "type" parameter should be a Hibernate type ("integer" ?), not a Java type. See in the Hibernate reference.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic