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 Carles Duque <cd...@eic.es> on 2004/05/03 10:48:48 UTC
inherit problem
Hello!!
I have a problem witth retrieve two classes in a two tables.
Classes: A and B. B estends A.
When I have one class (example: A) I see if Id (getId()) is null. If its true, I do "select MAX" and I assing to class (setId()). This work ok, always.
In the new case (A and B), when I retrieve a class B, I do "select MAX", assign id, but returns SQLException, because ID is null.
Is possible that if you put "auto-retrieve=true", you must use auto-increment?? Its possible another solution?
Thanks!!!
Carles
Re: inherit problem
Posted by Stefan Schlösser <ss...@intermediate.de>.
Hi,
auto-retrieve does not require auto-increment to be set.
You likely made a misstake in your class-definitions and or repository
declarations.
Stefan
Carles Duque wrote:
> Hello!!
>
> I have a problem witth retrieve two classes in a two tables.
> Classes: A and B. B estends A.
>
> When I have one class (example: A) I see if Id (getId()) is null. If its true, I do "select MAX" and I assing to class (setId()). This work ok, always.
> In the new case (A and B), when I retrieve a class B, I do "select MAX", assign id, but returns SQLException, because ID is null.
>
> Is possible that if you put "auto-retrieve=true", you must use auto-increment?? Its possible another solution?
>
> Thanks!!!
>
>
> Carles
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org