-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hexception:org.hibernate.PropertyAccessException
PostPosted: Mon Mar 28, 2005 6:46 am 
Newbie

Joined: Fri Mar 04, 2005 3:00 pm
Posts: 14
Hello,

I am encountering the following error when tring to save an object to the database:
Code:
org.hibernate.event.AbstractSaveEventListener - saving [ro.citrusmedia.lims.web.webclients.WebClientInfo#1]
ERROR 2005-03-28 02:10:43,591  org.hibernate.property.BasicPropertyAccessor - IllegalArgumentException in class: ro.citrusmedia.lims.web.webclients.WebClientInfo, setter method of property: ID
ERROR 2005-03-28 02:10:43,601  org.hibernate.property.BasicPropertyAccessor - expected type: java.lang.Integer, actual value: java.lang.Long
ERROR 2005-03-28 02:10:43,771  ro.citrusmedia.lims.web.BaseDAO - Hexception:org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of ro.citrusmedia.lims.web.webclients.WebClientInfo.ID



Problem is, i don't have any field of type Long :

here's a part of my java class :
Code:
/**
     * @hibernate.id column = "`ID`" 
     *               unsaved-value = "null"
     *               generator-class = "sequence"
     */
    public Integer getID()
    {
        return ID;
    }

    public void setID(Integer id)
    {
        ID = id;
    }


i know the sequence generator returns either long, or int or short so here's no problem (some one had the same error but he expected int from an uuid.hex generator, which returns strings )

here's the generated mapping file :
Code:
<id
            name="ID"
            column="`ID`"
            type="java.lang.Integer"
            unsaved-value="null"
        >
            <generator class="sequence">
            </generator>


and finally in the database the ID column is of type Integer,
After all this, i receive an error saying that hibernate expects integer instead of long ; where do I have long and don't have integer?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 28, 2005 12:57 pm 
Newbie

Joined: Fri Mar 04, 2005 3:00 pm
Posts: 14
if this helps, I work with SAPDB....
hope to have some answers
thanks.


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

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.