Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 67674 invoked from network); 7 Jan 2005 19:39:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 7 Jan 2005 19:39:38 -0000 Received: (qmail 90318 invoked by uid 500); 7 Jan 2005 19:39:33 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 90267 invoked by uid 500); 7 Jan 2005 19:39:32 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 90251 invoked by uid 99); 7 Jan 2005 19:39:32 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.auto-trol.com (HELO is3.auto-trol.com) (143.198.15.20) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 07 Jan 2005 11:39:31 -0800 Received: from endeavor.houdev.auto-trol.com ([143.198.5.23]) by is3.auto-trol.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id CJYVJRLW; Fri, 7 Jan 2005 12:39:29 -0700 Received: by endeavor.houdev.auto-trol.com with Internet Mail Service (5.5.2653.19) id ; Fri, 7 Jan 2005 13:43:45 -0600 Message-ID: <510A660320ABD61183BB00A0247D7C87010A9471@endeavor.houdev.auto-trol.com> From: Jason Wood To: 'Jakarta Commons Users List' Subject: RE: [betwixt] How can I make betwixt accept any attribute "id" as an element id? Date: Fri, 7 Jan 2005 13:43:44 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Well, I know you can do the following to remove the betwixt id ... beanWriter.getBindingConfiguration().setMapIDs(false); Then if you want to make the getId() value of your bean an attribute ... beanWriter.getXMLIntrospector().getConfiguration().setAttributesForPrimitive s(false); or if you don't want to make all primitive values attribute as the above will do ... in a .betwixt file write ... There ways to do this by code but, not familar with that approach. J -----Original Message----- From: Christian Aust [mailto:christian@wilde-welt.de] Sent: Friday, January 07, 2005 1:24 PM To: Jakarta Commons Users List Subject: Re: [betwixt] How can I make betwixt accept any attribute "id" as an element id? Hi Jason, Am 07.01.2005 um 18:10 schrieb Jason Wood: > do you want to make the id your from your bean an attribute or id the > betwixt generated? instead of making up some id value, betwixt should simply stick with the id value that the object already provides. In other words: If a bean property "id" exists, it should be converted into an XML attribute "id" that will be referenced using "idref" if necessary. ====================================================================== public class Member { public long getId() public String getName() public Member getParent() } ====================================================================== member 1: getId() = 1 getName() = "John" getParent() = null member 2: getId() = 10 getName() = "Joe getParent() = ====================================================================== John Joe Any idea how I could do this? Best regards, - Christian > -----Original Message----- > From: Christian Aust [mailto:christian@wilde-welt.de] > Sent: Friday, January 07, 2005 11:00 AM > To: commons-user@jakarta.apache.org > Subject: [betwixt] How can I make betwixt accept any attribute "id" as > an element id? > > > Hi, > > I'd like to use betwixt to serialize data beans to xml. Those beans > represent database structures mapped with hibernate, so all of the > first-rank entities sport some property id, just like this: > > public long getId() > > Those classes implement equals() as such it considers two elements > equal > if their id matches. Unfortunately, while serializing large object > trees > betwixt doesn't see this and assinges new id values to those instances. > > > 17 > > > What do I have to do in order to make betwixt recognize those id > attributes as element ids? Thanks a lot and best regards, > > - Christian Aust > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > -- Christian Aust mailto:christian@wilde-welt.de icq: 84500990 - Yahoo!: datenimperator - MSN: datenimperator PGP: A94E 0181 664D 27E3 F05A A751 6A7E 90D1 A0A3 DEC7 --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org