Looks like you have the columns with mixed cases, could you please try
having them all in uppercase, as defined in the DB structure.

On Mon, Apr 21, 2008 at 5:49 AM, Abraham Washington
<[EMAIL PROTECTED]> wrote:
> hello Luciano,
>
>    i made some changes and now i'm getting another error..maybe the changes 
> are incorrect.  i'm using version tuscany-das-1.0-incubating-beta2, 
> connecting to an oracle 10g db.  below is my table structure.
>
>  SQL> describe organization;
>   Name                                      Null?    Type
>   ----------------------------------------- -------- 
> ----------------------------
>   ORGID                                     NOT NULL NUMBER
>   ORGNAME                                   NOT NULL VARCHAR2(200)
>
>
>  i changed the orgID from commonj.sdo.IntObject to commonj.sdo.Int, which 
> seems to have helped.  so, now my config file is:
>
>
>  <?xml version="1.0" encoding="ASCII"?>
>     <Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd";>
>         <ConnectionInfo  />
>         <Command name="getAllOrganizations" SQL="select * from ORGANIZATION" 
> kind="Select">
>             <ResultDescriptor columnName="orgID" tableName="ORGANIZATION" 
> columnType="commonj.sdo.Int"/>
>             <ResultDescriptor columnName="orgName" tableName="ORGANIZATION" 
> columnType="commonj.sdo.String"/>
>         </Command>
>         <Table tableName="ORGANIZATION">
>             <Column columnName="ORGID" primaryKey="true" generated="true"/>
>          <Column columnName="orgName" />
>         </Table>
>  </Config>
>
>  when i make the call to:
>
>  DataObject root = read.executeQuery();
>
>  this error is thrown...
>
>  java.lang.RuntimeException: Table ORGANIZATION in query does not include 
> Primary Key column or has null value in it, can not proceed!
>  at 
> org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.addRowToGraph(ResultSetProcessor.java:117)
>
> at 
> org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResultSet(ResultSetProcessor.java:91)
>  at 
> org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResults(ResultSetProcessor.java:77)
>  at 
> org.apache.tuscany.das.rdb.impl.ReadCommandImpl.buildGraph(ReadCommandImpl.java:300)
>  at 
> org.apache.tuscany.das.rdb.impl.ReadCommandImpl.executeQuery(ReadCommandImpl.java:268)
>  at hello.HelloImpl.hey(HelloImpl.java:37)
>
>  there are 27 records in the organization table and since the orgid is the 
> primary key, it's never null.  i'm assuming the primary key definition is 
> wrong (maybe not).  i tried defining it as commonj.sdo.IntObject but the same 
> error is thrown.
>
>  thx abe
>
>
>
>
>  ----- Original Message ----
>  From: Luciano Resende <[EMAIL PROTECTED]>
>  To: tuscany-user@ws.apache.org
>  Sent: Sunday, April 20, 2008 12:23:55 AM
>  Subject: Re: sdo/das question
>
>  Hey Abraham
>
>   I used your config in a simple client app using DAS beta2, and all
>  seem to work well, so I suspect that there might be some
>  incompatibility with the actual data type from your table columns. I
>  was using Derby, and below is the SQL I used to create the
>  ORGANIZATION table.
>
>
>  CREATE TABLE ORGANIZATION (
>     orgID INTEGER NOT NULL,
>         name VARCHAR(50),
>         primary key (orgID)
>     );
>
>
>  If you still have issues, please let's work together to solve it. I
>  might need more info, such as table structure, and DAS/SDO versions
>  you are using.
>
>
>  On Fri, Apr 18, 2008 at 3:37 PM, Abraham Washington
>  <[EMAIL PROTECTED]> wrote:
>  > hi,  i have a basic sample app that i'm trying to query a db.  i'm getting 
> a sdo/classCastException when making the call:
>  >
>  >  DataObject read = das.getCommand("getOrganizations");
>  >
>  >  here's my composite:
>  >
>  >  <?xml version="1.0" encoding="UTF-8"?>
>  >  <composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
>  >        xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0";
>  >        xmlns:c="http://Hello";
>  >        name="Hello">
>  >              <component name="Hello">
>  >                    <implementation.java class="hello.HelloImpl">
>  >                    </implementation.java>
>  >                    <service name="Hello">
>  >                        <binding.ws uri="hello-there">
>  >                        </binding.ws>
>  >                        <t:binding.jsonrpc uri="hello-nicer">
>  >                        </t:binding.jsonrpc>
>  >                    </service>
>  >            </component>
>  >  </composite>
>  >
>  >  and my datasource config:
>  >
>  >  <?xml version="1.0" encoding="ASCII"?>
>  >  <Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd";>
>  >    <ConnectionInfo />
>  >    <Command name="getOrganizations" SQL="select orgID from ORGANIZATION" 
> kind="Select">
>  >        <ResultDescriptor columnName="orgID" tableName="ORGANIZATION" 
> columnType="commonj.sdo.IntObject"/>
>  >    </Command>
>  >    <Command name="getOrganization"
>  >            SQL="SELECT orgID organizationTypeId, orgName FROM organization 
> where orgID = ?" kind="Select" />
>  >  </Config>
>  >
>  >  and the error
>  >
>  >  java.lang.ClassCastException: The value of type 'class 
> java.math.BigDecimal' must be of type 'class java.lang.Integer'
>  >  at 
> org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSettingDelegateSingleDataUnsettableStatic.validate(EStructuralFeatureImpl.java:2195)
>  >  at 
> org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSettingDelegateSingleDataUnsettable.dynamicSet(EStructuralFeatureImpl.java:2116)
>  >  at 
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicSet(BasicEObjectImpl.java:709)
>  >  at 
> org.apache.tuscany.sdo.impl.DynamicDataObjectImpl.eDynamicSet(DynamicDataObjectImpl.java:160)
>  >  at 
> org.apache.tuscany.sdo.impl.DataObjectImpl.eSet(DataObjectImpl.java:1468)
>  >  at 
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:654)
>  >  at org.apache.tuscany.sdo.impl.DataObjectImpl.set(DataObjectImpl.java:146)
>  >  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:127)
>  >  at 
> org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResultSet(ResultSetProcessor.java:91)
>  >  at 
> org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResults(ResultSetProcessor.java:77)
>  >  at 
> org.apache.tuscany.das.rdb.impl.ReadCommandImpl.buildGraph(ReadCommandImpl.java:300)
>  >  at 
> org.apache.tuscany.das.rdb.impl.ReadCommandImpl.executeQuery(ReadCommandImpl.java:268)
>  >  at hello.HelloImpl.hey(HelloImpl.java:35)
>  >
>  >
>  >  thx in adv!
>  >
>  >
>  >
>  >      
> ____________________________________________________________________________________
>  >  Be a better friend, newshound, and
>  >  know-it-all with Yahoo! Mobile.  Try it now.  
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
>
>
>  --
>  Luciano Resende
>  Apache Tuscany Committer
>  http://people.apache.org/~lresende
>  http://lresende.blogspot.com/
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>       
> ____________________________________________________________________________________
>  Be a better friend, newshound, and
>  know-it-all with Yahoo! Mobile.  Try it now.  
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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

Reply via email to