Injecting Settings into an Entity Object?

110 views
Skip to first unread message

Richard Herbert

unread,
Jun 2, 2010, 7:02:28 AM6/2/10
to ColdBox Platform
Am I missing something but how do you inject a setting into a
persistent (ORM) entity?

I have my setting in Coldbox.cfc as...

settings.mySetting = "I am a setting";

...then in my entity I have this...

property name="mySetting" type="coldbox:setting:mySetting";

...but CF chokes saying...

Error Type: org.hibernate.MappingException : [N/A]
Error Messages: Could not determine type for:
coldbox:setting:mySetting, at table: tblMyTable, for columns:
[org.hibernate.mapping.Column(mySetting)]

...like it trying to map to a db column.

What I have I misunderstood?

Sana

unread,
Jun 2, 2010, 8:14:07 AM6/2/10
to ColdBox Platform
Hi Richard,

The property should be non persistent. So it should be like this
property name="mySetting" type="coldbox:setting:mySetting"
persistent="false";

Thanks

John Whish

unread,
Jun 2, 2010, 8:53:18 AM6/2/10
to col...@googlegroups.com
I might be wrong but I believe the type attribute for ColdBox 3 DI has been deprecated in favour of inject so you would have:

property name="mySetting" inject="coldbox:setting:mySetting" persistent="false";

Richard Herbert

unread,
Jun 2, 2010, 1:22:14 PM6/2/10
to col...@googlegroups.com
Sorry chaps, both...

property name="mySetting" type="coldbox:setting:mySetting"
persistent="false";

...and...

property name="mySetting"
inject="coldbox:setting:mySetting" persistent="false";

...didn't work for me :-(

What scope should the var be posted into? Variables, right?

Well I didn't see it in there but there was an [empty string] variable
called "mySetting" in the properties of the THIS scope???

> --
> You received this message because you are subscribed to the Google Groups
> "ColdBox Platform" group.
> To post to this group, send email to col...@googlegroups.com
> To unsubscribe from this group, send email to
> coldbox-u...@googlegroups.com
> For more options, visit this group at
> http://groups-beta.google.com/group/coldbox
> For News, visit http://blog.coldbox.org
> For Documentation, visit http://wiki.coldbox.org


Luis Majano

unread,
Jun 2, 2010, 5:41:56 PM6/2/10
to col...@googlegroups.com
In order for this to work you MUST use the ORM Event handler. Remember that Coldbox needs to know about your entities and needs the ORM to talk to ColdBox.  So please read the ORM Event Handler guide so you can create the global event handler and activate the entity injector so you can do DI on entities.

Also remember that the DI features are available via the orm event handler via the postLoad() event, so that means that entities created via entityNew() or createObject() will NOT be wired.  You will have to wired them manually for now, we are still investigating on our best approach to deal with new entities either from the orm base services we have or via getModel() or getEntity() methods.  So pleaes be aware of this as coldfusion does NOT offer a method for listenting when new entities are created.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Richard Herbert

unread,
Jun 3, 2010, 6:03:00 PM6/3/10
to col...@googlegroups.com
Sorry Luis, you've left me there.

I have already implemented...

this.ormSettings = eventhandling = "true"
this.ormSettings = eventhandler = "model.ORMEventHandler"

...and have this in my model.ORMEventHandler.cfc...

component extends="coldbox.system.orm.hibernate.EventHandler"{}

I then take it, from what you're saying, that if I use ORMService.new() I
can't make use of postLoad() or any of the other event methods.

So if that is the case how can I access a simple custom setting from within
my entity?

Ciao for now,

Richard

John Whish

unread,
Jun 4, 2010, 4:22:01 AM6/4/10
to col...@googlegroups.com
This is a problem with the way ORM works in CF. When you call EntityNew(), then none of the event handlers fire, so you can't use them for Injection.

What you can do is use a "new" method in your service, which then wires up the object before passing it back. I've just looked at the new method in the system.orm.hibernate.BaseORMService and it's not doing this at the moment. So you'd need to add the autowire, something like:

/**
    * Get a new entity object by entity name and you can pass in any named parameter and the method will try to set it for you.
    */
any function new(required string entityName){
var entity = entityNew(arguments.entityName);
var key    = "";
// iterate over arguments
for( key in arguments ){
// Check if method exists and not entityName
if( key NEQ "entityName" and structKeyExists(entity, "set#key#") ){
evaluate("entity.set#key#( arguments[key] )");
}
}
// do some injection here...
getPlugin("BeanFactory").autowire(entity);
// end of DI
return entity;
}


It does mean that you'll always need to use the service's new() method to get a new entity and not EntityNew() or the new keyword.

I have no idea if that will work, as when I've done it in the past it was using a different framework and Brian Kotek's beanInjector, but it makes sense in my head :)

- John

Sana

unread,
Jun 4, 2010, 5:22:25 AM6/4/10
to ColdBox Platform
Hi Richard,

As John Whish said, EnittyNew() would not call any ORM event handler,
thats why coldbox does not inject the dependencies. I will make some
changes in coldbox.system.orm.hibernate.BaseORMService "new" method
for EntityNew to inject the dependencies.

The work around at the moment is use enityload(name, id which does not
exist), so you will have empty object.

Please let us know if this works for you....?

Thanks
Sana
> On 3 June 2010 23:03, Richard Herbert <rich...@infoweb.co.uk> wrote:
>
>
>
> > Sorry Luis, you've left me there.
>
> > I have already implemented...
>
> > this.ormSettings = eventhandling = "true"
> > this.ormSettings = eventhandler = "model.ORMEventHandler"
>
> > ...and have this in my model.ORMEventHandler.cfc...
>
> > component extends="coldbox.system.orm.hibernate.EventHandler"{}
>
> > I then take it, from what you're saying, that if I use ORMService.new() I
> > can't make use of postLoad() or any of the other event methods.
>
> > So if that is the case how can I access a simple custom setting from within
> > my entity?
>
> > Ciao for now,
>
> > Richard
>
> > > On Wed, Jun 2, 2010 at 10:22 AM, Richard Herbert <rich...@infoweb.co.uk
> > >wrote:
>
> > >> Sorry chaps, both...
>
> > >> property name="mySetting" type="coldbox:setting:mySetting"
> > >> persistent="false";
>
> > >> ...and...
>
> > >> property name="mySetting"
> > >> inject="coldbox:setting:mySetting" persistent="false";
>
> > >> ...didn't work for me :-(
>
> > >> What scope should the var be posted into? Variables, right?
>
> > >> Well I didn't see it in there but there was an [empty string] variable
> > >> called "mySetting" in the properties of the THIS scope???
>
> > >>> From: John Whish <john.wh...@googlemail.com>
> > >>> Reply-To: <col...@googlegroups.com>
> > >>> Date: Wed, 2 Jun 2010 13:53:18 +0100
> > >>> To: <col...@googlegroups.com>
> > >>> Subject: Re: [coldbox:4293] Re: Injecting Settings into an Entity
> > Object?
>
> > >>> I might be wrong but I believe the type attribute for ColdBox 3 DI has
> > >> been
> > >>> deprecated in favour of inject so you would have:
>
> > >>> property name="mySetting"
> > >>> inject="coldbox:setting:mySetting" persistent="false";
>
> > >>> --
> > >>> You received this message because you are subscribed to the Google
> > Groups
> > >>> "ColdBox Platform" group.
> > >>> To post to this group, send email to col...@googlegroups.com
> > >>> To unsubscribe from this group, send email to
> > >>> coldbox-u...@googlegroups.com
> > >>> For more options, visit this group at
> > >>>http://groups-beta.google.com/group/coldbox
> > >>> For News, visithttp://blog.coldbox.org
> > >>> For Documentation, visithttp://wiki.coldbox.org
>
> > >> --
> > >> You received this message because you are subscribed to the Google
> > Groups
> > >> "ColdBox Platform" group.
> > >> To post to this group, send email to col...@googlegroups.com
> > >> To unsubscribe from this group, send email to
> > >> coldbox-u...@googlegroups.com
> > >> For more options, visit this group at
> > >>http://groups-beta.google.com/group/coldbox
> > >> For News, visithttp://blog.coldbox.org
> > >> For Documentation, visithttp://wiki.coldbox.org
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "ColdBox Platform" group.
> > > To post to this group, send email to col...@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > coldbox-u...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups-beta.google.com/group/coldbox
> > > For News, visithttp://blog.coldbox.org
> > > For Documentation, visithttp://wiki.coldbox.org

gratzc

unread,
Jun 4, 2010, 9:19:47 AM6/4/10
to ColdBox Platform
Richard,

You can fire the postLoad() immediately after you do a
ORMService.new()

Something like this.
var eh = new core.model.ORMEventHandler();
oUser=ORMService.new("User");
eh.postLoad(oUser);

Curt Gratz
Computer Know How
ColdBox Alliance Partner

On Jun 3, 5:03 pm, Richard Herbert <rich...@infoweb.co.uk> wrote:
> Sorry Luis, you've left me there.
>
> I have already implemented...
>
> this.ormSettings = eventhandling = "true"
> this.ormSettings = eventhandler = "model.ORMEventHandler"
>
> ...and have this in my model.ORMEventHandler.cfc...
>
> component extends="coldbox.system.orm.hibernate.EventHandler"{}
>
> I then take it, from what you're saying, that if I use ORMService.new() I
> can't make use of postLoad() or any of the other event methods.
>
> So if that is the case how can I access a simple custom setting from within
> my entity?
>
> Ciao for now,
>
> Richard> From: Luis Majano <lmaj...@gmail.com>
> > Reply-To: <col...@googlegroups.com>
> > Date: Wed, 2 Jun 2010 14:41:56 -0700
> > To: <col...@googlegroups.com>
> > Subject: Re: [coldbox:4307] Re: Injecting Settings into an Entity Object?
>
> > In order for this to work you MUST use the ORM Event handler. Remember that
> > Coldbox needs to know about your entities and needs the ORM to talk to
> > ColdBox.  So please read the ORM Event Handler guide so you can create the
> > global event handler and activate the entity injector so you can do DI on
> > entities.
>
> > Also remember that the DI features are available via the orm event handler
> > via the postLoad() event, so that means that entities created via
> > entityNew() or createObject() will NOT be wired.  You will have to wired
> > them manually for now, we are still investigating on our best approach to
> > deal with new entities either from the orm base services we have or via
> > getModel() or getEntity() methods.  So pleaes be aware of this as coldfusion
> > does NOT offer a method for listenting when new entities are created.
>
> > Luis F. Majano
> > President
> > Ortus Solutions, Corp
>
> > ColdBox Platform:http://www.coldbox.org
> > Linked In:http://www.linkedin.com/pub/3/731/483
> > Blog:http://www.luismajano.com
> > IECFUG Manager:http://www.iecfug.com
>
> > On Wed, Jun 2, 2010 at 10:22 AM, Richard Herbert <rich...@infoweb.co.uk>wrote:
>
> >> Sorry chaps, both...
>
> >> property name="mySetting" type="coldbox:setting:mySetting"
> >> persistent="false";
>
> >> ...and...
>
> >> property name="mySetting"
> >> inject="coldbox:setting:mySetting" persistent="false";
>
> >> ...didn't work for me :-(
>
> >> What scope should the var be posted into? Variables, right?
>
> >> Well I didn't see it in there but there was an [empty string] variable
> >> called "mySetting" in the properties of the THIS scope???
>
> >>> From: John Whish <john.wh...@googlemail.com>
> >>> Reply-To: <col...@googlegroups.com>
> >>> Date: Wed, 2 Jun 2010 13:53:18 +0100
> >>> To: <col...@googlegroups.com>
> >>> Subject: Re: [coldbox:4293] Re: Injecting Settings into an Entity Object?
>
> >>> I might be wrong but I believe the type attribute for ColdBox 3 DI has
> >> been
> >>> deprecated in favour of inject so you would have:
>
> >>> property name="mySetting"
> >>> inject="coldbox:setting:mySetting" persistent="false";
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "ColdBox Platform" group.
> >>> To post to this group, send email to col...@googlegroups.com
> >>> To unsubscribe from this group, send email to
> >>> coldbox-u...@googlegroups.com
> >>> For more options, visit this group at
> >>>http://groups-beta.google.com/group/coldbox
> >>> For News, visithttp://blog.coldbox.org
> >>> For Documentation, visithttp://wiki.coldbox.org
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "ColdBox Platform" group.
> >> To post to this group, send email to col...@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> coldbox-u...@googlegroups.com
> >> For more options, visit this group at
> >>http://groups-beta.google.com/group/coldbox
> >> For News, visithttp://blog.coldbox.org
> >> For Documentation, visithttp://wiki.coldbox.org
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "ColdBox Platform" group.
> > To post to this group, send email to col...@googlegroups.com
> > To unsubscribe from this group, send email to
> > coldbox-u...@googlegroups.com
> > For more options, visit this group at
> >http://groups-beta.google.com/group/coldbox

Luis Majano

unread,
Jun 5, 2010, 12:08:06 PM6/5/10
to col...@googlegroups.com
There are several approaches I am thinking at the moment due to this failure of CF to fire an interceptor on entity creation.  one is to treat all entity creations via a service layer that either talks to the base ORM services in coldbox or custom ones.  My approach is to the base ORM service and I see two approaches and need you guys input.

1) Have another property for the service which denotes a flag that all new entity creations via the service layer will be wired via DI in wirebox.

property name="entityAutowire" and it will default to FALSE.

If this property is set to true, then the NEW() methods or NEW() dynamic methods will create and then do DI on the entities.

2) Have another special argument in the New() method: autowire = false, that if passed true it will autowire the entity created.

So what approach makes sense to everybody, I have a preference but I would like to see the opinions of you guys first.





Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com


John Whish

unread,
Jun 6, 2010, 5:54:13 AM6/6/10
to col...@googlegroups.com

Hi Luis, I think I prefer the 2nd approach.

On 5 Jun 2010 17:08, "Luis Majano" <lma...@gmail.com> wrote:

There are several approaches I am thinking at the moment due to this failure of CF to fire an interceptor on entity creation.  one is to treat all entity creations via a service layer that either talks to the base ORM services in coldbox or custom ones.  My approach is to the base ORM service and I see two approaches and need you guys input.

1) Have another property for the service which denotes a flag that all new entity creations via the service layer will be wired via DI in wirebox.

property name="entityAutowire" and it will default to FALSE.

If this property is set to true, then the NEW() methods or NEW() dynamic methods will create and then do DI on the entities.

2) Have another special argument in the New() method: autowire = false, that if passed true it will autowire the entity created.

So what approach makes sense to everybody, I have a preference but I would like to see the opinions of you guys first.






Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org

Linked...

On Fri, Jun 4, 2010 at 6:19 AM, gratzc <gra...@compknowhow.com> wrote:
>
> Richard,
>

> You can fire...

gratzc

unread,
Jun 7, 2010, 1:07:41 PM6/7/10
to ColdBox Platform
I'm with John, I like the 2nd approach.

On Jun 6, 4:54 am, John Whish <john.wh...@googlemail.com> wrote:
> Hi Luis, I think I prefer the 2nd approach.
>

Luis Majano

unread,
Jun 7, 2010, 6:13:36 PM6/7/10
to col...@googlegroups.com
Anymore takers?

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org

John Whish

unread,
Jun 8, 2010, 4:37:35 AM6/8/10
to col...@googlegroups.com
Did we pick the wrong option Luis? :D

Luis Majano

unread,
Jun 8, 2010, 2:17:57 PM6/8/10
to col...@googlegroups.com
No, just more feedback? HEHE?

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com


Luis Majano

unread,
Jun 8, 2010, 8:14:55 PM6/8/10
to col...@googlegroups.com
Ok, I took a different approach.

I created a new interception point whenever new entities are created so it can be more flexible now, so even developers can enhance entities upon creation: ORMPostNew

I then hooked up the autowire interceptor to this new interception point and added a new setting to the interceptor: entityInjection which defaults to false.  You can then from your configuration enable entity injection and choose how the autowire should behave.  

The only requirements is 1) the ORM event handler is enabled 2) YOu use the base services for entity creation, then you create all this goodness.

What's great about the interception point is that it will be hooked to wirebox so later on you can even perform AOP on entities via that interception point.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com


Luis Majano

unread,
Jun 8, 2010, 8:19:23 PM6/8/10
to col...@googlegroups.com
Anyways, retracing my steps, I might re-evaluate some things for consistency as the postLoad() uses the event handlers' annotations for injections.

So now I am divded on whether it should be controlled by the autowire interceptor or the orm event handler.

I am leaning towards letting the autowire interceptor handle all the injections instead of the orm event handler.

Feedback?


Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com


John Whish

unread,
Jun 10, 2010, 4:45:49 AM6/10/10
to col...@googlegroups.com
Hi Luis,

Using the autowire interceptor makes sense to me.

- John

sana ullah

unread,
Jun 10, 2010, 9:12:39 AM6/10/10
to col...@googlegroups.com
Luis,

I think autowire interceptor should handle all the injections instead of ORM event handler.
This way coldbox would be more compatible to Railo-ORM. 

Not sure if Railo would implement CFIDE.......

Thanks
Sana

Luis Majano

unread,
Jun 10, 2010, 3:21:32 PM6/10/10
to col...@googlegroups.com
The only thing is that you need the ORM event handler defined, that is how CF did it and it has to proxy in the requests.  So no way of leaving that one.  But yes, the autowire interceptor will be the controlling object for entity injections via the ORM evnet handler


Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com


Brett

unread,
Jun 16, 2010, 4:42:41 PM6/16/10
to ColdBox Platform
Just wanted to note a third and forth requirement to using enable
entity injection:

3) Set the entityInjection on the Autowire interceptor to true.
4) Set the eventHandling property on the entityService service to
true.

I had to change those settings to enjoy the goodness.

.brett

On Jun 8, 8:14 pm, Luis Majano <lmaj...@gmail.com> wrote:
> Ok, I took a different approach.
>
> I created a new interception point whenever new entities are created so it
> can be more flexible now, so even developers can enhance entities upon
> creation: ORMPostNew
>
> I then hooked up the autowire interceptor to this new interception point and
> added a new setting to the interceptor: entityInjection which defaults to
> false.  You can then from your configuration enable entity injection and
> choose how the autowire should behave.
>
> The only requirements is 1) the ORM event handler is enabled 2) YOu use the
> base services for entity creation, then you create all this goodness.
>
> What's great about the interception point is that it will be hooked to
> wirebox so later on you can even perform AOP on entities via that
> interception point.
>
> Luis F. Majano
> President
> Ortus Solutions, Corp
>
> ColdBox Platform:http://www.coldbox.org
> Linked In:http://www.linkedin.com/pub/3/731/483
> Blog:http://www.luismajano.com
> IECFUG Manager:http://www.iecfug.com
>
> On Tue, Jun 8, 2010 at 11:17 AM, Luis Majano <lmaj...@gmail.com> wrote:
> > No, just more feedback? HEHE?
>
> > Luis F. Majano
> > President
> > Ortus Solutions, Corp
>
> > ColdBox Platform:http://www.coldbox.org
> > Linked In:http://www.linkedin.com/pub/3/731/483
> > Blog:http://www.luismajano.com
> > IECFUG Manager:http://www.iecfug.com
>
> > On Tue, Jun 8, 2010 at 1:37 AM, John Whish <john.wh...@googlemail.com>wrote:
>
> >> Did we pick the wrong option Luis? :D
>
> >>>> For News, visithttp://blog.coldbox.org
> >>>> For Documentation, visithttp://wiki.coldbox.org
>
> >>>  --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "ColdBox Platform" group.
> >>> To post to this group, send email to col...@googlegroups.com
> >>> To unsubscribe from this group, send email to
> >>> coldbox-u...@googlegroups.com
> >>> For more options, visit this group at
> >>>http://groups-beta.google.com/group/coldbox
> >>> For News, visithttp://blog.coldbox.org
> >>> For Documentation, visithttp://wiki.coldbox.org
>
> >>  --
> >> You received this message because you are subscribed to the Google Groups
> >> "ColdBox Platform" group.
> >> To post to this group, send email to col...@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> coldbox-u...@googlegroups.com
> >> For more options, visit this group at
> >>http://groups-beta.google.com/group/coldbox

Luis Majano

unread,
Jun 16, 2010, 7:17:46 PM6/16/10
to col...@googlegroups.com
Should the service enable event handling by default?

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com


Brett

unread,
Jun 16, 2010, 8:51:54 PM6/16/10
to ColdBox Platform
I'm not sure, is there much of a performance hit for turning it on?

I couldn't figure out how to change that setting through the property
annotation, what is the convention for that? Right now I have

property name="itemService" inject="entityService:item"

So I had to set that setting to true somewhere else. Not ideal, but
I'm sure there is a convention that I didn't figure out yet. Is
there?

.brett

On Jun 16, 7:17 pm, Luis Majano <lmaj...@gmail.com> wrote:
> Should the service enable event handling by default?
>
> Luis F. Majano
> President
> Ortus Solutions, Corp
>
> ColdBox Platform:http://www.coldbox.org
> Linked In:http://www.linkedin.com/pub/3/731/483
> Blog:http://www.luismajano.com
> IECFUG Manager:http://www.iecfug.com
>

Luis Majano

unread,
Jun 17, 2010, 12:40:45 AM6/17/10
to col...@googlegroups.com
Don't unde3rstnd brett

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com


Brett

unread,
Jun 17, 2010, 12:52:53 AM6/17/10
to ColdBox Platform
haha, well the entityService init() function takes 4 arguments. When
I wire that to my model using:

property name="itemService" inject="entityService:item"

how do I add the values for the other entityService init arguments in
the annotation.

This is the init function constructor:

VirtualEntityService function init(required string entityname,
string queryCacheRegion,
boolean useQueryCaching,
boolean eventHandling){

On Jun 17, 12:40 am, Luis Majano <lmaj...@gmail.com> wrote:
> Don't unde3rstnd brett
>
> Luis F. Majano
> President
> Ortus Solutions, Corp
>
> ColdBox Platform:http://www.coldbox.org
> Linked In:http://www.linkedin.com/pub/3/731/483
> Blog:http://www.luismajano.com
> IECFUG Manager:http://www.iecfug.com
>

Luis Majano

unread,
Jun 17, 2010, 11:43:23 AM6/17/10
to col...@googlegroups.com
Ah now I get it.  Well, how would you like those to be represented via annotations?

The programmatic config is still in the works, where you will be able to declare those programmatically in configuration, but I would also like to offer this via annotations for faster development.  Ideas?  I have some, but would like to see the community's ideas first.



Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
On Wed, Jun 16, 2010 at 9:52 PM, Brett <webf...@gmail.com> wrote:
item

Richard Herbert

unread,
Dec 15, 2012, 7:02:38 AM12/15/12
to col...@googlegroups.com
Two years on, is there a recommended answer to my original question?

Andrew Scott

unread,
Dec 15, 2012, 9:26:17 AM12/15/12
to col...@googlegroups.com
It depends on whether you expect it be a static injection, and where you're expecting the variable to be coming from.

-- 
Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/

Brad Wood

unread,
Dec 15, 2012, 11:48:08 AM12/15/12
to col...@googlegroups.com
Here's the original thread in case anyone like me was clueless as to what the original question was. :)

https://groups.google.com/forum/?hl=en&fromgroups=#!topic/coldbox/WV5vGkRXgqo

Thanks!

~Brad

Sent from my ASUS Eee Pad


Richard Herbert <ric...@infoweb.co.uk> wrote:

Two years on, is there a recommended answer to my original question?

--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox

Richard Herbert

unread,
Dec 17, 2012, 8:45:30 AM12/17/12
to col...@googlegroups.com
Well my original question was prompted by the need to get a user setting but my current need is for a Coldbox setting. Either way I would consider them static and only gathered on Application load.

Richard Herbert

unread,
Dec 17, 2012, 8:46:44 AM12/17/12
to col...@googlegroups.com
Sorry Brad.

I guess if you only take the email feed rather than browse the Group you don't get the context of any posted replies :-)

Andrew Scott

unread,
Dec 17, 2012, 9:41:59 AM12/17/12
to col...@googlegroups.com
Richard this is well covered in the docs, have you tried

property name="someSetting" inject="coldbox:setting:{setting}";

-- 
Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/


Richard Herbert

unread,
Dec 17, 2012, 1:37:22 PM12/17/12
to col...@googlegroups.com
Yes, that's what I tried two years ago...

property name="applicationRoot" inject="coldbox:fwSetting:ApplicationPath" persistent=false;

It works in a service but not in an entity.

Brad Wood

unread,
Dec 17, 2012, 2:33:22 PM12/17/12
to col...@googlegroups.com
Yeah, one thing that annoys me is the E-mails don't have a link to the web-based thread.  I wonder if there's a setting for that.

~Brad

Andrew Scott

unread,
Dec 17, 2012, 7:50:06 PM12/17/12
to col...@googlegroups.com
Are the Entities situated inside known ColdBox convention paths?

-- 
Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/


Richard Herbert

unread,
Dec 18, 2012, 5:45:35 PM12/18/12
to col...@googlegroups.com
Yes, all the entities are in the location specified by this.ormSettings.cfclocation and the rest of the ORM functionality is working fine.

Andrew Scott

unread,
Dec 18, 2012, 6:26:54 PM12/18/12
to col...@googlegroups.com
Sorry Richard that is not what I asked.

-- 
Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/

--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox

Richard Herbert

unread,
Dec 19, 2012, 12:19:58 PM12/19/12
to col...@googlegroups.com
Sorry, I obviously misunderstood what you asked.

Can you rephrase the question?

Andrew Scott

unread,
Dec 19, 2012, 12:23:51 PM12/19/12
to col...@googlegroups.com
What is the path of the entities?

Does that path use a known ColdBox convention?

For example, by default it is advised to store entities inside the ColdBox convention path model, does that help?

Sana Ullah

unread,
Dec 19, 2012, 12:37:01 PM12/19/12
to col...@googlegroups.com
Hi Richard,

If you are loading entity with like this EntityLoad() then entity would not be autowired ... you have to use VirtualEntityService to load entities for autowire ..... 

Check postLoad event method ... actually it only works with ColdBox virtualentityservice.

Thanks

Andrew Scott

unread,
Dec 19, 2012, 1:48:55 PM12/19/12
to col...@googlegroups.com
Richard,

I just re-read your original question, make sure you use persistent=false on the DI property for any Entity.
Reply all
Reply to author
Forward
0 new messages