You can resolve this with:
@Entity
| public class A implements Serializable{
|
| @Id
| @GeneratedValue(strategy = GenerationType.IDENTITY)
| @Column(name="id_a")
| private int id;
|
| @OneToMany(mappedBy="a", fetch = FetchType.EAGER)
| @Cascade(CascadeType.ALL)
| private Set<C> cs = new HashSet<C>();
|
| .
| .
| .
|
| }
|
| @Entity
| public class B implements Serializable{
|
| @Id
| @GeneratedValue(strategy = GenerationType.IDENTITY)
| @Column(name="id_b")
| private int id;
|
| @OneToMany(mappedBy="b", fetch = FetchType.EAGER)
| @Cascade(CascadeType.ALL)
| private Set<C> cs = new HashSet<C>();
|
| .
| .
| .
|
| }
|
| @Entity
| public class C implements Serializable{
|
| @ManyToOne(fetch = FetchType.EAGER)
| @JoinColumn(name="id_a", insertable=true, updatable=true)
| @Fetch(FetchMode.JOIN)
| @Cascade(CascadeType.SAVE_UPDATE)
| private A a;
|
| @ManyToOne(fetch = FetchType.EAGER)
| @JoinColumn(name="id_b", insertable=true, updatable=true)
| @Fetch(FetchMode.JOIN)
| @Cascade(CascadeType.SAVE_UPDATE)
| private B b;
|
| .
| .
| .
| }
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112298#4112298
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112298
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user