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 Joose Vettenranta <jo...@iki.fi> on 2005/11/28 21:40:40 UTC
Problem with interface
Hi,
I have like this:
public class A implements Foo {
private Integer id;
...
getter/setter..
}
public class B implements Foo {
private Integer id;
...
getter/setter..
}
public interface Foo {
public Integer getId();
public void setId();
....
}
Both A and B has unique id's.. so both can have values with id=5;
When I do query to that Interface, I get values for class B objects
from class A objects if ID value is the same.
Can I fix this somehow or do I have to use global unique id as
primary key?
Thanks, Joose
ps. using ojb 1.0.1
--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Problem with interface
Posted by Joose Vettenranta <jo...@iki.fi>.
Thomas Dudziak kirjoitti 29.11.2005 kello 14:32:
>> Can I fix this somehow or do I have to use global unique id as
>> primary key?
>
> This depends on how you mapped these types. Please post your
> repository xml file.
Well, I solved problem already.. I renamed current unique id (primary
key) as "classId" (and removed primary key) and created new id
(primary key) which sequence is common for every class in that
current interface. So now it works.
- Joose
--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Problem with interface
Posted by Thomas Dudziak <to...@gmail.com>.
On 11/28/05, Joose Vettenranta <jo...@iki.fi> wrote:
> I have like this:
>
> public class A implements Foo {
> private Integer id;
> ...
> getter/setter..
> }
>
> public class B implements Foo {
> private Integer id;
> ...
> getter/setter..
> }
>
> public interface Foo {
> public Integer getId();
> public void setId();
> ....
> }
>
> Both A and B has unique id's.. so both can have values with id=5;
>
> When I do query to that Interface, I get values for class B objects
> from class A objects if ID value is the same.
>
> Can I fix this somehow or do I have to use global unique id as
> primary key?
This depends on how you mapped these types. Please post your
repository xml file.
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org