I have a hibernate Datasource in a simple ListGrid. The Datasource has a composite primary key. Whenever I try to make updates or add new rows I got an error message:
Here's my Datasource file:
I'm looking at the request in the developer console and both fields for the primary key are there. Here's the request:
I also tried setting the allowMultiUpdate in the operation binding, but that gave me another message that the primary key was null. Is there something I'm doing wrong?
Criteria received from the client for add operation is missing the following non-sequence primary key fields: [hardwareTypePK.hdwTypeId, hardwareTypePK.locale]. Either provide all primary key fields that are not sequences, or set allowMultiUpdate on the OperationBinding
Code:
<DataSource ID="HardwareType" serverType="hibernate" beanClassName="com.assaabloy.aaos.shared.entities.aaos.HardwareType" configBean="aaosSessionFactory"> <fields> <field name="hardwareTypePK.hdwTypeId" type="text" title="Hardware Type" primaryKey="true" /> <field name="hardwareTypePK.locale" type="text" hidden="true" primaryKey="true" /> <field name="nativeType" type="text" /> <field name="description" type="text" /> <field name="sortOrder" type="integer" /> </fields> </DataSource>
Code:
{ dataSource:"HardwareType", operationType:"add", componentId:"isc_ListGrid_1", data:{ hardwareTypePK:{ locale:"en_US", hdwTypeId:"ds" }, nativeType:"ds", description:"asdf", sortOrder:40 }, textMatchStyle:"exact", callback:"isc_ListGrid_1.$337(dsResponse, dsRequest)", willHandleError:true, showPrompt:false, oldValues:{ hardwareTypePK:{ locale:"en_US", hdwTypeId:"ds" }, nativeType:"ds", description:"asdf", sortOrder:40 }, requestId:"HardwareType$6273", internalClientContext:{ saveCallback:{ }, newValues:{ hardwareTypePK:Obj, nativeType:"ds", description:"asdf", sortOrder:40 }, editInfo:{ editValuesID:"_0", rowNum:35, colNum:3, values:Obj, editCompletionEvent:"enter" } }, fallbackToEval:false, lastClientEventThreadCode:"KPR4", bypassCache:true, dataProtocol:"getParams" }
Comment