-->
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.  [ 4 posts ] 
Author Message
 Post subject: Discriminator
PostPosted: Wed Sep 14, 2005 4:09 pm 
Newbie

Joined: Mon Sep 12, 2005 1:27 pm
Posts: 2
Hi all,

I have a column that references an attribute. But here is the problem: this column is used in the discriminator too as is showed below:

[code]<discriminator column="COD_CLASSE_CAUSA" />

<many-to-one name="classeCausa" class="Classe">
<column name="COD_CLASSE_CAUSA" />
</many-to-one>[/code]

When my xml is 'compiled' I receive an error message saying that I have repeated columns:
"Repeated column in mapping for entity:
Ocorrencia column: COD_CLASSE_CAUSA (should be mapped with insert="false" update="false")"

How can I use the column in the discriminator and as a single field ??

Thanks
Tiago


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 1:45 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
http://forums.hibernate.org/viewtopic.p ... 5ea5f6e209


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 9:35 am 
Beginner
Beginner

Joined: Mon Jun 20, 2005 3:14 pm
Posts: 33
Tiago,

Try to replace 'column' per 'formula':

Code:
<discriminator formula="COD_CLASSE_CAUSA" />


Best regards,

Andre


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 9:39 am 
Newbie

Joined: Mon Sep 12, 2005 1:27 pm
Posts: 2
It worked !!

Thanks Andre


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.