Return-Path: Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 8030 invoked from network); 30 May 2003 10:10:53 -0000 Received: from mailout01.sul.t-online.com (194.25.134.80) by daedalus.apache.org with SMTP; 30 May 2003 10:10:53 -0000 Received: from fwd05.sul.t-online.de by mailout01.sul.t-online.com with smtp id 19Lgqo-0001sg-01; Fri, 30 May 2003 12:11:06 +0200 Received: from win (510007636964-0001@[80.145.107.121]) by fmrl05.sul.t-online.com with smtp id 19Lgqe-0vCAi0C; Fri, 30 May 2003 12:10:56 +0200 Message-ID: <039a01c32693$bfcd80f0$6479fea9@win> Reply-To: "Armin Waibel" From: "Armin Waibel" To: "OJB Developers List" References: <2783918C-91ED-11D7-88B1-000A95782782@forthillcompany.com> Subject: Re: [PATCH] xdocs/howto-use-anonymous-keys.xml Date: Fri, 30 May 2003 12:10:51 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Sender: 510007636964-0001@t-dialin.net X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Brain, damned 'attachment-eater' ;-) please send me your patch directly. regards, Armin ----- Original Message ----- From: "Brian McCallister" To: "OJB Developers List" Sent: Thursday, May 29, 2003 5:49 PM Subject: Re: [PATCH] xdocs/howto-use-anonymous-keys.xml > Bizarre, the attchements didn't make it through. > > One more try, and the patch inline at the end. > > ------------------------------------------------------------------------ -------- > > > -Brian > > > > On Thursday, May 29, 2003, at 10:24 AM, Brian McCallister wrote: > > > I messed up the howto-use-anonymous-keys.xml howto, sorry about that. > > Didn't c&p final code in to the one I submitted. > > > > Here is a (fully tested and working) patch for the howto, as well as > > the patched file (don't know which form is preferred). > > > > -Brian > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org > > For additional commands, e-mail: ojb-dev-help@db.apache.org > > > Index: xdocs/howto-use-anonymous-keys.xml > =================================================================== > RCS file: /home/cvspublic/db-ojb/xdocs/howto-use-anonymous-keys.xml,v > retrieving revision 1.1 > diff -c -r1.1 howto-use-anonymous-keys.xml > *** xdocs/howto-use-anonymous-keys.xml 15 May 2003 06:20:58 -0000 1.1 > --- xdocs/howto-use-anonymous-keys.xml 29 May 2003 14:18:23 -0000 > *************** > *** 44,90 **** > public class Desk > { > private Finish finish; > ! > ! /** Contains Thing instances */ > ! private Set drawers; > ! > private int numberOfLegs; > > ! public Set getDrawers() { return this.drawers; } > > - public int getNumberOfLegs() { return this.numberOfLegs; } > - public void setNumberOfLegs(int num) { this.numberOfLegs = num; } > > - public Finish getFinish { return this.finish; } > - public void setFinish(Finish finish) { this.finish = finish } > - } > - > public class Drawer > { > ! /** Contains anything */ > ! private Collection stuffInDrawer; > > ! public Collection getStuffInDrawer() { return this.stuffInDrawer; > } > } > ! > public class Finish > { > private String wood; > private String color; > > ! public String getWood() { return this.wood; } > ! public void setWood(String nom) { this.wood = wood; } > ! > ! public String getColor() { return this.color; } > ! public void setColor(String color) { this.color = color; } > } > > public class Thing > { > private String name; > > ! public String getName() { return this.name; } > ! public String setName(String name) { this.name = name; } > } > ]]> >

> --- 44,141 ---- > public class Desk > { > private Finish finish; > ! /** Contains Drawer instances */ > ! private List drawers; > private int numberOfLegs; > > ! public Desk() > ! { > ! this.drawers = new ArrayList(); > ! } > ! > ! public List getDrawers() > ! { > ! return this.drawers; > ! } > ! > ! public int getNumberOfLegs() > ! { > ! return this.numberOfLegs; > ! } > ! > ! public void setNumberOfLegs(int num) > ! { > ! this.numberOfLegs = num; > ! } > ! > ! public Finish getFinish() > ! { > ! return this.finish; > ! } > ! > ! public void setFinish(Finish finish) > ! { > ! this.finish = finish; > ! } > ! } > > > public class Drawer > { > ! /** Contains Thing instances */ > ! private List stuffInDrawer; > > ! public List getStuffInDrawer() > ! { > ! return this.stuffInDrawer; > ! } > ! > ! public Drawer() > ! { > ! this.stuffInDrawer = new ArrayList(); > ! } > } > ! > ! > public class Finish > { > private String wood; > private String color; > > ! public String getWood() > ! { > ! return this.wood; > ! } > ! > ! public void setWood(String nom) > ! { > ! this.wood = wood; > ! } > ! > ! public String getColor() > ! { > ! return this.color; > ! } > ! > ! public void setColor(String color) > ! { > ! this.color = color; > ! } > } > > public class Thing > { > private String name; > > ! public String getName() > ! { > ! return this.name; > ! } > ! > ! public void setName(String name) > ! { > ! this.name = name; > ! } > } > ]]> >

> *************** > *** 96,126 **** > When we need to store our instances in a database we use a fairly > typical table per class persistance model. >

> CREATE TABLE desk > ( > id INTEGER PRIMARY KEY, > num_legs INTEGER, > ); > > CREATE TABLE drawer > ( > id INTEGER PRIMARY KEY, > ! desk_id INTEGER FOREIGN KEY REFERENCES desk(id) > ); > > CREATE TABLE thing > ( > id INTEGER PRIMARY KEY, > name VARCHAR(255), > ! drawer_id INTEGER FOREIGN KEY REFERENCES drawer(id) > ! ); > ! > ! CREATE TABLE finish > ! ( > ! id INTEGER PRIMARY KEY, > ! wood VARCHAR(255), > ! color VARCHAR(255), > ! desk_id INTEGER FOREIGN KEY REFERENCES desk(id) > ); > ]]> >

> --- 147,180 ---- > When we need to store our instances in a database we use a fairly > typical table per class persistance model. >

> + CREATE TABLE finish > + ( > + id INTEGER PRIMARY KEY, > + wood VARCHAR(255), > + color VARCHAR(255) > + ); > + > CREATE TABLE desk > ( > id INTEGER PRIMARY KEY, > num_legs INTEGER, > + finish_id INTEGER, > + FOREIGN KEY (finish_id) REFERENCES finish(id) > ); > > CREATE TABLE drawer > ( > id INTEGER PRIMARY KEY, > ! desk_id INTEGER, > ! FOREIGN KEY (desk_id) REFERENCES desk(id) > ); > > CREATE TABLE thing > ( > id INTEGER PRIMARY KEY, > name VARCHAR(255), > ! drawer_id INTEGER, > ! FOREIGN KEY (drawer_id) REFERENCES drawer(id) > ); > ]]> >

> *************** > *** 138,144 **** > class="Desk" > table="desk"> > ! > name="id" > column="id" > --- 192,198 ---- > class="Desk" > table="desk"> > ! > name="id" > column="id" > *************** > *** 152,175 **** > column="num_legs" > jdbc-type="INTEGER" > /> > name="drawers" > element-class-ref="Drawer" > > > > > ! > name="finish" > class-ref="Finish"> > ! > > > > class="Finish" > table="finish"> > ! > name="id" > column="id" > --- 206,235 ---- > column="num_legs" > jdbc-type="INTEGER" > /> > + + name="finishId" > + column="finish_id" > + jdbc-type="INTEGER" > + access="anonymous" /> > + > name="drawers" > element-class-ref="Drawer" > > > > > ! > name="finish" > class-ref="Finish"> > ! > > > > class="Finish" > table="finish"> > ! > name="id" > column="id" > *************** > *** 190,206 **** > jdbc-type="VARCHAR" > size="255" > /> > - - name="deskId" > - column="desk_id" > - jdbc-type="INTEGER" > - /> > > > class="Drawer" > table="drawer"> > ! > name="id" > column="id" > --- 250,261 ---- > jdbc-type="VARCHAR" > size="255" > /> > > > class="Drawer" > table="drawer"> > ! > name="id" > column="id" > *************** > *** 226,232 **** > class="Thing" > table="thing"> > ! > name="id" > column="id" > --- 281,287 ---- > class="Thing" > table="thing"> > ! > name="id" > column="id" > > > > ------------------------------------------------------------------------ -------- > --------------------------------------------------------------------- > To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org > For additional commands, e-mail: ojb-dev-help@db.apache.org