Saturday, 15 January 2011

java - Unable to make 'one-to-one' relationship between the two classes -


What do I do to xml one by one Relationship between country class and prime minister class

  & lt; Class name = "pojo.ountry" table = "country" & gt; & Lt; Id name = "c_id" & gt; & Lt; Generator class = "increment increase" /> & Lt; / Id & gt; & Lt; Property Name = "name_c" /> & Lt; One-to-one class = "pojo.PM" name = "name_pam" /> & Lt; / Square & gt; & Lt; Class name = "pojo.PM" table = "pm" & gt; & Lt; Id name = "c_id" & gt; & Lt; Generator class = "increment increase" /> & Lt; / Id & gt; & Lt; Property name = "name_pam" /> & Lt; / Square & gt; I am creating a one-by-one relationship between   

which is the property defined within the PM class and Name_c which is the property defined in the country category. The problem occurs when I write:

  & lt; One-to-one class = "pojo.PM" name = "name_pm" />   

It starts searching within name_pm class PM for search within country name_pm and name_c < / P>

Looks like a wrong syntax.

  & lt; From-a-name = "pmNameInCountryPojo" class = "pojo.PM" cascade = "save-update" & gt; & Lt; / One-to-one>    

No comments:

Post a Comment