You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Bruce Beaumont <br...@ucs-solutions.co.za> on 2007/07/31 15:02:07 UTC

Informix specific bug

Hi

I was trying to execute a bulk delete operation as below

 Query q = em.createQuery("delete from simple s where s.date < :deldate");

This results in the following SQL being generated
DELETE FROM simple t0 WHERE (t0.s_date < ?)

but Informix does not support table aliases on delete statements.

After scratching around in the source i found a variable 
public boolean allowsAliasInBulkClause = true;
which is set in org.apache.openjpa.DBDictionary

Could someone please confirm that all I have to do is set
allowsAliasInBulkClause = false; in the constructor of
org.apache.openjpa.jdbc.sql.InformixDictionary

Bruce



Re: Informix specific bug

Posted by Michael Dick <mi...@gmail.com>.
Hi Bruce,

Which version of OpenJPA are you using? I believe this has been fixed in the
1.0.0 stream.

If you can't / don't want to move to a 1.0.0 SNAPSHOT, then you can change

allowsAliasInBulkClause = false;
supportsSubselect = false;


In the InformixDictionary.

The changes were made in OPENJPA-269 :
http://issues.apache.org/jira/browse/OPENJPA-269

-Mike

On 7/31/07, Bruce Beaumont <br...@ucs-solutions.co.za> wrote:
>
> Hi
>
> I was trying to execute a bulk delete operation as below
>
> Query q = em.createQuery("delete from simple s where s.date < :deldate");
>
> This results in the following SQL being generated
> DELETE FROM simple t0 WHERE (t0.s_date < ?)
>
> but Informix does not support table aliases on delete statements.
>
> After scratching around in the source i found a variable
> public boolean allowsAliasInBulkClause = true;
> which is set in org.apache.openjpa.DBDictionary
>
> Could someone please confirm that all I have to do is set
> allowsAliasInBulkClause = false; in the constructor of
> org.apache.openjpa.jdbc.sql.InformixDictionary
>
> Bruce
>
>
>