This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Problem using Hibernate Native Statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Problem using Hibernate Native Statement" Watch "Problem using Hibernate Native Statement" New topic
Author

Problem using Hibernate Native Statement

Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
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

Joined: Dec 11, 2006
Posts: 364
The "type" parameter should be a Hibernate type ("integer" ?), not a Java type. See in the Hibernate reference.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem using Hibernate Native Statement
 
Similar Threads
newbie needs help
Problem with 2 collection
[ hibernate ]composite
can i use timestamp as primary key
is ID tag in hibernate map.xml is compulsory?