Hi all, I am using static data object,   in my configuration file:

<Table tableName="CCP_USER" typeName="User">
       <Column columnName="USER_ID" propertyName="userId"
primaryKey="true"/>
       <Column columnName="PASSWORD" propertyName="password"/>
       <Column columnName="NAME" propertyName="name"/>
       <Column columnName="AVAILABLE"
propertyName="available"/>
   </Table>

following code is to add data object to database:

  User user=(User)UserFactory.INSTANCE.createUser();
       user.setUserId("aaabbiiiiiiiiibc");
       user.setPassword("898989");
       user.setName("wo");
       user.setAvailable ("1");

Connection conn=dataSource.getConnection();
           conn.setAutoCommit(false);
           DAS das=DAS.FACTORY.createDAS(new
ClassPathResource(schemaConfig).getInputStream(),conn);
           Command command= das.getCommand(commandName);
           DataObject root=command.executeQuery();

           if(logger.isDebugEnabled()) logger.debug("dataobject to be
insert:"+object.toString());
           root.getList(object.getType().getName()).add(object);
           das.applyChanges(root);

I works properly. howerver , when I add a Relationship setting to the
configuration file,  there is no  insert operation to be performed since
tuscany does not detected any change on the root databoject.

 <Relationship name="roles" primaryKeyTable="CCP_SERVICE"
foreignKeyTable="CCP_ROLE" many="true">
     <KeyPair primaryKeyColumn="SERVICE_ID" foreignKeyColumn="SERVICE_ID"/>
   </Relationship>

The relationship setting is nothing to do with the CCP_USER table, I am
wondering why.

Reply via email to