-->
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: How to embed class within List in POJO?
PostPosted: Sun Jun 06, 2010 2:32 pm 
Newbie

Joined: Tue Feb 16, 2010 6:57 pm
Posts: 17
I am using Hibernate 3 and all available Annotations.

I really need an example on this as I have no idea how this is done and finally gave up after fiddling with it long enough. I have 2 Classes (ABC, TestSubClass). A List of TestSubClass is part of the ABC Class.
Code:
@Entity 
Public Class ABC { 
         ..... 
     //@CollectionOfElements 
     @Embedded 
     private List<TestSubClass> testSubClassList = new ArrayList<TestSubClass>(); 
        // Getters/Setters of testSubClassList 
        ..... 

   
@Embeddable 
public class TestSubClass { 
                     ................
}


I need Class ABC to be mapped and populated with a list of TestSubClass (i.e. testSubClassList) objects inside an instance of Object ABC. Various exceptions when persisting to MySQL.

How shall I do this? Please help.

Any help will be greatly appreciated.


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.