-->
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 same class twice within other class
PostPosted: Tue Jan 19, 2010 3:39 pm 
Newbie

Joined: Tue Jan 19, 2010 3:24 pm
Posts: 1
Hello guys,
I am having trouble mapping same class twice within other class. To illustrate the problem lets imagine following scenario:
Code:
@Entity
@Table(name="BODY")
public class Body {
    @Id
    private Integer id;
    @Column
    private BloodGroup bloodGroup;
>>>>>>>>>>>>>>> HOW TO MAP THIS PART? <<<<<<<<<<<<<<<<<
    private Hand leftHand;
    private Hand rightHand;
>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<
   // getter and setters ommited
}

@Entity
@Table(name="HAND")
public class Hand {
    @Id
    private Integer id;
    @Column
    private String type;
>>>>>>>>>>>>>>> HOW TO MAP THIS PART? <<<<<<<<<<<<<<<<<
    private Body body;
>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<
   // getter and setters ommited
}

How should the hands (left, right) inside Body class and body inside Hand class be mapped?

Michael


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.