Hello!
Is it possible to implement loops
many-to-one or
one-to-many in/with one Type of Entity?
I mean... for example (simply abstract):
Code:
@Entity
@Table(name="atable")
class A {
@Id
private id;
private parent_id;
@Transient
@ManyToOne(targetEntity=A.class)
@JoinColumn(name="id", table="atable", referencedColumnName="parent_id")
private List<A> children;
}
Is something like written above possible?
Thank You in advance.
P.S. there is one
but --- i may not change DB-structure. I work in pojo mode (ddl-validation). I may not set FK on parent_id and may not set
children-property persistent.