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 post
http://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.