I\'ve got some problem with hibernate @OneToMany mapping. It goes like here
@Entity
@Table(name = \"albums\")
@SequenceGenerator(name = \"ALBUMS
I was facing the same problem, but what worked for me was
B oB = new B(); // Class B contains two objects of class A
A oA1 = new A();
oA1.Name = "First";
oB.PlaceA1 = oA1;
A oA2 = new A();
oA2.Name = "Second";
oB.PlaceA2 = oA2;
Changed to
B oB = new B(); // Class B contains two objects of class A
A oA1 = new A();
oA1.ID = 1; // This was missing(Manual Assignment of ID field)
oA1.Name = "First";
oB.PlaceA1 = oA1;
A oA2 = new A();
oA2.ID = 2; // This was missing(Manual Assignment of ID field)
oA2.Name = "Second";
oB.PlaceA2 = oA2;