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.