Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 48756 invoked from network); 14 Jul 2005 19:23:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Jul 2005 19:23:02 -0000 Received: (qmail 92310 invoked by uid 500); 14 Jul 2005 19:23:01 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 92296 invoked by uid 99); 14 Jul 2005 19:23:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jul 2005 12:23:01 -0700 X-ASF-Spam-Status: No, hits=1.7 required=10.0 tests=RCVD_IN_NJABL_DUL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [81.174.133.99] (HELO roobarb.ajsoft.net) (81.174.133.99) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jul 2005 12:22:58 -0700 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by roobarb.ajsoft.net (Postfix) with ESMTP id CA8AA11125 for ; Thu, 14 Jul 2005 20:22:53 +0100 (BST) From: Andy Jefferson To: jdo-dev@db.apache.org Subject: Re: Embedded collections of non-PC objects Date: Thu, 14 Jul 2005 20:22:50 +0100 User-Agent: KMail/1.7.2 References: <42D2A542.60300@spree.de> <200507141836.17523.andy@jpox.org> <52EBCBBA-39D5-4D32-AA14-E41E10E390AD@Sun.COM> In-Reply-To: <52EBCBBA-39D5-4D32-AA14-E41E10E390AD@Sun.COM> Organization: JPOX MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200507142022.51529.andy@jpox.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Craig, > Is it possible to default the value of the serialized > attribute to "true" for embedded non-PC types? That would immediately > solve our current Collection, Set, and Map issues, without having > extra stuff in the metadata file. Anything is possible ... > The .jdo file specifies the embedded-element, embedded-key, and > embedded-value attributes for the relevant fields, so simply changing > the defaults would make it all work. > > I looked at the spec again and it doesn't look like the serialized > attribute should be required, so it would be better if it were > defaulted > > The embedded attribute specifies whether the field should be stored > as part of the containing instance instead of as its own instance in > the datastore. It must be specified or default to "true" for fields > of primitive types, wrappers, java.lang, java.math, java.util, > collection, map, and array types specified above; and "false" > otherwise. While a compliant implementation is permitted to support > these types as first class instances in the datastore, the semantics > of embedded=3D=E2=80=9Dtrue=E2=80=9D imply containment. That is, the embe= dded instances > have no independent existence in the datastore and have no Extent > representation. > The semantics of embedded applied to collection, map, and array types > applies to the structure of the type, not to the elements, keys, and > values. That is, the collection itself is considered separate from > its contents. These may separately be specified to be embedded or > not, using embedded-element, embedded-key, and embedded-value > attributes of the collection, array, and map elements. > The embedded attribute applied to a field of a persistence-capable > type is a hint to the implementation to treat the field as if it were > a Second Class Object. But this behavior is not further specified and > is not portable. > Well this does beg the question, where is the difference between "serialize= d"=20 and "embedded" at level then ? If I specify for a collection, is this the same = as=20 for the collection ? "serialized" doesn't have= a=20 description in 18.13 btw. Personally I would expect a Collection or Map to=20 default to having the elements queryable, and embedding them (by default) i= s=20 not going to give me that. Perhaps I just disagree with the spec on this=20 issue :-) Perhaps some examples would be beneficial ? (in the spec). Not that I'm try= ing=20 to increase your workload :-0. I see one example of "embedded" and that is= =20 defining fine details of how to embed an object (which is what I= =20 would expect to use this keyword for anyway), and which seems a long way fr= om=20 what we're talking about here. If I'm not understanding this then you can b= et=20 SUN's vast bank balance that users will have a hard time working it out, an= d=20 I'm not going to spend my spare time explaining it to them =2D-=20 Andy Java Persistent Objects - JPOX