This one time, at band camp, Bart Jenkins said:

BJ>  How do you do a simple query like "select max(id) from mytable"?
BJ>
BJ>I have:
BJ>
BJ>  db.getOQLQuery( "CALL SQL SELECT max(m_product_id) FROM M_PRODUCT AS
BJ>java.lang.Integer");
BJ>
BJ>and I keep getting an exception saying:
BJ>
BJ>  org.exolab.castor.jdo.QueryException: Could not find an engine supporting
BJ>class java.lang.Integer
BJ>
BJ>I get the same when I substitute "java.lang.Integer" with "int" or "String"
BJ>or anything...
BJ>
BJ>I FINALLY figured out that I can do:
BJ>
BJ>  db.getOQLQuery( "SELECT max(p.id) FROM Product p");
BJ>
BJ>and get the number as an Integer by doing:
BJ>
BJ>  QueryResults = maxProdIDResults = maxProdOQL.execute();      //execute the
BJ>query
BJ>  maxProdID = new Integer(maxProdIDResults.next().toString());//retrieve the
BJ>MAX of column m_product_id
BJ>
BJ>What a hassle.  Why doesn't the passthrough query work?

Bart, 

The pass through query doesn't work because your object mapping doesn't
provide Castor with a definitition of a java.lang.Integer. 

Bruce
-- 
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

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

Reply via email to