You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Miroslav Nachev <mi...@space-comm.com> on 2008/01/30 10:55:12 UTC

How to get the current object which will be persisted from ClassMapping in JDBCSeq.nextInternal(...) method

Hi,

I have my custom JDBC Sequence generator. How can I get the current 
object which will be persisted from ClassMapping parameter which is 
passed in JDBCSeq.nextInternal(...) method?


Regards,
Miro.

Re: How to get the current object which will be persisted from ClassMapping in JDBCSeq.nextInternal(...) method

Posted by Miroslav Nachev <mi...@space-comm.com>.
During the Id generation I would like to get the parent Id of the new object
and to process with additional logic. Of course I can do that in another way
but this is very clever.


Miro.


On 1/30/08, Patrick Linskey <pl...@gmail.com> wrote:
>
> I guess I don't understand your use case. Why would you need an
> instance? The sequence generator interfaces are designed to create
> sequence values for given types, not for particular instances. It
> would seem that if instance state is relevant to id generation, then
> the logic to perform the id generation should belong in the class, not
> out in an externalized sequence generator.
>
> -Patrick
>
> On Jan 30, 2008 7:46 AM, Miroslav Nachev <mi...@space-comm.com> wrote:
> >
> >
> >
> >  I don't believe that you can get the current instance; you can only
> > get the current instance type.
> >  This is not good. I can hack the code but I can do that if this will
> stay
> > in the future versions. I don't like to do that if this will be just for
> my
> > use.
> >  There are another ways but then the idea is broken.
> >
> >
> >  Miro.
> >
> >
> >
> >
> >  Patrick Linskey wrote:
> >  Hi,
> >
> > I don't believe that you can get the current instance; you can only
> > get the current instance type.
> >
> > -Patrick
> >
> > On Jan 30, 2008 1:55 AM, Miroslav Nachev <mi...@space-comm.com> wrote:
> >
> >
> >  Hi,
> >
> > I have my custom JDBC Sequence generator. How can I get the current
> > object which will be persisted from ClassMapping parameter which is
> > passed in JDBCSeq.nextInternal(...) method?
> >
> >
> > Regards,
> > Miro.
> >
> >
> >
> >
> >
> >
> >
>
>
>
> --
> Patrick Linskey
> 202 669 5907
>

Re: How to get the current object which will be persisted from ClassMapping in JDBCSeq.nextInternal(...) method

Posted by Patrick Linskey <pl...@gmail.com>.
I guess I don't understand your use case. Why would you need an
instance? The sequence generator interfaces are designed to create
sequence values for given types, not for particular instances. It
would seem that if instance state is relevant to id generation, then
the logic to perform the id generation should belong in the class, not
out in an externalized sequence generator.

-Patrick

On Jan 30, 2008 7:46 AM, Miroslav Nachev <mi...@space-comm.com> wrote:
>
>
>
>  I don't believe that you can get the current instance; you can only
> get the current instance type.
>  This is not good. I can hack the code but I can do that if this will stay
> in the future versions. I don't like to do that if this will be just for my
> use.
>  There are another ways but then the idea is broken.
>
>
>  Miro.
>
>
>
>
>  Patrick Linskey wrote:
>  Hi,
>
> I don't believe that you can get the current instance; you can only
> get the current instance type.
>
> -Patrick
>
> On Jan 30, 2008 1:55 AM, Miroslav Nachev <mi...@space-comm.com> wrote:
>
>
>  Hi,
>
> I have my custom JDBC Sequence generator. How can I get the current
> object which will be persisted from ClassMapping parameter which is
> passed in JDBCSeq.nextInternal(...) method?
>
>
> Regards,
> Miro.
>
>
>
>
>
>
>



-- 
Patrick Linskey
202 669 5907

Re: How to get the current object which will be persisted from ClassMapping in JDBCSeq.nextInternal(...) method

Posted by Patrick Linskey <pl...@gmail.com>.
Hi,

I don't believe that you can get the current instance; you can only
get the current instance type.

-Patrick

On Jan 30, 2008 1:55 AM, Miroslav Nachev <mi...@space-comm.com> wrote:
> Hi,
>
> I have my custom JDBC Sequence generator. How can I get the current
> object which will be persisted from ClassMapping parameter which is
> passed in JDBCSeq.nextInternal(...) method?
>
>
> Regards,
> Miro.
>



-- 
Patrick Linskey
202 669 5907