-->
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: Mapping problem
PostPosted: Mon Dec 12, 2011 3:52 am 
Newbie

Joined: Fri May 22, 2009 3:35 am
Posts: 5
Hi, i have problem with OneToMany mapping.

I have tables like this:
http://www.mitrov.cz/mapping.png

Is any way to map OneToMany from two entities Extendable1 and Extendable2 to same entity Extender with and all cascades.

I try bidirectional OneToMany (on extender side map extendable_id as Long extendableId). There is problem with manual assign this (not null) property. Extendable mapping like this.

Code:
  @OneToMany(mappedBy="extendableId", cascade = CascadeType.ALL, orphanRemoval = true)
  private Set<Extender> extenders = new HashSet<Extender>();


Than i try unidirectional OneToMany (on extender side is extendable_id omitted) and on Extendable with

Code:
  @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
  @JoinColumn(name="EXTENDABLE_ID", nullable=false)
  private Set<Extender> extenders = new HashSet<Extender>();


This not working because
https://hibernate.onjira.com/browse/HHH-5836

Is there another working solution please.


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.