File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Repeated column in mapping for entity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Repeated column in mapping for entity" Watch "Repeated column in mapping for entity" New topic
Author

Repeated column in mapping for entity

Dupon David
Greenhorn

Joined: Aug 11, 2006
Posts: 19
Hello
if I postulated in this forum, it is that I did not find a solution elsewhere
here my code:
TermProjPK.java
TermProj.java

TermSource.java

SnomedInter.java

I always have the same error:


were there any suggestions made? Any help is greatly appreciated
Edvins Reisons
Ranch Hand

Joined: Dec 11, 2006
Posts: 364
Originally posted by Dupon David:
[QB]


TermProj.java



I believe that you have a repeated column definition here. Try a different name for one of them...
Dupon David
Greenhorn

Joined: Aug 11, 2006
Posts: 19
Hello,
I changed my table for the keys are different but I always have the same problem
Edvins Reisons
Ranch Hand

Joined: Dec 11, 2006
Posts: 364
Originally posted by Dupon David:
I changed my table for the keys are different but I always have the same problem


With the same column name in the exception?
Looks like there are just too many things named "auis" in your code fragment, and by changing them one by one you can see which ones are causing the problem...
Dupon David
Greenhorn

Joined: Aug 11, 2006
Posts: 19
With the same column name in the exception?
Yes
Looks like there are just too many things named "auis" in your code fragment, and by changing them one by one you can see which ones are causing the problem...
thank you, it is what I have make, and I put :in TermProj entity and in TermProjPk class.
and now I have the following error

there are other people who have the same error that me, but they did not have an answer


http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3994778http://forum.hibernate.org/viewtopic.php?t=967702&sid=5ffcb0cf915bf975182e97b24eea1741

were there any suggestions made? Any help is greatly appreciated
[ December 20, 2006: Message edited by: Dupon David ]
Edvins Reisons
Ranch Hand

Joined: Dec 11, 2006
Posts: 364


Through the two member variables, you are trying to make two columns "AUIS" in the table corresponding to the TermProj entity. Rename the columns, or refactor the class
Dupon David
Greenhorn

Joined: Aug 11, 2006
Posts: 19
Hello
I changed the name of the primary key in SnomedInter I put SNOMEDINTER_AUIS at the place of AUIS, in the same way for TERMSOURCE_AUIW in the place of AUIW to avoid having the same name as the key foreign in TermProj, my code became as follows:
TermProjPK.java

TermProj.java

TermSource.java


SnomedInter.java


this time I have the following error:


were there any suggestions made? Any help is greatly appreciated
Dupon David
Greenhorn

Joined: Aug 11, 2006
Posts: 19
were there any suggestions made? Any help is greatly appreciated
Cyril JOUI
Greenhorn

Joined: Dec 31, 2006
Posts: 1
Hello,

The problem seems not to be in you entities mapping, but when you try to find an entity by calling getReference method of EntityManager ?

Please send us more code !

Good luck

Cyril
Dupon David
Greenhorn

Joined: Aug 11, 2006
Posts: 19
Hello,
In the Session Bean TermProjFacade.java i have:
And to test, i use this servlet:

I remain at your disposal, for more information, thank you very much
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Repeated column in mapping for entity
 
Similar Threads
"Mapping RelationShip State" in chapter 8
@ManyToOne and @OneToMany : 2 primary keys
Pro EJB 3 book of Mr Mike keith and Merrick Schincariol !!
@JoinTable or @JoinCol...
EJB 3 QL : join