Hi, 

Which version of the MySQL JDBC driver are you using? 

OpenJPA creates callable statements when you use em.createNativeQuery(). On
many versions of the MySQL driver (anything < 5.1.6 in my experience) the
callable statement would only work if you were calling a stored procedure. 

After upgrading to 5.1.6 we were able to use callable statements that don't
call a stored procedure. 

If that doesn't help could you post the version of OpenJPA and MySQL you're
using? 

-mike


pdd wrote:
> 
> Sorry to continue to compare with EclipseLink but the application is
> working just fine on TopLink/EclipseLink and I am trying to get it to work
> with OpenJPA. The 
> http://n2.nabble.com/enhancing-entity-which-is-a-subclass-tp3333612p3333612.html
> first problem  was resolved by Rick (thanks!) and after using mapped-super
> class element in orm.xml, I could get past that. 
> 
> Now I am stuck with PersistenceException which has nested
> MySQLSyntaxErrorException saying "FUNCTION ROLEID, does not exist".
> Setting openjpa.Log to SQL=TRACE does not show the query (exception is
> thrown) but below string is being passed to
> em.createNativeQuery(queryString, entityClass) to create the Query object.
> 
> If I use the this SQL stmt directly on the DB thru sql client, it works
> fine and returns correct result.
> 
> The queryString looks like this,
>   ( SELECT Role_.ROLEID, Role_.COMPANYID, Role_.CLASSNAMEID,
> Role_.CLASSPK, Role_.NAME, Role_.TITLE, Role_.DESCRIPTION, Role_.TYPE_,
> Role_.SUBTYPE FROM lportal.Role_ WHERE (Role_.companyId = 10117) AND (
> (Role_.name = 'Administrator') OR (Role_.name = 'Community Administrator')
> OR (Role_.name = 'Community Member') OR (Role_.name = 'Community Owner')
> OR (Role_.name = 'Guest') OR (Role_.name = 'Organization Administrator')
> OR (Role_.name = 'Organization Member') OR (Role_.name = 'Organization
> Owner') OR (Role_.name = 'Owner') OR (Role_.name = 'Power User') OR
> (Role_.name = 'User') ) )
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/MySQLSyntaxErrorException%3A-FUNCTION-XYZ%2C-does-not-exist-tp3356221p3356404.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to