-->
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: SAP DB with sequence generator working ok ?
PostPosted: Wed Mar 30, 2005 5:17 am 
Newbie

Joined: Fri Mar 04, 2005 3:00 pm
Posts: 14
Hello,
anyone got any ideeas why i am not able to save a record in a sapDB database when using sequence? what other generators work for SAP ?

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
[\code]


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;
}

[/code]
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>

[/code]
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  
 
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.