Hi,
I'm using SmartGWTPower 3.1p.
I got fetching a ManyToMany field to work using the JPADatasource. However I can't seem to get update working.
Here is the Request shown in the logs:
It seems to me the request part is in order. (I am adding action id 6 to the ManyToMany field called "actions") I don't see any errors down the log but my suspicion is this line might be the problem:
Here is the xml and js output for roleDs:
Here is the xml and js output for actionDs:
Any hints on where I went wrong? Do I have to have an explicit reverse mapping in actionDs?
Here is the rest of the logs after the request above for completeness:
Thanks,
Ech
I'm using SmartGWTPower 3.1p.
I got fetching a ManyToMany field to work using the JPADatasource. However I can't seem to get update working.
Here is the Request shown in the logs:
Code:
15:19:44,756 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,756 [43-5] DEBUG RPCManager - Request #1 (DSRequest) payload: { 15:19:44,756 INFO [stdout] (http--0.0.0.0-8443-5) criteria:{ 15:19:44,756 INFO [stdout] (http--0.0.0.0-8443-5) id:9 15:19:44,757 INFO [stdout] (http--0.0.0.0-8443-5) }, 15:19:44,757 INFO [stdout] (http--0.0.0.0-8443-5) values:{ 15:19:44,757 INFO [stdout] (http--0.0.0.0-8443-5) id:9, 15:19:44,757 INFO [stdout] (http--0.0.0.0-8443-5) roleName:"r1", 15:19:44,757 INFO [stdout] (http--0.0.0.0-8443-5) actions:[ 15:19:44,757 INFO [stdout] (http--0.0.0.0-8443-5) { 15:19:44,757 INFO [stdout] (http--0.0.0.0-8443-5) id:6, 15:19:44,757 INFO [stdout] (http--0.0.0.0-8443-5) description:null, 15:19:44,757 INFO [stdout] (http--0.0.0.0-8443-5) name:"BASE_ADMIN_USER", 15:19:44,757 INFO [stdout] (http--0.0.0.0-8443-5) _selection_7:true 15:19:44,758 INFO [stdout] (http--0.0.0.0-8443-5) }, 15:19:44,758 INFO [stdout] (http--0.0.0.0-8443-5) { 15:19:44,758 INFO [stdout] (http--0.0.0.0-8443-5) id:3, 15:19:44,758 INFO [stdout] (http--0.0.0.0-8443-5) description:null, 15:19:44,758 INFO [stdout] (http--0.0.0.0-8443-5) name:"BASE_ADMIN_GROUP" 15:19:44,758 INFO [stdout] (http--0.0.0.0-8443-5) } 15:19:44,758 INFO [stdout] (http--0.0.0.0-8443-5) ], 15:19:44,758 INFO [stdout] (http--0.0.0.0-8443-5) _selection_11:true 15:19:44,758 INFO [stdout] (http--0.0.0.0-8443-5) }, 15:19:44,759 INFO [stdout] (http--0.0.0.0-8443-5) operationConfig:{ 15:19:44,759 INFO [stdout] (http--0.0.0.0-8443-5) dataSource:"roleDs", 15:19:44,759 INFO [stdout] (http--0.0.0.0-8443-5) operationType:"update" 15:19:44,759 INFO [stdout] (http--0.0.0.0-8443-5) }, 15:19:44,759 INFO [stdout] (http--0.0.0.0-8443-5) componentId:"isc_DynamicForm_53", 15:19:44,759 INFO [stdout] (http--0.0.0.0-8443-5) appID:"builtinApplication", 15:19:44,759 INFO [stdout] (http--0.0.0.0-8443-5) operation:"roleDs_update", 15:19:44,759 INFO [stdout] (http--0.0.0.0-8443-5) oldValues:{ 15:19:44,760 INFO [stdout] (http--0.0.0.0-8443-5) id:9, 15:19:44,760 INFO [stdout] (http--0.0.0.0-8443-5) roleName:"r1", 15:19:44,760 INFO [stdout] (http--0.0.0.0-8443-5) actions:[ 15:19:44,760 INFO [stdout] (http--0.0.0.0-8443-5) { 15:19:44,760 INFO [stdout] (http--0.0.0.0-8443-5) id:3, 15:19:44,760 INFO [stdout] (http--0.0.0.0-8443-5) description:null, 15:19:44,761 INFO [stdout] (http--0.0.0.0-8443-5) name:"BASE_ADMIN_GROUP" 15:19:44,761 INFO [stdout] (http--0.0.0.0-8443-5) } 15:19:44,761 INFO [stdout] (http--0.0.0.0-8443-5) ], 15:19:44,761 INFO [stdout] (http--0.0.0.0-8443-5) _selection_11:true 15:19:44,761 INFO [stdout] (http--0.0.0.0-8443-5) } 15:19:44,762 INFO [stdout] (http--0.0.0.0-8443-5) } 15:19:44,762 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,762 [43-5] INFO IDACall - Performing 1 operation(s)
Code:
04-22 15:19:44,777 [43-5] DEBUG JPA2DSGenerator - Plural field skipped: {name=actions, type=any}
Code:
<DataSource ID="roleDs" serverType="jpa" beanClassName="com.nessotech.base.acl.jpa.Role" schemaBean="com.nessotech.base.acl.jpa.Role" > <field name="actions" hidden="true" canSave="true" canEdit="true" detail="true" type="actionDs" javaCollectionClass="com.nessotech.base.acl.jpa.Action" multiple="true" foreignKey="actionDs.id"/> </DataSource>
Code:
isc.DataSource.create({ allowAdvancedCriteria:true, idClassName:null, inheritsFrom:isc.DataSource.create({ allowAdvancedCriteria:true, dropExtraFields:true, ID:"roleDs_inheritsFrom", serverType:"jpa", generatedBy:"v8.3p_2012-12-11/PowerEdition Deployment 2012-12-11", fields:[ { name:"roleName", length:255, type:"text", required:true, canEdit:true }, { hidden:true, name:"id", primaryKey:true, type:"sequence", canEdit:false, required:false } ] }) , serverType:"jpa", field:{ canEdit:"true", canSave:"true", detail:"true", foreignKey:"actionDs.id", hidden:"true", javaCollectionClass:"com.nessotech.base.acl.jpa.Action", multiple:"true", name:"actions", type:"actionDs" }, ID:"roleDs", fields:[ ] })
Code:
<DataSource ID="actionDs" serverType="jpa" beanClassName="com.nessotech.base.acl.jpa.Action" schemaBean="com.nessotech.base.acl.jpa.Action"> </DataSource>
Code:
isc.DataSource.create({ allowAdvancedCriteria:true, idClassName:null, ID:"actionDs", inheritsFrom:isc.DataSource.create({ allowAdvancedCriteria:true, dropExtraFields:true, ID:"actionDs_inheritsFrom", serverType:"jpa", generatedBy:"v8.3p_2012-12-11/PowerEdition Deployment 2012-12-11", fields:[ { hidden:true, name:"id", primaryKey:true, type:"sequence", canEdit:false, required:false }, { name:"description", type:"text", required:false }, { name:"name", length:255, type:"text", required:true, canEdit:true } ] }) , fields:[ ], serverType:"jpa" })
Any hints on where I went wrong? Do I have to have an explicit reverse mapping in actionDs?
Here is the rest of the logs after the request above for completeness:
Code:
15:19:44,762 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,762 [43-5] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null 15:19:44,763 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,763 [43-5] DEBUG DeclarativeSecurity - DataSource roleDs is not in the pre-checked list, processing... 15:19:44,763 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,763 [43-5] DEBUG AppBase - [builtinApplication.roleDs_update] No userTypes defined, allowing anyone access to all operations for this application 15:19:44,764 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,764 [43-5] DEBUG AppBase - [builtinApplication.roleDs_update] No public zero-argument method named '_roleDs_update' found, performing generic datasource operation 15:19:44,766 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,766 [43-5] DEBUG JPADataSource - [builtinApplication.roleDs_update] Auto-joining transactions. 15:19:44,767 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,767 [43-5] DEBUG JPADataSource - [builtinApplication.roleDs_update] Creating EntityManager, starting transaction and setting it to RPCManager. 15:19:44,769 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,769 [43-5] DEBUG DSRequest - [builtinApplication.roleDs_update] Clobbering existing FreeResourcesHandler of type 'com.isomorphic.jpa.JPA2DataSource' with a 'com.isomorphic.jpa.JPA2DataSource' 15:19:44,771 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,771 [43-5] DEBUG JPADataSource - [builtinApplication.roleDs_update] Executing update. 15:19:44,774 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,774 [43-5] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8 15:19:44,774 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,774 [43-5] DEBUG JPADataSource - Committing transaction for 1 queued operation(s). 15:19:44,775 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,775 [43-5] DEBUG JPA2DSGenerator - Instantiating class com.nessotech.base.acl.jpa.Role 15:19:44,775 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,775 [43-5] DEBUG JPA2DSGenerator - Generating data source 'Role_JPA' for class com.nessotech.base.acl.jpa.Role 15:19:44,775 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,775 [43-5] DEBUG JPA2DSGenerator - Generating field 'roleName' of type java.lang.String 15:19:44,776 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,776 [43-5] DEBUG JPA2DSGenerator - Singular field configuration generated: {extScale=0, extIsUnique=true, name=roleName, length=255, extPrecision=0, canEdit=true, required=true, type=text} 15:19:44,777 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,777 [43-5] DEBUG JPA2DSGenerator - Generating field 'actions' of type java.util.Set 15:19:44,777 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,777 [43-5] DEBUG JPA2DSGenerator - Plural field skipped: {name=actions, type=any} 15:19:44,777 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,777 [43-5] DEBUG JPA2DSGenerator - Generating field 'id' of type java.lang.Short 15:19:44,778 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,778 [43-5] DEBUG JPA2DSGenerator - Singular field configuration generated: {hidden=true, primaryKey=true, name=id, required=false, canEdit=false, type=sequence} 15:19:44,778 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,778 [43-5] DEBUG RPCManager - non-DMI response, dropExtraFields: false 15:19:44,780 INFO [stdout] (http--0.0.0.0-8443-5) === 2013-04-22 15:19:44,780 [43-5] DEBUG JPADataSource - Releasing entity manager.
Ech
Comment