-->
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.  [ 1 post ] 
Author Message
 Post subject: Association PK mapping
PostPosted: Fri Dec 21, 2012 4:13 pm 
Newbie

Joined: Fri Dec 21, 2012 4:04 pm
Posts: 1
Hi,

I have the following EmbeddedId:
Code:
@Embeddable
public class MyPK implements Serializable {

   @ManyToOne
   @JoinColumns({
      @JoinColumn(name = "CO_COMPRA", referencedColumnName="CO_COMPRA", insertable=false, updatable=false)
      , @JoinColumn(name = "CO_CARRINHO", referencedColumnName="CO_CARRINHO", insertable=false, updatable=false)
      })

   private Entity1 compra;
   
   
   @ManyToOne
   @JoinColumns({
      @JoinColumn(name = "CO_APOSTA", referencedColumnName="CO_APOSTA", insertable=false, updatable=false)
      , @JoinColumn(name = "CO_CARRINHO", referencedColumnName="CO_CARRINHO", insertable=false, updatable=false)
      })

   private Entity2 aposta;

...
}




Code:
@Entity
@Table(name = "XPTO", schema=DatabaseConfig.SCHEMA)
public class Entity3 ...{
@EmbeddedId
   private MyPK id;

...

}


The columns names are correctly, however hibernate throws:
Repeated column in mapping for entity: br.Entity3 column: CO_CARRINHO (should be mapped with insert="false" update="false").

Is it a bug?? Is there any other way to do this?


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

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.