Hi There,
I have a question about one-to-one formula. Let's say I have domain object and container (org uint) object. Domain has list of containers, but only one is rootContainer. So domain to rootContainer is one-to-one mapping base on container.parent is null. So I'm using one-to-one with formula for this purpose. <class name="Domain" ...> <id name"id" type="long"> <generator class="native"/> </id> <one-to-one name="rootContainer" class="Container" property-ref="rootContainer"> <formula>id</formula> <formula>null</formula> </one-to-one> </class> <class name="Container" ...> <id name"id" type="long"> <generator class="native"/> </id> <propperties name"rootContainer" > <many-to-one name="domain" class="Domain"> <column name="domainid"/> </many-to-one> <many-to-one name="parent" class="Container"> <column name="parentid"/> </many-to-one> </properties> <set name="children" inverse="true"> <key column="parentid"/> <one-to-many class="Container" /> </set> </class> I know it doesn't work, my question is: for two formulas, how can I set domain object for first formula parameter? How can I set null object reference as second formula parameter instead of "null" string? Any hint will be highly appreciated. Thanks Wei
_______________________________________________ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev