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?
|