You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Armin Waibel <ar...@code-au-lait.de> on 2003/04/09 20:58:08 UTC

Re: rc2, SequenceManagerHelper does not handle abstractclasses well -> nullpointerexception

Hi Roger,

thanks for the clear explanation and your patience.

I have written a small test case with
> A
>     /   \
>    B     C
the test passed well.

Could post some more info? code snip, class-descriptor from A,B,C
classes A,B,C.

> Since i have to pass a fielddescriptor, i need to declare the field on
A in
> the ojb repository

You have to declare the field in B and C, but why in abstract class A?

> And there is a functionality request.
> I would like to be able to have sequences, not mapped to fields of
objects.
> i have fields in which i concatenate the generated id with other info,

how we can do autoincrement in that case?

regards,
armin

> and i
> can not use the fielddescriptor of this field (it needs to be integer,
> otherwise an sqlexception will be the result when the MaxId is being
> retrieved), and i do not wish to have a 'hidden' id field with the
> id/sequence value and the visible worked-over field together being
modelled
> on my businessobjects.



regards,
Armin

----- Original Message -----
From: "Janssen, Roger" <Ro...@ibanx.nl>
To: "'OJB Users List'" <oj...@db.apache.org>
Sent: Wednesday, April 09, 2003 4:19 PM
Subject: rc2, SequenceManagerHelper does not handle abstractclasses
well -> nullpointerexception


> hi,
>
> suppose i have an object hierarchie :
>
> A
>     /   \
>    B     C
>
> in which A is abstract. A declares field 'number' and B and C inherit
it.
> Now a want to generate unique numbers for this field ('number') across
all
> extends of A.
>
> Since i have to pass a fielddescriptor, i need to declare the field on
A in
> the ojb repository
> file (i can live with that). done that, passing this fielddescriptor
to get
> a the next unique id
> for it, deep down (SequenceManagerHelper), a sequence name is
generated,
> using, the toplevel class of A and using it's tablename (what if
> toplevelclass is abstract/interface which is not mapped to a table,
doesn't
> it go wrong?).
> Second it starts looking for the highest existing value for the field
across
> the extends, including A. But A is abstract, and still a query is
being
> build for a class not mapped to a table (which results in the
> nullpointerexception).
>
> And there is a functionality request.
> I would like to be able to have sequences, not mapped to fields of
objects.
> i have fields in which i concatenate the generated id with other info,
and i
> can not use the fielddescriptor of this field (it needs to be integer,
> otherwise an sqlexception will be the result when the MaxId is being
> retrieved), and i do not wish to have a 'hidden' id field with the
> id/sequence value and the visible worked-over field together being
modelled
> on my businessobjects.
>
> thanx,
>
> roger janssen
> iBanx
>
>
>
>
>
>
************************************************************************
*
> The information contained in this communication is confidential and is
> intended solely for the use of the individual or entity to  whom it is
> addressed.You should not copy, disclose or distribute this
communication
> without the authority of iBanx bv. iBanx bv is neither liable for
> the proper and complete transmission of the information has been
maintained
> nor that the communication is free of viruses, interceptions or
interference.
>
> If you are not the intended recipient of this communication please
return
> the communication to the sender and delete and destroy all copies.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>