Hi Brad,

The OQL syntax is incorrect, should be something like
OQLQuery oql = db.getOQLQuery( "SELECT m FROM 
com.workzen.app.velocityCastor.om.Message m" );

Oleg

On Wednesday 22 August 2001 23:12, Brad Matlack wrote:
> Hi,
>
> When I try to execute a select using this statement:
> OQLQuery oql = db.getOQLQuery( "SELECT * FROM Message" );
>
> I get this exception:
> org.exolab.castor.jdo.oql.OQLSyntaxException: An inapropriate token (20)
> was encountered in an expression.
> (Note: Hex 20 is a space)
>
> And when I execute a create:
> try{
>      db.begin();
>      db.create(message);
>      db.commit();
>     }catch(Exception e){
>      db.rollback();
>      throw new Exception(e.getMessage());
>     }
>
> I get this exception:
> java.sql.SQLException: Syntax error or access violation: You have an error
> in your SQL syntax near 'SELECT MAX(t1.id) FROM message t1)' at line 1.
> (Note the extra parenthesis at the end of the statement)
>
> Here is my mapping.xml statement:
> <!--  Mapping for Message  -->
>  <class name="com.workzen.app.velocityCastor.om.Message" identity="id"
> key-generator="MAX">
>   <map-to table="message" xml="message"/>
>     <field name="id" type="integer" >
>       <sql name="id" type="integer"/>
>       <xml node="attribute"/>
>     </field>
>     <field name="subject" type="string">
>       <sql name="subject" type="char" dirty="check" />
>       <xml node="text" />
>     </field>
>   <field name="name" type="string">
>       <sql name="name" type="char" dirty="check" />
>       <xml node="text" />
>     </field>
>   <field name="email" type="string">
>       <sql name="email" type="char" dirty="check" />
>       <xml node="text" />
>     </field>
>   <field name="contents" type="string">
>       <sql name="contents" type="char" dirty="check" />
>       <xml node="text" />
>     </field>
>   <field name="submitted" type="string">
>       <sql name="submitted" type="char" dirty="check" />
>       <xml node="text" />
>     </field>
>   </class>
>
> What am I doing wrong???
> Any help would be greatly appreciated,
> Brad
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to