Hi Isomorphic,
We are doing fetch operation which inturn calls an update operation.
We face an issue while performing an update operation. The update query is formed with 2 criteria (The fields used in criteria is primary key).
In the datasource file, we have specified "primary key = true" in the field definition.
Datasource:
<binding operationType="update" serverMethod="update">
<serverObject lookupStyle="spring" bean="invoice" />
<whereClause>
($defaultWhereClause)
and reference = $advancedCriteria.ref
and version = $advancedCriteria.ver
</whereClause>
</binding>
<field name="reference" type="text" primaryKey="true"></field>
<field name="version" type="int" primaryKey="true"></field>
<field name="status" type="text"></title>
code:
DSRequest request = new DSRequest("testDs", "update",rpcManager);
request.addToCriteria("ref",((String) dsRequest.getCriteriaValue("reference")));
request.addToCriteria("ver",((String) dsRequest.getCriteriaValue("version")));
request.execute();
Error from Log:
com.isomorphic.base.UpdateWithoutPKException: Criteria received from the client for update operation is missing the following required unique and/or primary fields: [reference,version]. Either provide all primary key fields or set allowMultiUpdate or providesMissingKeys on the OperationBinding (see the client-side docs for details of those flags
Could you please help me to solve the issue.
Thanks,
Manjula
We are doing fetch operation which inturn calls an update operation.
We face an issue while performing an update operation. The update query is formed with 2 criteria (The fields used in criteria is primary key).
In the datasource file, we have specified "primary key = true" in the field definition.
Datasource:
<binding operationType="update" serverMethod="update">
<serverObject lookupStyle="spring" bean="invoice" />
<whereClause>
($defaultWhereClause)
and reference = $advancedCriteria.ref
and version = $advancedCriteria.ver
</whereClause>
</binding>
<field name="reference" type="text" primaryKey="true"></field>
<field name="version" type="int" primaryKey="true"></field>
<field name="status" type="text"></title>
code:
DSRequest request = new DSRequest("testDs", "update",rpcManager);
request.addToCriteria("ref",((String) dsRequest.getCriteriaValue("reference")));
request.addToCriteria("ver",((String) dsRequest.getCriteriaValue("version")));
request.execute();
Error from Log:
com.isomorphic.base.UpdateWithoutPKException: Criteria received from the client for update operation is missing the following required unique and/or primary fields: [reference,version]. Either provide all primary key fields or set allowMultiUpdate or providesMissingKeys on the OperationBinding (see the client-side docs for details of those flags
Could you please help me to solve the issue.
Thanks,
Manjula
Comment