Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

org. hibernate. Annotation Exception: Unknown Id.generator

 
Pramod Kumar
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have my persistance.xml and orm.xml in META-INF folder and both are in classpath in war.

persistance.xml
--------------------------------

<persistence>
<persistence-unit name="oamconsole">
<mapping-file>/META-INF/orm.xml</mapping-file>
<class>User</class>

I have my mapped class files here

<properties>
I have my DB properties here.
</properties>
</persistence-unit>
</persistence>



orm.xml
-------------------
<entity-mappings>

<sequence-generator name="USER_SEQ" sequence-name="USER_SEQ" />

I have more sequence generators here.
I have named queries here.
</entity-mappings>

finally the user class
-----------------------

@Override
@Id
@Column(name = "USER_ID")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "USER_SEQ")
public Long getInternalId() {
return internalId;
}

I got the following exception. What would be the problem?

javax.persistence.PersistenceException: org.hibernate.AnnotationException: Unknown Id.generator: USER_SEQ

I have this sequence created in my db I am not able to find what is the problem?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic