Luciano,

 This is a mismatch between data returned from the query and the
generated DataObject model. The query in this case is doing "select *
from stocks", which will return columns ID, Symbol, Quantity,
purchasePrice, purchaseDate, and purchaseLotNumber. The wsdl used to
generated the SDO model doesn't have an ID column. Looking at
AccountDBInit, it looks like ID is supposed to identify a customer.
Nothing in the StockSummary type in the wsdl looks like it corresponds
to this.

I would either change the database query to return only the columns
needed by the StockSummary type, or add an attribute for ID to the
type.

Regardless, we need to return a meaningful exception for this rather
than the NPE from SDO. Can you open a JIRA for that?

Brent

On 9/20/06, Luciano Resende <[EMAIL PROTECTED]> wrote:
Hi All

  I'm working on the DAS/SDO side of BigBank to get it working, and
currently testing trough an updated AccountDBInit.java
  After some updates on the configFiles and testing code, I made some
progress and have it partially working, and right now I'm trying to solve
the following issue :


Exception in thread "main" java.lang.NullPointerException
   at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDerivedStructuralFeatureID(
BasicEObjectImpl.java:1072)
   at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(
BasicEObjectImpl.java:650)
   at org.apache.tuscany.sdo.impl.DataObjectImpl.set(DataObjectImpl.java
:140)
   at
org.apache.tuscany.das.rdb.graphbuilder.impl.DataObjectMaker.createAndAddDataObject
(DataObjectMaker.java:90)
   at
org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.addRowToGraph
(ResultSetProcessor.java:126)
   at
org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResultSet
(ResultSetProcessor.java:97)
   at
org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResults
(ResultSetProcessor.java:81)
   at org.apache.tuscany.das.rdb.impl.ReadCommandImpl.buildGraph(
ReadCommandImpl.java:92)
   at org.apache.tuscany.das.rdb.impl.ReadCommandImpl.executeQuery(
ReadCommandImpl.java:61)
   at
bigbank.account.services.accountdb.AccountDBInit.testStrockPurchaseThroughDAS
(AccountDBInit.java:271)
   at bigbank.account.services.accountdb.AccountDBInit.main(
AccountDBInit.java:466)


This is happening when it's trying to build the graph for the "all stocks"
query, and trying to map the ID column.
Currently, I have the following in the SDO wsdl :

           <xsd:complexType name="StockSummary">
               <xsd:attribute name="purchaseLotNumber" type="xsd:int" />
               <!-- unique id for this purchase -->
               <xsd:attribute name="symbol" type="xsd:string" />
               <xsd:attribute name="quantity" type="xsd:int" />
               <xsd:attribute name="purchaseDate" type="xsd:dateTime" />
               <xsd:attribute name="purchasePrice" type="xsd:float" />
               <xsd:attribute name="currentPrice" type="xsd:float" />
               <xsd:attribute name="company" type="xsd:string" />
               <xsd:attribute name="highPrice" type="xsd:float" />
               <xsd:attribute name="lowPrice" type="xsd:float" />

           </xsd:complexType>

And the following for the DAS xml config file :

 <Table tableName="STOCKS" typeName="StockSummary" >
   <Column columnName="ID"/>
   <Column columnName="SYMBOL" propertyName="symbol"/>
   <Column columnName="QUANTITY" propertyName="quantity"/>
   <Column columnName="PURCHASEPRICE" propertyName="purchasePrice"/>
   <Column columnName="PURCHASEDATE" propertyName="purchaseDate"
converterClassName="
bigbank.account.services.accountdata.AccountDataServiceDASImpl$DateConverter
"/>
 </Table>


Any ideas ? is that a mapping issue or have I found a bug ?

- Luciano Resende



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to