I tried it here are my files, can someone tell me what's wrong in my mapping Please.
Code:
/*
* Created on Feb 4, 2004
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package org.jcboe.db.hb.hibernate;
import java.util.Set;
import java.util.HashSet;
/**
* @author singh
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class TableA {
private int id;
private int tableB_id1;
private int tableB_id2;
private String names;
private TableB b;
private Set tablec=new HashSet();
/**
* @return
*/
public int getId() {
return id;
}
/**
* @return
*/
public String getNames() {
return names;
}
/**
* @return
*/
public int getTableB_id1() {
return tableB_id1;
}
/**
* @return
*/
public int getTableB_id2() {
return tableB_id2;
}
/**
* @param i
*/
public void setId(int i) {
id = i;
}
/**
* @param string
*/
public void setNames(String string) {
names = string;
}
/**
* @param i
*/
public void setTableB_id1(int i) {
tableB_id1 = i;
}
/**
* @param i
*/
public void setTableB_id2(int i) {
tableB_id2 = i;
}
/**
* @return
*/
public Set getTablec() {
return tablec;
}
/**
* @param set
*/
public void setTablec(Set set) {
tablec = set;
}
/**
* @return
*/
public TableB getB() {
return b;
}
/**
* @param tableB
*/
public void setB(TableB tableB) {
b = tableB;
}
}
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="org.jcboe.db.hb.hibernate.TableA" table="tablea">
<id name="id" type="int">
<column name="id" sql-type="int"/>
<generator class="increment"/>
</id>
<property name="names"/>
<property name="tableB_id1"/>
<property name="tableB_id2"/>
<many-to-one name="b" class="TableB">
<column name="id1"/>
<column name="id2"/>
</many-to-one>
<set name="tablec" table=tablec>
<key column="tablea_id"/>
<one-to-many class="TableC"/>
</set>
</class>
</hibernate-mapping>
<!-- parsed in 0ms -->
Code:
/*
* Created on Feb 4, 2004
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package org.jcboe.db.hb.hibernate;
/**
* @author singh
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class TableB {
private int id1;
private int id2;
private String address;
private TableA btablea;
/**
* @return
*/
public String getAddress() {
return address;
}
/**
* @return
*/
public int getId1() {
return id1;
}
/**
* @return
*/
public int getId2() {
return id2;
}
/**
* @param string
*/
public void setAddress(String string) {
address = string;
}
/**
* @param i
*/
public void setId1(int i) {
id1 = i;
}
/**
* @param i
*/
public void setId2(int i) {
id2 = i;
}
/**
* @return
*/
public TableA getBtablea() {
return btablea;
}
/**
* @param tableA
*/
public void setBtablea(TableA tableA) {
btablea = tableA;
}
}
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="org.jcboe.db.hb.hibernate.TableB" table="tableb">
<composite-id>
<key-property name="id1"/>
<key-property name="id2"/>
</composite-id>
<property name="address"/>
<one-to-one property-ref="" name="btablea"/>
</class>
</hibernate-mapping>
<!-- parsed in 0ms -->
Code:
/*
* Created on Feb 4, 2004
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package org.jcboe.db.hb.hibernate;
/**
* @author singh
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class TableC {
private String code;
private int tableA_id;
private String someInfo;
private TableA ctablea;
/**
* @return
*/
public String getCode() {
return code;
}
/**
* @return
*/
public String getSomeInfo() {
return someInfo;
}
/**
* @return
*/
public int getTableA_id() {
return tableA_id;
}
/**
* @param string
*/
public void setCode(String string) {
code = string;
}
/**
* @param string
*/
public void setSomeInfo(String string) {
someInfo = string;
}
/**
* @param i
*/
public void setTableA_id(int i) {
tableA_id = i;
}
/**
* @return
*/
public TableA getCtablea() {
return ctablea;
}
/**
* @param tableA
*/
public void setCtablea(TableA tableA) {
ctablea = tableA;
}
}
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="org.jcboe.db.hb.hibernate.TableC" table="tablec">
<property name="code"/>
<property name="someInfo"/>
<property name="tableA_id"/>
<many-to-one name="ctablea"/>
</class>
</hibernate-mapping>
<!-- parsed in 0ms -->