The DAS will insert objects into the database when it detects a create event in the SDO change summary. Because your DataObject was created outside of your DataObject tree, I'm guessing that the even will not show up in the change summary.
On 1/28/07, Sam Su <[EMAIL PROTECTED]> wrote:
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.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]