public class EntParent{
@OneToMany
List<Ent1> manyEnt1;
}
public class Ent1 {
Field1
Field2
@ManyToOne
EntParent dad;
getField1
setField1
getField2
setField2
getDad
setDad
}
public class Ent1ManagerEJB{
}
in this scenario who(Ent1 or Ent1ManagerEJB or EntParent) should have methods to perform following
1) manipulate fields in Ent1
2) fetch fields of Ent1 with some logic
3) Fetch some other Entity depending on some logic that works on values of fields in Ent1,if EntParent and mappings are absent
4) Fetch some other Entity depending on some logic that works on values of fields in Ent1,if Ent1 is in @OneToMany mapping with some other Entity eg EntParent contains Ent1 in array
also if possible point to some resource that teaches me about such patterns/problems..