Author: lresende
Date: Mon Aug 11 14:17:34 2008
New Revision: 684934
URL: http://svn.apache.org/viewvc?rev=684934&view=rev
Log:
Updates to remove @Remotable to avoid SDO copyHelper bug
Modified:
tuscany/sandbox/lresende/sca/samples/organization-das/pom.xml
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java
tuscany/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java
Modified: tuscany/sandbox/lresende/sca/samples/organization-das/pom.xml
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca/samples/organization-das/pom.xml?rev=684934&r1=684933&r2=684934&view=diff
==============================================================================
--- tuscany/sandbox/lresende/sca/samples/organization-das/pom.xml (original)
+++ tuscany/sandbox/lresende/sca/samples/organization-das/pom.xml Mon Aug 11
14:17:34 2008
@@ -140,7 +140,6 @@
<id>config</id>
<configuration>
<schemaFile>${basedir}/src/main/resources/sdo-types.xsd</schemaFile>
-
<noNotification>true</noNotification>
<noUnsettable>true</noUnsettable>
</configuration>
<goals>
Modified:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java?rev=684934&r1=684933&r2=684934&view=diff
==============================================================================
---
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java
(original)
+++
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java
Mon Aug 11 14:17:34 2008
@@ -19,10 +19,8 @@
package organization.das;
-import org.osoa.sca.annotations.Remotable;
import org.soa.types.SchemaInfoType;
[EMAIL PROTECTED]
public interface OrganizationDataService {
public commonj.sdo.DataObject findOrganizationBugTwo(java.lang.String
id, SchemaInfoType schemaInfo);
Modified:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java?rev=684934&r1=684933&r2=684934&view=diff
==============================================================================
---
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java
(original)
+++
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java
Mon Aug 11 14:17:34 2008
@@ -80,7 +80,10 @@
java.sql.Connection conn =
ConnectionHelper.getConnection(schemaInfo);
DAS das = DAS.FACTORY.createDAS(in, conn);
-
- das.applyChanges(organization);
+ try {
+ das.applyChanges(organization);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
}
Modified:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java?rev=684934&r1=684933&r2=684934&view=diff
==============================================================================
---
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java
(original)
+++
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java
Mon Aug 11 14:17:34 2008
@@ -19,12 +19,10 @@
package organization.services;
-import org.osoa.sca.annotations.Remotable;
import org.soa.types.SchemaInfoType;
import commonj.sdo.DataObject;
[EMAIL PROTECTED]
public interface OrganizationService {
public DataObject findOrganizationBugTwo(String id, SchemaInfoType
schemaInfo);
Modified:
tuscany/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java?rev=684934&r1=684933&r2=684934&view=diff
==============================================================================
---
tuscany/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java
(original)
+++
tuscany/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java
Mon Aug 11 14:17:34 2008
@@ -27,8 +27,8 @@
import org.junit.Test;
import org.soa.types.SchemaInfoType;
import org.soa.types.TypesFactory;
-
import organization.services.OrganizationService;
+
import util.ConnectionHelper;
import commonj.sdo.DataObject;
@@ -79,7 +79,31 @@
}
+ @Test
+ public void testRetrieveOrganizationAndSaveDAS() {
+ DataObject root = null;
+ InputStream in =
getClass().getClassLoader().getResourceAsStream("organizationConfiguration.xml");
+
+ // Need to put in valid values for your DB
+ SchemaInfoType schemaInfo =
TypesFactory.INSTANCE.createSchemaInfoType();
+ schemaInfo.setPASSWORD("");
+ schemaInfo.setSCHEMA("");
+ schemaInfo.setUSERNAME("");
+
+ java.sql.Connection conn =
ConnectionHelper.getConnection(schemaInfo);
+
+ DAS das = DAS.FACTORY.createDAS(in, conn);
+ Command read = das.getCommand("getAccountByID");
+ read.setParameter(1, Integer.valueOf(id));
+ root = read.executeQuery();
+
+ das.applyChanges(root);
+ }
+
+ /**
+ * This represents BUG_TWO from TUSCANY-2525
+ */
@Test
public void testRetrieveOrganizationSCA() {
@@ -106,9 +130,11 @@
// This doesn't work either. The root datagraph is null
// If you call das.applyChanges for a dataObject that has null as the
dataGraph,
// it hurls.
- //commonj.sdo.DataObject rootOne =
organizationService.findOrganizationBugTwo(id, schemaInfo);
- //System.out.println("rootOne dataGraph -> " + rootOne.getDataGraph());
- //organizationService.updateOrganization(rootOne, schemaInfo);
+ DataObject rootOne = organizationService.findOrganizationBugTwo(id,
schemaInfo);
+ ////account = root.getDataObject("ACCOUNT[1]");
+ ////account.set("ACCOUNT_NAME", "something");
+ System.out.println("rootOne dataGraph -> " + rootOne.getDataGraph());
+ organizationService.updateOrganization(rootOne, schemaInfo);
scaDomain.close();
}