Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 40853 invoked from network); 25 Sep 2005 12:35:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Sep 2005 12:35:04 -0000 Received: (qmail 16095 invoked by uid 500); 25 Sep 2005 12:35:01 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 15997 invoked by uid 500); 25 Sep 2005 12:35:00 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 15976 invoked by uid 99); 25 Sep 2005 12:35:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Sep 2005 05:35:00 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of tomdzk@gmail.com designates 64.233.182.199 as permitted sender) Received: from [64.233.182.199] (HELO nproxy.gmail.com) (64.233.182.199) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Sep 2005 05:35:05 -0700 Received: by nproxy.gmail.com with SMTP id d4so92598nfe for ; Sun, 25 Sep 2005 05:34:36 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jF1RkWKzPyszlxeadrTzFVhBEHePFSOtXJld1jZ7U0oDuWsJO8qKSXx2pOzyqf6j5Qo52SKAIiMrZZIOzkV7XdvzaerTPzvCu9nkJ3P3xhoLBqS7Q/CKxQa7TZm61lH1WqcdBK4CdFYz1unyolq64TMzZw/hkWGN3cYm3aaH3MI= Received: by 10.48.236.4 with SMTP id j4mr165685nfh; Sun, 25 Sep 2005 05:34:36 -0700 (PDT) Received: by 10.48.250.9 with HTTP; Sun, 25 Sep 2005 05:34:36 -0700 (PDT) Message-ID: <224f32340509250534501111d8@mail.gmail.com> Date: Sun, 25 Sep 2005 14:34:36 +0200 From: Thomas Dudziak Reply-To: Thomas Dudziak To: OJB Developers List Subject: Re: Dynamic map creation on-the-fly In-Reply-To: <200509250509.j8P59fKa021762@rs26s12.datacenter.cha.cantv.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200509250509.j8P59fKa021762@rs26s12.datacenter.cha.cantv.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 9/25/05, C=E9sar Obach-Renner wrote: > I've just searched with no success all arround the archive of this list a= s > well as the "user" one looking for what I haven't found yet on the intern= et. > > I'm looging for an O/R mapping tool that encapsulates not only the > Relational aspect of the RDBMS underneath, but the maping itself as well = as > the database "administration" (table creation, etc.) all of it at runtime= . > > For example, the following snippet would be enough without the need of > creating the maping for the "MyClass" object in the "repository_user.xml" > file. The maping would be created on-the-fly dynamically as soon as the > broker receives an object of that class for the first time: > > PersistenceBroker broker =3D > PersistenceBrokerFactory.defaultPersistenceBroker(); > broker.beginTransaction(); > broker.store(new MyClass(some-info)); > broker.commitTransaction(); > > It's obvious that the mapping should has to follow formal guidelines like > those worked by Scott Ambler's white papers "Mapping Objects To Relation= al > Databases" and "The Design of a Robust Persistence Layer for Relational > Databases", so the auto-generated mapping ensures robustness in the RDBMS > schema for storing the objects. > > My idea writing to this list is to understand if this is implemented toda= y > in OJB? If not, for when is it scheduled? And if it is aligned with the > project vision I would be very glad to work personally with the project i= n > order to make it happen. OJB does not per se support this currently, though it would be easy to add this with the help of DdlUtils. However you should be aware of the issues surrounding such an approach, eg. * what happens if there is already a table of that name there, perhaps with a fitting structure, perhaps not ? should it be changed ot removed or what ? * what if the class name is too long (eg. for some databases the identifier length must not exceed 18 characters) or there is more than one class with the same unqualified (short) name ? * it is perhaps not always possible to see at the SqlException that a sql operation has failed because the table is not yet there - this largely depends upon the quality of the jdbc driver implementation regards, Tom --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org