-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate Tools
PostPosted: Tue May 02, 2006 5:14 pm 
Newbie

Joined: Tue May 02, 2006 5:04 pm
Posts: 1
Hi,

I´ve generated the code with the HibernateTool with annotations for my database. But it has two tables : keyword , image and one keywordImage fro the relation, it´s a relation between keywords and images for a image bank.

The code generated created 2 classes for the table keywordImage: the keywordImage and keywordImageID.

The problem is when i start the tomcat server , when it´s building the session factory i receive this error:
Caused by: org.hibernate.AnnotationException: br.com.brti.si.sistemas.hibernate.ImageKeywordId has not persistent id property

How could I solve this problem if ImageKeywordId has two properties Image and Keyword ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 15, 2006 4:52 am 
Newbie

Joined: Fri May 12, 2006 9:48 am
Posts: 14
Location: Toulouse
I am having the same problem.
If anyone has an answer to our problem, go ahead !

I did found next url:
http://opensource.atlassian.com/project ... wse/ANN-15

There the guy does indicate the addition of a third (basic) property solves the problem.

Is there a solution with only 2 ManyToOne properties in the PK class ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 15, 2006 9:23 am 
Newbie

Joined: Fri May 12, 2006 9:48 am
Posts: 14
Location: Toulouse
I solved the problem !

I removed the @EmbeddedId above the getter method
and replaced it with a @Id above the property definition and a @embeddable above the PK class

That means that the @EmbeddedId as explained in the manual does not work it is explained and the normal way must be used.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.