You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Patrick Linskey <pl...@gmail.com> on 2008/01/24 17:49:01 UTC
Re: Help selecting version column
Hi,
Why are you trying to do this? Definitely it looks like this is a bug
in OpenJPA, but generally-speaking it's very cheap to pull back the
rest of the rows in a given record (i.e., select a frmo AnEntity a
where a.id = ?1).
-Patrick
On Jan 24, 2008 7:38 AM, Jeff Melching <jm...@us.ibm.com> wrote:
> I am trying to select only the version column of an entity to see if it
> was changed.
>
> If I run the following JPQL where verId is the version field of my entity:
>
> select a.verId from AnEntity a where a.id = ?1;
>
> The generated sql is:
>
> SELECT FROM AN_ENTITY t0 WHERE t0.ID = ?
>
> Obviously, this is invalid sql syntax as the columns to select are
> missing. I am using a DB2 dictionary.
--
Patrick Linskey
202 669 5907
Re: Help selecting version column
Posted by Jeff Melching <jm...@us.ibm.com>.
I have to do this for several entities, some of which have to have things
eagerly loaded. I am trying to save a little bandwidth and db processing.
I have an extremely complicated data model to deal with.
From:
"Patrick Linskey" <pl...@gmail.com>
To:
users@openjpa.apache.org
Date:
01/24/2008 10:49 AM
Subject:
Re: Help selecting version column
Hi,
Why are you trying to do this? Definitely it looks like this is a bug
in OpenJPA, but generally-speaking it's very cheap to pull back the
rest of the rows in a given record (i.e., select a frmo AnEntity a
where a.id = ?1).
-Patrick
On Jan 24, 2008 7:38 AM, Jeff Melching <jm...@us.ibm.com> wrote:
> I am trying to select only the version column of an entity to see if it
> was changed.
>
> If I run the following JPQL where verId is the version field of my
entity:
>
> select a.verId from AnEntity a where a.id = ?1;
>
> The generated sql is:
>
> SELECT FROM AN_ENTITY t0 WHERE t0.ID = ?
>
> Obviously, this is invalid sql syntax as the columns to select are
> missing. I am using a DB2 dictionary.
--
Patrick Linskey
202 669 5907