How do I use a mappedBy for a PK which is composite and one of the fields in 
the composite key (that forms a FK relationship) needs to be mapped:


  | Module {
  | @Id int moduleID
  | 
  | @OneToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER,mappedBy=?) 
  | @MapKey(name="name"
  | Map<String,ModuleProperty> properties = new 
HashMap<String,ModuleProperty>();
  | 
  | ..
  | ..
  | }
  | 
  | @Embeddable
  | ModulePropertyPK {
  |     @ManyToOne
  |     @JoinColumn(name="MODULEID")
  |      Module module;
  |      String name;
  | ..
  | ..
  | }
  | 
  | ModuleProperty {
  | @EmbeddedId 
  |     @AttributeOverrides( {
  |                     @AttributeOverride(name = "module", column = 
@Column(name = "MODULEID")),
  |                     @AttributeOverride(name = "name", column = @Column(name 
= "NAME")) })
  | ModulePropertyPK id;
  | ..
  | ..
  | }
  | 

any attempt of trying to put a getter/setter for module in ModuleProperty 
results in a column called "MODULE" in the MODULEPROPERTY table. If I don't 
have the module getter/setter in the ModuleProperty class, the deployer throws 
missing property exception. Isn't the @AttributeOverrides meta-tag supposed to 
provide that mapped property?



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3946500#3946500

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3946500


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to