-->
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: one to one relationship to another row in a table using xdoc
PostPosted: Sat Feb 12, 2005 5:31 pm 
Newbie

Joined: Sat Feb 12, 2005 5:05 pm
Posts: 1
Hi, I have a unique situation where I have this table(call it Property) and property has the following columns:

property_id
property_name
property_type
lookup_id

The column lookup_id has the ability to point to another property row in the table. It's basically a one to one relationship with another row in the table. Is there any way to do this in a simple java class using the xdoclet tags? I've looked at posthttp://forum.hibernate.org/viewtopic.php?t=929450 and that didn't seem to work for me. Basically I have the following rows:
property_id, property_name, property_type, lookup_id
100, justaProp, String, NULL
200, justaProp2, String, 100

My class name is Property and it has the following getter declared:
private Property lookupId;

/**
* @hibernate.one-to-one class="com.Property" property-ref="lookup_id" cascade="all"
* @return
*/
public Property getLookupId()
{
return lookupId;
}

The column property_id is declared :
/**
* @return
* @hibernate.id column="property_id" generator-class="native"
* @hibernate.generator-param name="sequence" value="PROPERTY_SEQ"
*/
public Integer getId()
{
return super.getId();
}

I guess what i'm trying to do is get a nested Property within a Property that points to a different row. I hope this makes sense; any help is appreciated.


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.