Fwd: Eclipse SOA Tools Project support for SCA/Java dev with Tuscany
-- Forwarded message -- From: Oisin Hurley [EMAIL PROTECTED] Date: Jan 29, 2007 12:31 AM Subject: Eclipse SOA Tools Project support for SCA/Java dev with Tuscany To: tuscany-dev@ws.apache.org Hi all, Over at Eclipse STP we've made some progress on supporting SCA/Java service development using Tuscany [0]. In the flash movie at [1] (14MB) you will see how to develop and SCA Java service and client using the RMI binding. This is a call for feedback on this initial tool support to help us deliver something that is useful for SCA developers in the Eclipse Europa release, due end of June. We would appreciate your thoughts and comments sent to stp- [EMAIL PROTECTED] best regards Oisin Hurley, STP PMC Lead [0] http://wiki.eclipse.org/index.php/SCA_Java_support_in_STP [1] http://www.eclipse.org/stp/sc/demos/sca_rmi_movie.swf
Re: a bug: 'propertyName' attribute of Table element
This was fixed in TUSCANY-905. On 1/28/07, Sam Su [EMAIL PROTECTED] wrote: Hi all, I am using static data object, in my configuration file, I use propertyName attribute to map Table column to DataObject class's property, 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 however, when I use following code to add a new object to database, it fails because the error sql produced by tuscany das. User user=(User)UserFactory.INSTANCE.createUser(); user.setUserId(aaabbibc); 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); tuscany das produces a sql: insert into ccp_user(userid, password, name, available) values(?,?,?,?) , it is obviously that userid is the property of data object class but not the column of the table. Is it a bug? I read the source code of InsertGenerator class, it just : attributes.add(attr.getName()); to get the dataobject property, after I modify it to attributes.add(config.getColumnByPropertyName(t, attr.getName()).getColumnName()); to get the table column compose the insert sql, it works correctly. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: a bug: insert databoject fail because the Relationship setting
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(aaabbibc); 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]
java.lang.ClassCastException org.eclipse.emf.ecore.util.EcoreEList$Dynamic incompatible with commonj.sdo.DataObject
Hi I just ran into a classcast exception when I tried to call getList on a dataobject. I searched a bit for it and found this in the samples: PurchaseOrderControl.removeItem(int index) { // TODO: this is not working due to java.lang.ClassCastException: // org.eclipse.emf.ecore.util.EcoreEList$Dynamic incompatible with commonj.sdo.DataObject // access a DataObject by the index and then remove it Can anybody tell more about this? /Chr
Re: java.lang.ClassCastException org.eclipse.emf.ecore.util.EcoreEList$Dynamic incompatible with commonj.sdo.DataObject
I'm guessing that the property that your calling getList() for is single valued. You can only call getList() on a property if the property has Property.isMany == true. In other words, there's no automatic conversion from a single valued property value to List. Frank. Christian Landbo Frederiksen [EMAIL PROTECTED] wrote on 01/29/2007 03:24:42 PM: Hi I just ran into a classcast exception when I tried to call getList on a dataobject. I searched a bit for it and found this in the samples: PurchaseOrderControl.removeItem(int index) { // TODO: this is not working due to java.lang.ClassCastException: // org.eclipse.emf.ecore.util.EcoreEList$Dynamic incompatible with commonj.sdo.DataObject // access a DataObject by the index and then remove it Can anybody tell more about this? /Chr - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: java.lang.ClassCastException org.eclipse.emf.ecore.util.EcoreEList$Dynamicincompatible with commonj.sdo.DataObject
It is Many: The thing it that is was during an analysis of a schema and the 'Many' property was not set in the DataObject. When dealing with a not 'many' property the get-method just returns null but when dealing with a 'many' property the getList resulted in the mentioned ClassCastException. Now I avoid it by checking for dataObject.isSet(p) before calling getList. /Chr -Original Message- From: Frank Budinsky [mailto:[EMAIL PROTECTED] Sent: 29. januar 2007 22:48 To: tuscany-user@ws.apache.org Subject: Re: java.lang.ClassCastException org.eclipse.emf.ecore.util.EcoreEList$Dynamicincompatible with commonj.sdo.DataObject I'm guessing that the property that your calling getList() for is single valued. You can only call getList() on a property if the property has Property.isMany == true. In other words, there's no automatic conversion from a single valued property value to List. Frank. Christian Landbo Frederiksen [EMAIL PROTECTED] wrote on 01/29/2007 03:24:42 PM: Hi I just ran into a classcast exception when I tried to call getList on a dataobject. I searched a bit for it and found this in the samples: PurchaseOrderControl.removeItem(int index) { // TODO: this is not working due to java.lang.ClassCastException: // org.eclipse.emf.ecore.util.EcoreEList$Dynamic incompatible with commonj.sdo.DataObject // access a DataObject by the index and then remove it Can anybody tell more about this? /Chr - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.ClassCastException org.eclipse.emf.ecore.util.EcoreEList$Dynamicincompatible with commonj.sdo.DataObject
Maybe the exception isn't from getList. For class casting such as (expectation)actualClassInstance, the exception looks like actualClass incompatible with expectation. I guess the exception is from (DataObject)value such as getDataObject. So in the mentioned sample: 1.DataObject items = purchaseOrder.getDataObject(items); 2.List itemList = items.getList(item); the exception may come from line 1 instead of line 2. On 1/29/07, Christian Landbo Frederiksen [EMAIL PROTECTED] wrote: It is Many: The thing it that is was during an analysis of a schema and the 'Many' property was not set in the DataObject. When dealing with a not 'many' property the get-method just returns null but when dealing with a 'many' property the getList resulted in the mentioned ClassCastException. Now I avoid it by checking for dataObject.isSet(p) before calling getList. /Chr -Original Message- From: Frank Budinsky [mailto:[EMAIL PROTECTED] Sent: 29. januar 2007 22:48 To: tuscany-user@ws.apache.org Subject: Re: java.lang.ClassCastException org.eclipse.emf.ecore.util.EcoreEList$Dynamicincompatible with commonj.sdo.DataObject I'm guessing that the property that your calling getList() for is single valued. You can only call getList() on a property if the property has Property.isMany == true. In other words, there's no automatic conversion from a single valued property value to List. Frank. Christian Landbo Frederiksen [EMAIL PROTECTED] wrote on 01/29/2007 03:24:42 PM: Hi I just ran into a classcast exception when I tried to call getList on a dataobject. I searched a bit for it and found this in the samples: PurchaseOrderControl.removeItem(int index) { // TODO: this is not working due to java.lang.ClassCastException: // org.eclipse.emf.ecore.util.EcoreEList$Dynamic incompatible with commonj.sdo.DataObject // access a DataObject by the index and then remove it Can anybody tell more about this? /Chr - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Yang ZHONG
Root property that is not containment
Hi I have just started using this SDO-thing and I am very excited about it. I am using it to analyse xml-schemas and to generate and accept data for the given schemas. I have run into something (again). Lets say I am given a simple schema such as this: ?xml version=1.0 encoding=utf-8? schema xmlns:test=testns xmlns=http://www.w3.org/2001/XMLSchema; targetNamespace=testns element name=Test type=test:TestType/ simpleType name=TestType restriction base=decimal minInclusive value=0/ maxInclusive value=13/ /restriction /simpleType /schema When analysing this I cannot generate a DataObject for the Test-property because it is not a containment property. So I figured I could just use the 'DocumentRoot' DataObject, but this gives me XML like this, which is not valid: ?xml version=1.0 encoding=ASCII? _20:DocumentRoot xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:_20=testns xsi:type=_20_20:Test1/_20:Test/_20:DocumentRoot But what I wanted was something valid like this : ?xml version=1.0 encoding=UTF-8? Test xmlns=testns xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;3.1415926535897932 384626433832795/Test Am I missing something? What would be an appropiate way to deal with root-properties that are not containment properties? /Chr - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DAS can not save multi-table datas
Hello, I am using static data object, in my configuration file: Table tableName=FM_TEST_CUSTOMER typeName=Customer Column columnName=USER_ID primaryKey=true / /Table Table tableName=FM_TEST_ORDER typeName=Order Column columnName=ORDER_ID primaryKey=true / /Table Relationship name=ORDERS primaryKeyTable=FM_TEST_CUSTOMER foreignKeyTable=FM_TEST_ORDER many=true KeyPair primaryKeyColumn=USER_ID foreignKeyColumn=USER_ID / /Relationship And I use the static DataObject codes which generated from tuscany Tool,so I have Customer static DataObject and Order static DataObject,and Customer has a list property ORDERS. however, when I add a Order DataObject: SDOUtil.registerStaticTypes(CustomerFactory.class); DAS das = DAS.FACTORY.createDAS(test.getConfig(FM_TEST_CUSTOMER.xml), getConnection()); Command selectCommand = das.getCommand(all customers with order); DataObject root = selectCommand.executeQuery(); Customer customer = (Customer)root.getDataObject(Customer[1]); Order order = (Order)root.createDataObject(Order); order.setUSER_ID(new BigDecimal(2)); order.setGOOD_ID(new BigDecimal(3)); customer.getORDERS().add(order); das.applyChanges(root); It will throws an Exception: Exception in thread main java.lang.RuntimeException: java.sql.SQLException:invalidation column type I tracked the source of tuscany, and find it produced a sql: update FM_TEST_CUSTOMER set ORDERS = ? where USER_ID = ? How to resolve this problem??
Re: a bug: 'propertyName' attribute of Table element
thank you Brent.