Using SmartGWT 2.5 Pro
I've setup a DMI DataSource
The "IssueResultLog" model has testId as type int.
When performing a fetch, I'm setting the criteria for testId.
Transaction ends up having a type of LONG, and then I get a cast exception.
How so I avoid this, what do I need to do differently. Changing POJO's to have types of long is not an option.
I've setup a DMI DataSource
Code:
<DataSource ID="issueLog" tableName="issueLog" schemaBean="model.IssueResultLog"> <serverObject className="dmi.IssueLogDMI"/> <fields> <field name="resultId" title="Results ID" type="sequence" primaryKey="true" /> <field name="testId" title="Test ID" type="integer" /> ...snip.... </fields> </DataSource>
When performing a fetch, I'm setting the criteria for testId.
Code:
Integer testId = 1; Criteria criteria = new Criteria(); criteria.addCriteria("testId", testId); listGrid.fetchData(criteria);
Code:
<criteria xsi:type="xsd:Object"> <testId xsi:type="xsd:long">1</testId> </criteria>
Code:
00:28:35.727 [ERROR] 15:55:14.473:XRP0:WARN:RPCManager:java.lang.Long cannot be cast to java.lang.Integer, response: {operationId: "issueLog_fetch", clientContext: Obj, context: Obj, transactionNum: 5, httpResponseCode: 200, httpResponseText: "//isc_RPCResponseStart-->[{isDSResponse:..."[156], xmlHttpRequest: [object XMLHttpRequest], transport: "xmlHttpRequest", status: -1, clientOnly: undef, httpHeaders: Obj, isStructured: true, callbackArgs: null, results: Obj, isDSResponse: true, invalidateCache: false, data: "java.lang.Long cannot be cast to java.la..."[50], startRow: 0, endRow: 0, totalRows: 0} com.smartgwt.client.core.JsObject$SGWT_WARN: 15:55:14.473:XRP0:WARN:RPCManager: java.lang.Long cannot be cast to java.lang.Integer, response: {operationId: "issueLog_fetch", clientContext: Obj, context: Obj, transactionNum: 5, httpResponseCode: 200, httpResponseText: "//isc_RPCResponseStart-->[{isDSResponse:..."[156], xmlHttpRequest: [object XMLHttpRequest], transport: "xmlHttpRequest", status: -1, clientOnly: undef, httpHeaders: Obj, isStructured: true, callbackArgs: null, results: Obj, isDSResponse: true, invalidateCache: false, data: "java.lang.Long cannot be cast to java.la..."[50], startRow: 0, endRow: 0, totalRows: 0} at sun.reflect.GeneratedConstructorAccessor104.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) at java.lang.Thread.run(Thread.java:662)
Comment