railo-context.Componentcoldbox.system.core.dynamic.BeanPopulator
This is a bean populator that binds different types of data to a bean.
Constructor Summary | |
---|---|
init()
Constructor. |
Method Summary | |
---|---|
private struct
|
getRelationshipMetaData(any target)
Prepares a structure of target relational meta data. |
private Util
|
getUtil()
Create and return a util object. |
any
|
populateFromJSON(any target, string JSONString, [string scope=''], [boolean trustedSetter='false'], [string include=''], [string exclude=''], [boolean ignoreEmpty='false'], [string nullEmptyInclude=''], [string nullEmptyExclude=''], [boolean composeRelationships='false'])
Populate a named or instantiated bean from a json string. |
any
|
populateFromQuery(any target, query qry, [Numeric rowNumber='1'], [string scope=''], [boolean trustedSetter='false'], [string include=''], [string exclude=''], [boolean ignoreEmpty='false'], [string nullEmptyInclude=''], [string nullEmptyExclude=''], [boolean composeRelationships='false'])
Populate a named or instantiated bean from query. |
any
|
populateFromQueryWithPrefix(any target, query qry, [Numeric rowNumber='1'], [string scope=''], [boolean trustedSetter='false'], [string include=''], [string exclude=''], string prefix, [boolean ignoreEmpty='false'], [string nullEmptyInclude=''], [string nullEmptyExclude=''], [boolean composeRelationships='false'])
Populates an Object using only specific columns from a query. |
any
|
populateFromStruct(any target, struct memento, [string scope], [boolean trustedSetter='false'], [string include=''], [string exclude=''], [boolean ignoreEmpty='false'], [string nullEmptyInclude=''], [string nullEmptyExclude=''], [boolean composeRelationships='false'])
Populate a named or instantiated bean from a structure. |
any
|
populateFromStructWithPrefix(any target, struct memento, [string scope], [boolean trustedSetter='false'], [string include=''], [string exclude=''], [boolean ignoreEmpty='false'], [string nullEmptyInclude=''], [string nullEmptyExclude=''], [boolean composeRelationships='false'], string prefix)
Populate a named or instantiated bean from a structure. |
any
|
populateFromXML(any target, any xml, [string root=''], [string scope=''], [boolean trustedSetter='false'], [string include=''], [string exclude=''], [boolean ignoreEmpty='false'], [string nullEmptyInclude=''], [string nullEmptyExclude=''], [boolean composeRelationships='false'])
Populate a named or instantiated bean from an XML packet. |
Methods inherited from class railo-context.Component |
---|
None |
Constructor Detail |
---|
Constructor
Method Detail |
---|
Prepares a structure of target relational meta data
target
Create and return a util object
Populate a named or instantiated bean from a json string
target
- The target to populateJSONString
- The JSON string to populate the object with. It has to be valid JSON and also a structure with name-key value pairs. scope
- Use scope injection instead of setters population. Ex: scope=variables.instance.trustedSetter
- If set to true, the setter method will be called even if it does not exist in the beaninclude
- A list of keys to include in the populationexclude
- A list of keys to exclude in the populationignoreEmpty
- Ignore empty values on populations, great for ORM populationnullEmptyInclude
- A list of keys to NULL when emptynullEmptyExclude
- A list of keys to NOT NULL when emptycomposeRelationships
- Automatically attempt to compose relationships from mementoPopulate a named or instantiated bean from query
target
- The target to populateqry
- The query to popluate the bean object withrowNumber
- The query row number to use for populationscope
- Use scope injection instead of setters population. Ex: scope=variables.instance.trustedSetter
- If set to true, the setter method will be called even if it does not exist in the beaninclude
- A list of keys to include in the populationexclude
- A list of keys to exclude in the populationignoreEmpty
- Ignore empty values on populations, great for ORM populationnullEmptyInclude
- A list of keys to NULL when emptynullEmptyExclude
- A list of keys to NOT NULL when emptycomposeRelationships
- Automatically attempt to compose relationships from mementoPopulates an Object using only specific columns from a query. Useful for performing a query with joins that needs to populate multiple objects.
target
- This can be an instantiated bean object or a bean instantitation path as a string. If you pass an instantiation path and the bean has an 'init' method. It will be executed. This method follows the bean contract (set{property_name}). Example: setUsername(), setfname()qry
- The query to popluate the bean object withrowNumber
- The query row number to use for populationscope
- Use scope injection instead of setters population. Ex: scope=variables.instance.trustedSetter
- If set to true, the setter method will be called even if it does not exist in the beaninclude
- A list of keys to include in the populationexclude
- A list of keys to exclude in the populationprefix
- The prefix used to filter, Example: 'user_' would apply to the following columns: 'user_id' and 'user_name' but not 'address_id'.ignoreEmpty
- Ignore empty values on populations, great for ORM populationnullEmptyInclude
- A list of keys to NULL when emptynullEmptyExclude
- A list of keys to NOT NULL when emptycomposeRelationships
- Automatically attempt to compose relationships from mementoPopulate a named or instantiated bean from a structure
target
- The target to populatememento
- The structure to populate the object with.scope
- Use scope injection instead of setters population.trustedSetter
- If set to true, the setter method will be called even if it does not exist in the beaninclude
- A list of keys to include in the populationexclude
- A list of keys to exclude in the populationignoreEmpty
- Ignore empty values on populations, great for ORM populationnullEmptyInclude
- A list of keys to NULL when emptynullEmptyExclude
- A list of keys to NOT NULL when emptycomposeRelationships
- Automatically attempt to compose relationships from mementoPopulate a named or instantiated bean from a structure
target
- The target to populatememento
- The structure to populate the object with.scope
- Use scope injection instead of setters population.trustedSetter
- If set to true, the setter method will be called even if it does not exist in the beaninclude
- A list of keys to include in the populationexclude
- A list of keys to exclude in the populationignoreEmpty
- Ignore empty values on populations, great for ORM populationnullEmptyInclude
- A list of keys to NULL when emptynullEmptyExclude
- A list of keys to NOT NULL when emptycomposeRelationships
- Automatically attempt to compose relationships from mementoprefix
- The prefix used to filter, Example: 'user' would apply to the following formfield: 'user_id' and 'user_name' but not 'address_id'.Populate a named or instantiated bean from an XML packet
target
- The target to populatexml
- The XML string or packetroot
- The XML root element to start fromscope
- Use scope injection instead of setters population. Ex: scope=variables.instance.trustedSetter
- If set to true, the setter method will be called even if it does not exist in the beaninclude
- A list of keys to include in the populationexclude
- A list of keys to exclude in the populationignoreEmpty
- Ignore empty values on populations, great for ORM populationnullEmptyInclude
- A list of keys to NULL when emptynullEmptyExclude
- A list of keys to NOT NULL when emptycomposeRelationships
- Automatically attempt to compose relationships from memento