[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| 
[eclipselink-users] none of the @OneToMany fields are being	persisted in an @Embeddable class
 | 
Hi,
I have a problem using eclipselink 2.2.0 in that none of the @OneToMany fields are being persisted in and @Embeddable class. The partial source is below with Container being the container class for the Emb class - The tables are created as I would expect, but on trying to persist a Container object none of Many objects are written to the database. Is this a bug or am I doing something wrong?
@Entity
public class Container implements Serializable {
    @Id
    @GeneratedValue
    private int id;
    private String incnt;
    @Embedded
    private Emb em;
}
@Embeddable
public class Emb implements Serializable {
    protected String simple;
    @JoinColumn(name = "CONT_IDENTIFIER", referencedColumnName = "ID")
    @OneToMany(cascade = PERSIST, orphanRemoval = false)
    protected List<Many> lots;
}
@Entity
public class Many implements Serializable {
        
	@Id
	@GeneratedValue
        protected int id;
	protected String name;
	protected int other;
	
}