When I trying to save my transaction then I have got below exception :
I am not getting why this exception came.
Please help me to solve this exception :
org.hibernate.property.BasicPropertyAccessor$BasicGetter get
SEVERE: IllegalArgumentException in class: Beans.CutomerOrderDetails, getter method of property: cutomerOrderDetailsId
org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of Beans.CutomerOrderDetails.cutomerOrderDetailsId
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:171)
at org.hibernate.tuple.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:176)
at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:3257)
Code :
CutomerOrderDetails.hbm.xmlCode:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Mar 11, 2011 3:45:21 PM by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping>
<class name="Beans.CutomerOrderDetails" table="CutomerOrderDetails" catalog="shopping">
<id name="cutomerOrderDetailsId" type="java.lang.Integer">
<column name="CutomerOrderDetailsId" />
<generator class="native" />
</id>
<property name="customerFirstName" type="string">
<column name="CustomerFirstName" length="50" not-null="true" />
</property>
<property name="customerLastName" type="string">
<column name="CustomerLastName" length="50" not-null="true" />
</property>
<set name="customerOrderItemDetailses" inverse="true">
<key>
<column name="CutomerOrderDetailsId" not-null="true" />
</key>
<one-to-many class="Beans.CustomerOrderItemDetails" />
</set>
</class>
</hibernate-mapping>
Code : CustomerOrderItemDetails.hbm.xmlCode:
<hibernate-mapping>
<class name="Beans.CustomerOrderItemDetails" table="CustomerOrderItemDetails" catalog="shopping">
<id name="customerOrderItemDetailsId" type="java.lang.Integer">
<column name="CustomerOrderItemDetailsId" />
<generator class="native" />
</id>
<many-to-one name="cutomerOrderDetails" class="Beans.CutomerOrderDetails" fetch="select" not-null="true">
<column name="CutomerOrderDetailsId" not-null="true" />
</many-to-one>
<property name="itemQuantity" type="int">
<column name="ItemQuantity" not-null="true" />
</property>
</class>
</hibernate-mapping>
Code:
[b]CutomerOrderDetails class[/b]
public class CutomerOrderDetails implements java.io.Serializable {
private int cutomerOrderDetailsId =0;
private String customerFirstName = null;
private String customerLastName= null;
private Set<CustomerOrderItemDetails> customerOrderItemDetailses = new HashSet(0);
public CutomerOrderDetails() {
}
public int getCutomerOrderDetailsId() {
return this.cutomerOrderDetailsId;
}
public void setCutomerOrderDetailsId(int cutomerOrderDetailsId) {
this.cutomerOrderDetailsId = cutomerOrderDetailsId;
}
public String getCustomerFirstName() {
return this.customerFirstName;
}
public void setCustomerFirstName(String customerFirstName) {
this.customerFirstName = customerFirstName;
}
public String getCustomerLastName() {
return this.customerLastName;
}
public void setCustomerLastName(String customerLastName) {
this.customerLastName = customerLastName;
}
public Set<CustomerOrderItemDetails> getCustomerOrderItemDetailses() {
return this.customerOrderItemDetailses;
}
public void setCustomerOrderItemDetailses(Set<CustomerOrderItemDetails> customerOrderItemDetailses) {
this.customerOrderItemDetailses = customerOrderItemDetailses;
}
}
POJO : CustomerOrderItemDetails
Code:
public class CustomerOrderItemDetails implements java.io.Serializable {
private Integer customerOrderItemDetailsId=0;
private CutomerOrderDetails cutomerOrderDetails;
private int itemQuantity;
public CustomerOrderItemDetails() {
}
public Integer getCustomerOrderItemDetailsId() {
return this.customerOrderItemDetailsId;
}
public void setCustomerOrderItemDetailsId(Integer customerOrderItemDetailsId) {
this.customerOrderItemDetailsId = customerOrderItemDetailsId;
}
public CutomerOrderDetails getCutomerOrderDetails() {
return this.cutomerOrderDetails;
}
public void setCutomerOrderDetails(CutomerOrderDetails cutomerOrderDetails) {
this.cutomerOrderDetails = cutomerOrderDetails;
}
public int getItemQuantity() {
return this.itemQuantity;
}
public void setItemQuantity(int itemQuantity) {
this.itemQuantity = itemQuantity;
}
}
[/b]