You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Steffen Glomb (JIRA)" <tu...@ws.apache.org> on 2007/05/27 11:01:16 UTC
[jira] Created: (TUSCANY-1302) Changesummary of datagraph does not
log changes for dataobject contained by the rootObject
Changesummary of datagraph does not log changes for dataobject contained by the rootObject
------------------------------------------------------------------------------------------
Key: TUSCANY-1302
URL: https://issues.apache.org/jira/browse/TUSCANY-1302
Project: Tuscany
Issue Type: Bug
Components: Java SDO Implementation
Affects Versions: Java-SDO-Next
Reporter: Steffen Glomb
Changesummary on a datagraph,
begin logging,
changes on the rootObject are logged in the changesummary, but changes on objects contained by the rootobject do not get logged.
Here is the testcase for the bug:
public void testDataGraphChangeInNestedObjects() throws IOException {
HelperContext hc = SDOUtil.createHelperContext();
TypeHelper types = hc.getTypeHelper();
DataFactory factory = hc.getDataFactory();
Type intType = types.getType("commonj.sdo", "Int");
Type stringType = types.getType("commonj.sdo", "String");
// create a new Type for Account
DataObject accountType = factory.create("commonj.sdo", "Type");
accountType.set("uri", "http://example.com/customer");
accountType.set("name", "Account");
// create an account number property
DataObject custNumProperty = accountType.createDataObject("property");
custNumProperty.set("name", "accountNum");
custNumProperty.set("type", intType);
types.define(accountType);
// create a new Type for Customers
DataObject customerType = factory.create("commonj.sdo", "Type");
customerType.set("uri", "http://example.com/customer");
customerType.set("name", "Customer");
// create a first name property
DataObject firstNameProperty =
customerType.createDataObject("property");
firstNameProperty.set("name", "firstName");
firstNameProperty.set("type", stringType);
// create a account property
DataObject accountProperty = customerType.createDataObject("property");
accountProperty.set("name", "account");
accountProperty.set("type", accountType);
// now define the Customer type so that customers can be made
types.define(customerType);
Type customerTypeType = types.getType("http://example.com/customer", "Customer");
Type accountTypeType = types.getType("http://example.com/customer", "Account");
DataGraph datagraph = org.apache.tuscany.sdo.api.SDOUtil.createDataGraph();
DataObject account = factory.create(accountTypeType);
account.setInt("accountNum", 2);
DataObject customer1 = datagraph.createRootObject(customerTypeType);
customer1.setString("firstName", "Steffen");
customer1.set("account", account);
datagraph.getChangeSummary().beginLogging();
DataObject loadedCustomer = datagraph.getRootObject();
DataObject loadedAccount = (DataObject) loadedCustomer.get("account");
loadedAccount.setInt("accountNum", 5);
datagraph.getChangeSummary().endLogging();
List changedDataObjects = datagraph.getChangeSummary().getChangedDataObjects();
assertEquals("1 Object is changed by the code", 1, changedDataObjects.size());
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Resolved: (TUSCANY-1302) Changesummary of datagraph does not
log changes for dataobject contained by the rootObject
Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-1302?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Frank Budinsky resolved TUSCANY-1302.
-------------------------------------
Resolution: Invalid
Fix Version/s: Java-M1
The problem is in the test program. It needs to make the "accountProperty" a containment reference:
accountProperty.set("containment", Boolean.TRUE);
> Changesummary of datagraph does not log changes for dataobject contained by the rootObject
> ------------------------------------------------------------------------------------------
>
> Key: TUSCANY-1302
> URL: https://issues.apache.org/jira/browse/TUSCANY-1302
> Project: Tuscany
> Issue Type: Bug
> Components: Java SDO Implementation
> Affects Versions: Java-SDO-Next
> Reporter: Steffen Glomb
> Fix For: Java-M1
>
>
> Changesummary on a datagraph,
> begin logging,
> changes on the rootObject are logged in the changesummary, but changes on objects contained by the rootobject do not get logged.
> Here is the testcase for the bug:
> public void testDataGraphChangeInNestedObjects() throws IOException {
>
> HelperContext hc = SDOUtil.createHelperContext();
> TypeHelper types = hc.getTypeHelper();
> DataFactory factory = hc.getDataFactory();
>
> Type intType = types.getType("commonj.sdo", "Int");
> Type stringType = types.getType("commonj.sdo", "String");
>
> // create a new Type for Account
> DataObject accountType = factory.create("commonj.sdo", "Type");
> accountType.set("uri", "http://example.com/customer");
> accountType.set("name", "Account");
> // create an account number property
> DataObject custNumProperty = accountType.createDataObject("property");
> custNumProperty.set("name", "accountNum");
> custNumProperty.set("type", intType);
> types.define(accountType);
>
> // create a new Type for Customers
> DataObject customerType = factory.create("commonj.sdo", "Type");
> customerType.set("uri", "http://example.com/customer");
> customerType.set("name", "Customer");
>
> // create a first name property
> DataObject firstNameProperty =
> customerType.createDataObject("property");
> firstNameProperty.set("name", "firstName");
> firstNameProperty.set("type", stringType);
> // create a account property
> DataObject accountProperty = customerType.createDataObject("property");
> accountProperty.set("name", "account");
> accountProperty.set("type", accountType);
> // now define the Customer type so that customers can be made
> types.define(customerType);
>
> Type customerTypeType = types.getType("http://example.com/customer", "Customer");
> Type accountTypeType = types.getType("http://example.com/customer", "Account");
>
> DataGraph datagraph = org.apache.tuscany.sdo.api.SDOUtil.createDataGraph();
>
> DataObject account = factory.create(accountTypeType);
> account.setInt("accountNum", 2);
>
> DataObject customer1 = datagraph.createRootObject(customerTypeType);
> customer1.setString("firstName", "Steffen");
> customer1.set("account", account);
>
> datagraph.getChangeSummary().beginLogging();
>
> DataObject loadedCustomer = datagraph.getRootObject();
> DataObject loadedAccount = (DataObject) loadedCustomer.get("account");
> loadedAccount.setInt("accountNum", 5);
>
> datagraph.getChangeSummary().endLogging();
> List changedDataObjects = datagraph.getChangeSummary().getChangedDataObjects();
>
> assertEquals("1 Object is changed by the code", 1, changedDataObjects.size());
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org