This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes [Hibernate] Problem with @TableGenerator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "[Hibernate] Problem with @TableGenerator" Watch "[Hibernate] Problem with @TableGenerator" New topic
Author

[Hibernate] Problem with @TableGenerator

Daniel Suter
Greenhorn

Joined: Jul 31, 2012
Posts: 2
Hi,

I tried to the TableGenerator annotation from hibernate to generate ids. However it does not seem to work.

My entity:


Hibernate will not create the table "custom_sequences", when creating the schema. It simply sets the id column to auto_increment.

perisistence.xml



Testcode:
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1646
    
    7

make sure all of your imports are coming out of javax.persistence.

also change to


See if that makes a difference for you.


[How To Ask Questions][Read before you PM me]
 
jQuery in Action, 2nd edition
 
subject: [Hibernate] Problem with @TableGenerator
 
Similar Threads
Map multiple properties as @Id properties Problem
EJB3 Beta Certification - EntityManager BASIC notes. (PART II)
Query on various properties wrt auto table generator
Identity issue for EJB3.0 Entity along with Hibernate HBM configuration
org.hibernate.exception.GenericJDBCException