-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Exception hibernate.property.BasicPropertyAccessor$BasicGett
PostPosted: Mon Mar 14, 2011 3:33 am 
Newbie

Joined: Mon Mar 14, 2011 2:04 am
Posts: 1
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.xml
Code:
<?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.xml
Code:
<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]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.