-->
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: one-to-many Mapping
PostPosted: Mon Dec 28, 2009 9:38 am 
Newbie

Joined: Mon Dec 28, 2009 6:30 am
Posts: 1
i have 2 tables these are as follows
Code:
                     User                                                                      emails
-----------------------------------------                   ----------------------------------------------------------------
user_id          | user_name                     |                   email_id          | email_content        | owner_user
-----------------------------------------                   ----------------------------------------------------------------
001               | user01                                                 001         | content01             | 002
002               | user02                                                 002         | content02             | 001
003               | user03                                                 003         | content03             | 003
                                                                           004         | content04             | 003
                                                                           005         | content05             | 001


Pojos

Code:
public class User{
    private int userId;
    private String userName;
    private Set<Email> emails;
      // seters and geters

}

public class Email{
    private int emailId;
    private String emailContent;
      // seters and geters

}

my Request: i want to write Mapping Files that represents this Relation using <set> and <on-to-many> tags


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.