FYI, I have just attached a patch to 
http://jira.codehaus.org/browse/CASTOR-1231 that seems to fix this problem. 
Could all 
interested parties please test the patched code against their respective test 
cases ? 

Regards
Werner

On Tue, 4 Oct 2005 09:33:03 -0400, Nick Stuart wrote:

>Something is amiss here, the SQL call is missing the entire table
>name. Your OQL looks correct, and castor is trying to parse things out
>correctly (as it translated d.id to MODEL_DETAIL.ID) but something
>else is screwing up here. I would say file a bug with a test case and
>follow the bug submission outline on the site.
>
>-Nick
>
>On 10/3/05, Minh Tran-Le <[EMAIL PROTECTED]> wrote:
>> I have a table with 2 fields as primary keys:
>> <mapping>
>>  <class name="db.ModelDetail" identity="id model_id">
>>   <map-to table="MODEL_DETAIL" xml="model_detail"/>
>>   <field name="id" type="integer">
>>    <sql name="ID" type="integer"/>
>>    <bind-xml node="attribute"/>
>>   </field>
>>   <field name="model_id" type="integer">
>>    <sql name="MODEL_ID" type="integer"/>
>>    <bind-xml node="attribute"/>
>>   </field>
>>  </class>
>> </mapping>
>>
>> When I use the following oql:
>> oql = db.getOQLQuery("SELECT d FROM db.ModelDetail d WHERE d.id=$1");
>> oql.bind(6);
>> results = oql.execute();
>>
>> When I run it I get the following sqlexception:
>> org.exolab.castor.jdo.PersistenceException: Nested error:
>> java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
>> JDBC][SQLServer]Incorrect syntax near the keyword 'WHERE'. while
>> executing SELECT 1 FROM  WHERE ("MODEL_DETAIL"."ID" = ?1):
>> [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Incorrect syntax
>> near the keyword 'WHERE'.
>>         at 
>> org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.execute(SQLEngine.java:2180)
>>         at 
>> org.castor.persist.TransactionContext.query(TransactionContext.java:840)
>>         at 
>> org.exolab.castor.jdo.engine.OQLQueryImpl.execute(OQLQueryImpl.java:457)
>> ...
>>
>> Is it something wrong with my OQLquery or a bug in Castor's JDO ?
>>
>> I am using castor-0.9.9 with sql-server engine.
>>
>> Thanks,
>> Minh Tran-Le.
>>
>> -------------------------------------------------
>> If you wish to unsubscribe from this list, please
>> send an empty message to the following address:
>>
>> [EMAIL PROTECTED]
>> -------------------------------------------------
>>
>>
>
>-------------------------------------------------
>If you wish to unsubscribe from this list, please 
>send an empty message to the following address:
>
>[EMAIL PROTECTED]
>-------------------------------------------------
>





-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to