This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem using Hibernate Native Statement  RSS feed

 
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
 
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
Boost this thread!