How do define We think that I was trying this: But this effusive mapping does not do anything to generate an exception during the running time. It says that property can not be found inside Help me to complete my Java code: country Prime Minister The problem is in the connection between your XML mapping and your java code. If you specify your You do not have any such fields. If your If neither of the others are references to the class, you have to add one. What I will do with your code, add the field to the country and use its name in the mapping. Mapping: Disclaimer: I have not tested any of these, and I'm not sure how mapping should be done If it seems like sharing a test version with the shared primary key, then I can happily give another answer or turn it on to "Community Wiki". one-by-one relationship between 2 classes? I think I'm going somewhere wrong, ideologically. I do not know what this is, but it is.
country and
prime minister :
& 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;
name_pm in
country class! But does it search within the
country category. It should search within the
PM class
one-by-one mapping between 2 classes I have some time I am trying for it.
public class country {Private Int c_id; Private string name_c; Public int getC_id () {return c_id; } Public Zero setC_id (int c_id) {this.c_id = c_id; } Public string getName_c () {return name_c; } Public Zero setName_c (string name_c) {this.name_c = name_c; }}
The Prime Minister of the Public Sector {Private Ent C_id; Private string name_pair; Public int getC_id () {return c_id; } Public Zero setC_id (int c_id) {this.c_id = c_id; } Public string getName_pm () {return name_pm; } Public Zero setName_pm (string name_pm) {this.name_pm = name_pm; }}
& lt; One-to-one class = "pojo.PM" name = "name_pm" /> Your name must be named "name_pm" in
country POJO.
country class has an area for the prime minister, then the name of that area should be used here.
public class country {Private Ent C_id; Private string name_c; Private PM c_pm; Public int getC_id () {return c_id; } Public Zero setC_id (int c_id) {this.c_id = c_id; } Public string getName_c () {return name_c; } Public Zero setName_c (string name_c) {this.name_c = name_c; } Public PM getC_pm () {Return c_pm; } Public Zero setC_pm (PM c_PM) {this.c_pm = c_pm; }}
& 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 = "c_pm" /> & Lt; / Square & gt;
No comments:
Post a Comment