Return-Path: Delivered-To: apmail-incubator-empire-db-user-archive@minotaur.apache.org Received: (qmail 13956 invoked from network); 12 Feb 2010 20:17:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Feb 2010 20:17:53 -0000 Received: (qmail 89087 invoked by uid 500); 12 Feb 2010 20:17:53 -0000 Delivered-To: apmail-incubator-empire-db-user-archive@incubator.apache.org Received: (qmail 89046 invoked by uid 500); 12 Feb 2010 20:17:53 -0000 Mailing-List: contact empire-db-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: empire-db-user@incubator.apache.org Delivered-To: mailing list empire-db-user@incubator.apache.org Received: (qmail 89037 invoked by uid 99); 12 Feb 2010 20:17:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Feb 2010 20:17:52 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [88.79.172.157] (HELO mail.esteam.de) (88.79.172.157) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Feb 2010 20:17:46 +0000 Content-class: urn:content-classes:message Subject: re: how to add a "foreign" table MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Fri, 12 Feb 2010 21:17:02 +0100 Message-ID: X-MimeOLE: Produced By Microsoft Exchange V6.5 In-reply-to: <4B74867E.8010808@eknet.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: re: how to add a "foreign" table Thread-Index: AcqrasUktBEj295eT/KkafKzZjWyggAnY9Rw References: <4B74867E.8010808@eknet.org> From: =?iso-8859-1?Q?Rainer_D=F6bele?= To: Hi Eike, first I want to thank you very much for your submission of the spring = example. Unfortunately I did not have the chance to look at it so far - but I am = quite keen to do so. I'll let you know when I have. Now about your question: A DBTable object may only belong to one database object just like an = XMLElement belongs to its XMLDocument. This assignment is usually performed on creation of the DBTable and = there is no mechanism to change it. Hence if you really need to need a copy of the table object of one = database in another one you need to create a new instance of the table = object. Normally you would just create a instalce of the table like this: DBTable t =3D new DB1.SomeTable(db2); If your code should be more generic then you might use something like: DBTable t =3D db1.getTable(...); t.getClass().getConstructor(DBDatabase.class).newInstance(new = Object[] { db2 }); This assumes that the table has a constructor that takes the db as a = parameter. Hope this is what you need. Otherwiese I would need to know what excatly you are trying to achieve = with this. Regards Rainer Eike Kettner wrote: > re: how to add a "foreign" table >=20 > Hello all, >=20 > I'm facing a problem that I want to add a table from one db to another > db. I have two DBDatabases and I like to add a table from DB1 to DB2, > something like this: >=20 >=20 > DBDatabase db1 =3D .. > DBDatabase db2 =3D .. >=20 > DBTable table1 =3D db1.getTable(0); >=20 > db2.addTable(table1); >=20 >=20 > actually, what i want is to create a table on DB2 that is present on > DB1, without too much coding ;-) >=20 > Thankful for any help! >=20 > Kind regards, > Eike