java - Hibernate mapping -
I have found a table with a PK and a value "country", all my labels are fixed in another table Which is composite-IDS
Does anyone have an example for me that how can I map the value of my country for the right label in another country?
McKings are bound to PK, if I am not wrong.
& lt; Class name = "hibernate.P1" table = "P1" & gt; & Lt; Id name = "id" type = "int" & gt; & Lt; Column name = "lfnr" exact = "7" scale = "0" /> & Lt; / Id & gt; & Lt; Property name = "land" type = "int" no-null = "true" & gt; & Lt; Column name = "LAND" exact = "1" scale = "0" /> & Lt; / Property & gt;
& lt; Class name = "hibernate.P5" table = "P5" & gt; & Lt; Composite-id name = "id" class = "hibernate.P5Id" & gt; & Lt; Key-property name = "tab" type = "string" & gt; & Lt; Column name = "TAB" length = "4" /> & Lt; / Key-asset & gt; & Lt; Key-property name = "lfnr" type = "string" & gt; & Lt; Column name = "lfnr" length = "4" /> & Lt; / Key-asset & gt; & Lt; Key-property name = "usa" type = "string" & gt; & Lt; Column name = "USA" length = "4" /> & Lt; / Key-asset & gt; & Lt; Key-property name = "hier" type = "int" & gt; & Lt; Column name = "HIER" exact = "2" scale = "0" /> & Lt; / Key-asset & gt; & Lt; Key-property name = "land" type = "int" & gt; & Lt; Column name = "LAND" exact = "3" scale = "0" /> & Lt; / Key-asset & gt; & Lt; Key-property name = "abstract" type = "string" & gt; & Lt; Column name = "sort" length = "3" /> & Lt; / Key-asset & gt; & Lt; / Mixed-id & gt; & Lt; Property name = "label" type = "string" & gt; & Lt; Column name = "LABEL" length = "50" /> & Lt; / Property & gt; .....
I unfortunately can not change the layout of the DB
Since you can not guarantee that only one line P1 will be in P1 for one line in the table , You should include one set in one-to-many, that is P1 which contains an element of P5 itself.
Comments
Post a Comment