I tried to setup a test using mysql as a datasource using the OrmDatasource example (only renamed the class to HibernateDS).
I can show the result (using the fetch) - and can add new records !
When i try to make an update or an remove i get the exception below !
Where do i need to change that conversion - as in Hibernate and in the Datasource everything is configured as "int" - where is the "long" comming from ?
My class is my SimpleUser
The datasource is defined like this:
The hibernate file for that entity looks like that:
I can show the result (using the fetch) - and can add new records !
When i try to make an update or an remove i get the exception below !
Where do i need to change that conversion - as in Hibernate and in the Datasource everything is configured as "int" - where is the "long" comming from ?
Code:
2010-01-22 00:21:58,930 [l0-5] DEBUG RPCManager - Request #1 (DSRequest) payload: { criteria:{ ID:1, admin:false, firstname:"xxxxx", lastname:"xxxxx", loginname:"xxxxx", version:0, _selection_4:true }, operationConfig:{dataSource:"users", operationType:"remove"}, appID:"builtinApplication", operation:"users_remove", oldValues:{ ID:1, admin:false, firstname:"xxxxx", lastname:"xxxxx", loginname:"xxxxx", version:0, _selection_4:true } } === 2010-01-22 00:21:58,930 [l0-5] INFO IDACall - Performing 1 operation(s) === 2010-01-22 00:21:58,930 [l0-5] DEBUG DataSource - Creating instance of DataSource 'users' === 2010-01-22 00:21:58,930 [l0-5] DEBUG AppBase - [builtinApplication.users_remove] No userTypes defined, allowing anyone access to all operations for this application === 2010-01-22 00:21:58,930 [l0-5] DEBUG AppBase - [builtinApplication.users_remove] No public zero-argument method named '_users_remove' found, performing generic datasource operation [DEBUG] Loading the Hibernate DS === 2010-01-22 00:21:58,937 [l0-5] WARN RequestContext - dsRequest.execute() failed: org.hibernate.TypeMismatchException: Provided id of the wrong type for class com.amergy.cmt.client.server.customds.SimpleUser. Expected: class java.lang.Integer, got class java.lang.Long at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:109) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:905) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:842) at com.amergy.cmt.client.server.customds.HibernateDS.executeRemove(HibernateDS.java:189) at com.isomorphic.datasource.DataSource.execute(DataSource.java:802) at com.amergy.cmt.client.server.customds.HibernateDS.execute(HibernateDS.java:60) at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:708) at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:665) at com.isomorphic.application.AppBase.execute(AppBase.java:498) at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1175) at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:155)
My class is my SimpleUser
Code:
public class SimpleUser implements Serializable{ private int ID; private int version; private String firstname; private boolean admin = false; private String lastname; private String loginname; --------------getters and setters -------------------- }
Code:
<fields> <field name="ID" type="sequence" primaryKey="true"/> <field name="firstname" type="text" lentght="255" /> <field name="admin" typ="boolean"/> <field name="lastname" type="text" length="255"/> <field name="loginname" type="text" length="255"/> </fields>
Code:
<class name="com.amergy.cmt.client.server.customds.SimpleUser" table="SIMPLEUSER" lazy="false"> <id name="ID" type="int"> <column name="ID" /> <generator class="native"></generator> </id> <version name="version" type="int"> <column name="version" not-null="true" /> </version> -----------and all the other fields from the entity -------------
Comment