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 2004/08/07 10:47:41 UTC

about extent class

Hi,

I was looking at extent-class and what I didn't get was how it really 
works.. So here is an exmaple:

I have 1:n relation (parent:childs)..

and I want to create superchild..

like 1:n (parent:superchild)

is it possible to do just in SQL:

CREATE TABLE super_child (
  id integer,
  name varchar(50),
  age integer,
  parent_id integer,
PRIMARY KEY(id),
FOREIGN KEY (parent_id) REFERENCES parent(id));

and in repository.xml just this:

<class-descriptor class="net.vettenranta.superChild" 
table="super_child">
  <field-descriptor name="age" column="age" jdbs-type="INTEGER" />
  <extent-class="net.vettenranta.Child" />
</class-descriptor>

and of course class-descriptor for Child would have (id, name and 
parent field-descriptors and reference-descriptors).

Or do I just have to copy&paste whole child to superChild?

Thanks,

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