-->
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.  [ 4 posts ] 
Author Message
 Post subject: problem with @hibernate.set
PostPosted: Sun Aug 31, 2003 1:38 pm 
hi all!

i have some problems using hibernate with xdoclet. here a sample:

an object "Person" should have the folowing relatinships:
ONE father (also an "Person" object)
MANY children ("Person" objects)

public class Person {

private Long id;

private String lastName;

private String firstName;

private Person father;

private Set children;

/**
*
* @return
*
* @hibernate.id column = "id" generator-class = "native"
*/
public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

/**
*
* @return
*
* @hibernate.property
*/
public String getLastName() {
return lastName;
}

public void setLastName(String lastName) {
this.lastName = lastName;
}

/**
*
* @return
*
* @hibernate.property
*/
public String getFirstName() {
return firstName;
}

public void setFirstName(String firstName) {
this.firstName = firstName;
}


public Person getFather() {
return father;
}

public void setFather(Person person) {
this.father = person;
}

public Set getChildren() {
return children;
}

public void setChildren(Set children) {
this.children = children;
}

}


can someone help me with the xdoclet part for "father" and "children" ?

many thanx in advance!
blip

p.s.: i could not find a doc or howto for this ... - is there one out there?


Top
  
 
 Post subject:
PostPosted: Sun Aug 31, 2003 7:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Have a look in the samples directory of the xdoclet dist.


for father it would be:


@hibernate.many-to-one


for children:


@hibernate.set lazy="true" ....
@hibernate.collection-key column = "...."
@hibernate.collection-one-to-many


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 31, 2003 7:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
ick!



Posted: Sun Aug 31, 2003 11:06 pm Post subject:
Have a look in the samples directory of the xdoclet dist.


for father it would be:


@hibernate.many-to-one


for children:


@hibernate.set lazy="true" ....
@hibernate.collection-key column = "...."
@hibernate.collection-one-to-many class="..."


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 02, 2003 3:54 am 
thanx!

i'm still looking for a tutorial/howto for hibernate-xdoclet. the tag discription is far from usable; e.g: what "tag combination" is best for a new bidirectional many-to-one mapping ....

blip


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

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.