| velosurf.context.Instance velosurf.context.ExternalObjectWrapper
ExternalObjectWrapper | public class ExternalObjectWrapper extends Instance (Code) | | This wrapper allows one to specify custom mapping objects that don't inherit from Instance.
For now, the introspection is rather basic but may work for standard getters without ambiguity.
author: Claude Brisson |
Method Summary | |
public boolean | delete() Tries to delete the row associated with this Instance using a delete() method in the external object. | public Object | get(Object key) Wrapper generic getter. | public Object | getExternal(Object key) External getter. | public boolean | insert() Tries to insert a new row corresponding to this Instance using an insert() method in the external object. | public Object | put(String key, Object value) Wrapper generic setter. | public Object | unwrap() Returns the underlying external object. | public boolean | update() | public boolean | update(Map values) |
classInfo | ClassInfo classInfo(Code) | | Info on the wrapped object class.
|
classInfoMap | static Map<String, ClassInfo> classInfoMap(Code) | | A map of class infos.
|
getterCache | Map getterCache(Code) | | A cache for the wrapped object getter methods.
|
setterCache | Map setterCache(Code) | | A cache for the wrapped object setter methods.
|
ExternalObjectWrapper | public ExternalObjectWrapper(Entity entity, Object object)(Code) | | Builds a new PlaiObjectWrapper.
Parameters: entity - the related entity Parameters: object - target object |
delete | public boolean delete()(Code) | | Tries to delete the row associated with this Instance using a delete() method in the external object.
Velosurf will ensure all key columns are specified, to avoid an accidental massive update.
true if successfull, false if an erroroccurs (in which case $db.error can be checked). |
get | public Object get(Object key)(Code) | | Wrapper generic getter. Tries first to get the property from the wrapped object, and falls back to the superclass
if not found.
Parameters: key - key of the property to be returned a String, an Instance, an AttributeReference or null if not found or if an erroroccurs |
getExternal | public Object getExternal(Object key)(Code) | | External getter. Get a value on the external object
Parameters: key - key of the property to be returned a String, an Instance, an AttributeReference or null if not found or if an erroroccurs |
insert | public boolean insert()(Code) | | Tries to insert a new row corresponding to this Instance using an insert() method in the external object.
true if successfull, false if an erroroccurs (in which case $db.error can be checked). |
put | public Object put(String key, Object value)(Code) | | Wrapper generic setter. Tries first to set the property into the wrapped object, and falls back to the superclass
if not found.
Parameters: key - key of the property to be set Parameters: value - corresponding value previous value, or null |
unwrap | public Object unwrap()(Code) | | Returns the underlying external object.
the external object |
update | public boolean update()(Code) | | Try to update the row associated with this Instance using an update() method
in the external object.
true if successfull, false if an erroroccurs (in which case $db.error can be checked). |
update | public boolean update(Map values)(Code) | | Try to update the row associated with this Instance using an update(map) method
in the external object.
true if successfull, false if an erroroccurs (in which case $db.error can be checked). |
|
|