openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey" <plins...@gmail.com>
Subject Re: DBDictionary for SQLite
Date Mon, 29 Oct 2007 17:09:43 GMT
Hi,

By "JPA auto strategy", I'm assuming that you mean @GeneratedValue
with no specified strategy, which defaults to GenerationType.AUTO.

In OpenJPA, I believe that this translates to the same behavior as
GenerationType.TABLE. What sorts of problems are you seeing with this
strategy?

-Patrick

On 10/29/07, Marc Siegel <marc.siegel.17@gmail.com> wrote:
> Since I posted that mail, I looked through the source code of
> DBDictionary, and as a result of that I the SQLiteDictionary to have
>    lastGeneratedKeyQuery = "SELECT MAX({0}) FROM {1}";
>
> My mapping is simply any class with an @Id column. I have succeeded in
> making this work by adding @GeneratedValue(strategy =
> GenerationType.IDENTITY), but would like to be able to make this work
> with the JPA auto strategy as well.
>
> Thanks
> -Marc
>
> On 10/28/07, Patrick Linskey <plinskey@gmail.com> wrote:
> > Hi,
> >
> > What does your mapping look like for your class?
> >
> > -Patrick
> >
> > On 10/26/07, Marc Siegel <marc.siegel.17@gmail.com> wrote:
> > > Hi folks,
> > >
> > > I am trying to user OpenJPA 1.0.0 on top of SQLiteJDBC.
> > > OpenJPA wants to insert an Id if zero for every row.
> > >
> > > I know I need a DBDictionary subclass, I have tried making one with
> > >   - createPrimaryKey = false
> > >   -  lastGeneratedKeyQuery = "SELECT SEQ FROM SQLITE_SEQUENCE WHERE
> > > NAME = \"{0}\"";
> > >
> > > Neither of these worked. Any knowledgable suggestions?
> > >
> > > Many thanks,
> > > -Marc
> > >
> >
> >
> > --
> > Patrick Linskey
> > 202 669 5907
> >
>


-- 
Patrick Linskey
202 669 5907

Mime
View raw message