-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Prent-Child in/with one single Entity/Typ
PostPosted: Tue Dec 02, 2008 3:05 pm 
Newbie

Joined: Tue Dec 02, 2008 2:47 pm
Posts: 3
Location: Linz, Austria
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.

_________________
veni vedi vici


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.