[flexcoders] Re: How Could I "not" map a property to lcds object ?
Thanks a lot everybody. I'm going to see if it works with Jeff Solution. I'll post when i get conclusive results. Thanks again, you saved me a few days of googling --- In flexcoders@yahoogroups.com, Jeff Vroom wrote: > > You can use the flex.messaging.io.PropertyProxy features. The BeanProxy > class has a way to exclude properties from AMF serialization. You can > either register these statically or wrap an instance. These should be in > the docs. > > We really should have @FlexTransient or something so that can be turned > on/off independently. I think there is an implementation in the BlazeDS bug > base someone contributed I've been meaning to look at. You'd just need to > write some service hook to check for the annotations, register property > proxies to exclude the right properties on whatever class had the annotations > and you'd be all set. > > Jeff > > From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On > Behalf Of Josh McDonald > Sent: Wednesday, April 15, 2009 6:00 PM > To: flexcoders@yahoogroups.com > Subject: Re: [flexcoders] Re: How Could I "not" map a property to lcds object > ? > > > > > > That still requires adding the fields to the Flex object. Marking the field > @Transient in Java will affect Hibernate, unless Blaze / LCDS have their own > @Transient I'm not aware of. There's also this blazeds annotations add-on: > http://is.gd/sETx > > SmartyPants-J will do this, but it's nowhere near escaping yet :) > > -Josh > 2009/4/16 Tim Hoff mailto:timh...@...>> > > > Yep, here's an example: > > private > var _myProperty:String; > > [Transient] > [Bindable( event="myPropertyChange" )] > /** > * myProperty. > * @private > */ > public function get myProperty():String > { > return _myProperty; > } > > /** @private */ > public function set myProperty( value:String ):void > { > _myProperty = value; > dispatchEvent( new Event( "myPropertyChange" ) ); > } > > -TH > > --- In flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>, "Amy" > wrote: > > > > --- In flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>, ouaqa > > ab@ wrote: > > > > > > > > > This is an option but i was wondering if you couldn't use some special > > > "ninja" keyword telling lcds not to map the field to lcds. > > > > Transient? > > > > > > -- > "Therefore, send not to know For whom the bell tolls. It tolls for thee." > > Josh 'G-Funk' McDonald > - j...@...<mailto:j...@...> > - http://twitter.com/sophistifunk > - http://flex.joshmcdonald.info/ >
[flexcoders] Re: How Could I "not" map a property to lcds object ?
This is just the flex vo side. No change to the java transfer object is necessary; for transient fields that live only in the flex app. -TH --- In flexcoders@yahoogroups.com, Josh McDonald wrote: > > That still requires adding the fields to the Flex object. Marking the field > @Transient in Java will affect Hibernate, unless Blaze / LCDS have their own > @Transient I'm not aware of. There's also this blazeds annotations add-on: > http://is.gd/sETx > > SmartyPants-J will do this, but it's nowhere near escaping yet :) > > -Josh > > 2009/4/16 Tim Hoff timh...@... > > > > > > > Yep, here's an example: > > * > > > > private > > * *var* _myProperty:String; > > > > [Transient] > > [*Bindable*( event=*"myPropertyChange"* )] > > /** > > * myProperty. > > * @private > > */ > > *public* *function* *get* myProperty():String > > { > > * return* _myProperty; > > } > > > > /** @private */ > > *public* *function* *set* myProperty( value:String ):*void > > *{ > > _myProperty = value; > > dispatchEvent( *new* Event( *"myPropertyChange"* ) ); > > } > > > > -TH > > > > --- In flexcoders@yahoogroups.com, "Amy" amyblankenship@ wrote: > > > > > > --- In flexcoders@yahoogroups.com, ouaqa ab@ wrote: > > > > > > > > > > > > This is an option but i was wondering if you couldn't use some special > > > > "ninja" keyword telling lcds not to map the field to lcds. > > > > > > Transient? > > > > > > > > > > > -- > "Therefore, send not to know For whom the bell tolls. It tolls for thee." > > Josh 'G-Funk' McDonald > - j...@... > - http://twitter.com/sophistifunk > - http://flex.joshmcdonald.info/ >
RE: [flexcoders] Re: How Could I "not" map a property to lcds object ?
You can use the flex.messaging.io.PropertyProxy features. The BeanProxy class has a way to exclude properties from AMF serialization. You can either register these statically or wrap an instance. These should be in the docs. We really should have @FlexTransient or something so that can be turned on/off independently. I think there is an implementation in the BlazeDS bug base someone contributed I've been meaning to look at. You'd just need to write some service hook to check for the annotations, register property proxies to exclude the right properties on whatever class had the annotations and you'd be all set. Jeff From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Josh McDonald Sent: Wednesday, April 15, 2009 6:00 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: How Could I "not" map a property to lcds object ? That still requires adding the fields to the Flex object. Marking the field @Transient in Java will affect Hibernate, unless Blaze / LCDS have their own @Transient I'm not aware of. There's also this blazeds annotations add-on: http://is.gd/sETx SmartyPants-J will do this, but it's nowhere near escaping yet :) -Josh 2009/4/16 Tim Hoff mailto:timh...@aol.com>> Yep, here's an example: private var _myProperty:String; [Transient] [Bindable( event="myPropertyChange" )] /** * myProperty. * @private */ public function get myProperty():String { return _myProperty; } /** @private */ public function set myProperty( value:String ):void { _myProperty = value; dispatchEvent( new Event( "myPropertyChange" ) ); } -TH --- In flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>, "Amy" wrote: > > --- In flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>, ouaqa > ab@ wrote: > > > > > > This is an option but i was wondering if you couldn't use some special > > "ninja" keyword telling lcds not to map the field to lcds. > > Transient? > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." Josh 'G-Funk' McDonald - j...@joshmcdonald.info<mailto:j...@joshmcdonald.info> - http://twitter.com/sophistifunk - http://flex.joshmcdonald.info/ <><>
Re: [flexcoders] Re: How Could I "not" map a property to lcds object ?
That still requires adding the fields to the Flex object. Marking the field @Transient in Java will affect Hibernate, unless Blaze / LCDS have their own @Transient I'm not aware of. There's also this blazeds annotations add-on: http://is.gd/sETx SmartyPants-J will do this, but it's nowhere near escaping yet :) -Josh 2009/4/16 Tim Hoff > > > Yep, here's an example: > * > > private > * *var* _myProperty:String; > > [Transient] > [*Bindable*( event=*"myPropertyChange"* )] > /** > * myProperty. > * @private > */ > *public* *function* *get* myProperty():String > { > * return* _myProperty; > } > > /** @private */ > *public* *function* *set* myProperty( value:String ):*void > *{ > _myProperty = value; > dispatchEvent( *new* Event( *"myPropertyChange"* ) ); > } > > -TH > > --- In flexcoders@yahoogroups.com, "Amy" wrote: > > > > --- In flexcoders@yahoogroups.com, ouaqa ab@ wrote: > > > > > > > > > This is an option but i was wondering if you couldn't use some special > > > "ninja" keyword telling lcds not to map the field to lcds. > > > > Transient? > > > > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." Josh 'G-Funk' McDonald - j...@joshmcdonald.info - http://twitter.com/sophistifunk - http://flex.joshmcdonald.info/
[flexcoders] Re: How Could I "not" map a property to lcds object ?
Yep, here's an example: private var _myProperty:String; [Transient] [Bindable( event="myPropertyChange" )] /** * myProperty. * @private */ public function get myProperty():String { return _myProperty; } /** @private */ public function set myProperty( value:String ):void { _myProperty = value; dispatchEvent( new Event( "myPropertyChange" ) ); } -TH --- In flexcoders@yahoogroups.com, "Amy" wrote: > > --- In flexcoders@yahoogroups.com, ouaqa ab@ wrote: > > > > > > This is an option but i was wondering if you couldn't use some special > > "ninja" keyword telling lcds not to map the field to lcds. > > Transient? >
[flexcoders] Re: How Could I "not" map a property to lcds object ?
--- In flexcoders@yahoogroups.com, ouaqa wrote: > > > This is an option but i was wondering if you couldn't use some special > "ninja" keyword telling lcds not to map the field to lcds. Transient?
[flexcoders] Re: How Could I "not" map a property to lcds object ?
If it were me, I would leave the java and as objects as they were and create a new class extending the java object. Now you can add all the properties that hibernate wants and send it. --- In flexcoders@yahoogroups.com, ouaqa wrote: > > > I am developping a J2EE/Flex Application and we recently decided to switch to > hibernate to handle our database management strategy. > > The java/as mapping worked real smoothly before. All properties declared in > java objects were also declared in as object. > > When switching to hibernate, i had to add some properties to the java > objects, in order to have all my fields declared in the object. > So now, the java object has more properties than the actionscript object and > therefore, i get a #1056 error when creating the object ("Cannot create > property XXX on object myObject"). > > I do not wish to add these missing properties in actionscript so this is why > I would like to know how to not map a java attribute to it's > actionscript-sided object. > > sorry about my english, frenchy @ work ... > > -- > View this message in context: > http://www.nabble.com/How-Could-I-%22not%22-map-a-property-to-lcds-object---tp23059499p23059499.html > Sent from the FlexCoders mailing list archive at Nabble.com. >