Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 40883 invoked from network); 10 Mar 2009 16:11:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Mar 2009 16:11:05 -0000 Received: (qmail 98041 invoked by uid 500); 10 Mar 2009 16:11:04 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 98012 invoked by uid 500); 10 Mar 2009 16:11:04 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 98001 invoked by uid 99); 10 Mar 2009 16:11:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Mar 2009 09:11:04 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists+1214986160035-208411@n2.nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Mar 2009 16:10:55 +0000 Received: from tervel.nabble.com ([192.168.236.150]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Lh4XK-0008Bd-Om for users@openjpa.apache.org; Tue, 10 Mar 2009 09:10:34 -0700 Message-ID: <1236701434749-2456113.post@n2.nabble.com> Date: Tue, 10 Mar 2009 09:10:34 -0700 (PDT) From: Pinaki Poddar To: users@openjpa.apache.org Subject: Re: FieldMetaData questions In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: ppoddar@apache.org References: X-Virus-Checked: Checked by ClamAV on apache.org Hi, > such that I could tag a field with a custom-defined property-value pair and retrieve it? Yes you can. At meta-level, you can mark a Field carrying implementation specific data. See FieldMetaData.usesImplData(); At an instance level every element can be attached with a 'user object' which is opaque to OpenJPA runtime. > For example, in our current legacy code, we have the idea of a "hidden" > property. I would like to be > able to retrieve this when looping through the fields in order to > correctly transform the data to > our existing legacy structures. The other option (which is simpler) is to use Externalizer support that annotates a field with a pair of conversion functions to translate between in-memory and data store representation. A more involved approach in to write custom value handlers. Both of them (externalizer and custom value) are adequately documented in OpenJPA documentation. Regards -- Pinaki Heather Sterling wrote: > > > > Hi, > > I was wondering how to retrieve the possible enum values from a > FieldMetaData structure. > > I also wanted to know if there's a way to get other information, such as > the length of a field. (specified with @Column annotation). I assume > there > is, but I could not find it. > > Lastly, is there a way to extend the metadata, such that I could tag a > field with a custom-defined property-value pair and retrieve it? I saw > that there are some extension APIs on FieldMetaData, but I'm not sure what > the purpose of those are. For example, in our current legacy code, we > have > the idea of a "hidden" property. I would like to be able to retrieve this > when looping through the fields in order to correctly transform the data > to > our existing legacy structures. > > Thanks, > > Heather Sterling > Systems Management Development > Phone: 919-254-7163 T/L: 444-7163 > Cell: 919-423-3143 > Email: hsterl@us.ibm.com > -- View this message in context: http://n2.nabble.com/FieldMetaData-questions-tp2455854p2456113.html Sent from the OpenJPA Users mailing list archive at Nabble.com.