openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Hillmann" <ed.hillm...@gmail.com>
Subject Re: org.apache.openjpa.persistence.ArgumentException?
Date Wed, 27 Jun 2007 00:18:38 GMT
On 6/27/07, Marc Prud'hommeaux <mprudhom@apache.org> wrote:
> Ed-
>
> > delete from CachedItem where repository=:repository and folder=:folder
>
> Hmm ... that doesn't look legal to me, since it doesn't have any
> alias. I'm surprised it even parses. What happens if you change it to:
>
>    delete from CachedItem x where x.repository=:repository and
> x.folder=:folder
>

Hi.  I've tried it using the snapshot, and it still failed.  I also
had the same idea as you about using a query with an alias.  So when I
define the NamedQuery as

delete from CacheItem i where i.repository=:repository and i.folder=:folder

it works fine.  I did think of that, only because it performed the
same kind of query on another managed entity, but its named query used
an alias.

I can use this workaround, but just for argument's sake I didn't think
that an alias was required.  This had worked without an error using
another JPA provider (I'm sorry for saying that more than once... I'll
stop).  For this test, though, I'll go through the named queries and
add aliases to them.

I'll attach the log to this email as well, just so you can see what's
going on.  But I can work with the workaround (use an alias in the
query).

I'd just like to mention that the feedback on this mailing list is
great.  I very much appreciate the help that everyone is providing.

Thanks again!
Ed

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message