| java.lang.Object org.jaffa.persistence.engines.jdbcengine.util.MoldingService
MoldingService | public class MoldingService (Code) | | The MoldingService uses reflection to create/update persistent objects using ClassMetaData defintions.
This can also set the initial state of a persistent object from the ResultSet.
|
Method Summary | |
public static Object | getInstanceValue(IPersistent object, ClassMetaData classMetaData, String attributeName) This gets the value of the attributeName from the Persistent object, using the accessor method cached in the ClassMetaData defintion.
Parameters: object - The Persistent object. Parameters: classMetaData - The ClassMetaData definition for the Persistent object. Parameters: attributeName - The attribute whose value will be returned. throws: IllegalAccessException - if the accessor Method object enforces Java language access control and the underlying method is inaccessible. throws: InvocationTargetException - if the accessor method throws an exception. | public static IPersistent | getObject(ClassMetaData classMetaData) Creates an instance of the persistent class, as defined in the input ClassMetaData defintion.
Parameters: classMetaData - The ClassMetaData object, whose corresponding persistent class is to be instantiated. throws: ClassNotFoundException - if the Persistent class is not found. throws: InstantiationException - if this Class represents an abstract class, an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason. throws: IllegalAccessException - if the class or its nullary constructor is not accessible. | public static IPersistent | getObject(ClassMetaData classMetaData, ResultSet rs, String engineType) Creates an instance of the persistent class, as defined in the input ClassMetaData defintion.
It will set the attributes using the values from the ResultSet.
Parameters: classMetaData - The ClassMetaData object, whose corresponding persistent class is to be instantiated. Parameters: rs - The ResultSet used for creating the initial state of the persistent object. Parameters: engineType - The engine type as defined in init.xml throws: ClassNotFoundException - if the Persistent class is not found. throws: InstantiationException - if this Class represents an abstract class, an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason. throws: IllegalAccessException - if the class or its nullary constructor is not accessible. throws: InvocationTargetException - if the mutator method throws an exception. throws: SQLException - if a database access error occurs. throws: IOException - if any error occurs in reading the data from the database. | public static void | setInstanceValue(IPersistent object, ClassMetaData classMetaData, String attributeName, Object value) This sets the value of the attribute from the Persistent object, using the mutator method cached in the ClassMetaData defintion. |
getInstanceValue | public static Object getInstanceValue(IPersistent object, ClassMetaData classMetaData, String attributeName) throws IllegalAccessException, InvocationTargetException(Code) | | This gets the value of the attributeName from the Persistent object, using the accessor method cached in the ClassMetaData defintion.
Parameters: object - The Persistent object. Parameters: classMetaData - The ClassMetaData definition for the Persistent object. Parameters: attributeName - The attribute whose value will be returned. throws: IllegalAccessException - if the accessor Method object enforces Java language access control and the underlying method is inaccessible. throws: InvocationTargetException - if the accessor method throws an exception. the value of the attribute. |
getObject | public static IPersistent getObject(ClassMetaData classMetaData) throws ClassNotFoundException, InstantiationException, IllegalAccessException(Code) | | Creates an instance of the persistent class, as defined in the input ClassMetaData defintion.
Parameters: classMetaData - The ClassMetaData object, whose corresponding persistent class is to be instantiated. throws: ClassNotFoundException - if the Persistent class is not found. throws: InstantiationException - if this Class represents an abstract class, an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason. throws: IllegalAccessException - if the class or its nullary constructor is not accessible. an instance of the Persistent class, defined in the ClassMetaData defintion. |
getObject | public static IPersistent getObject(ClassMetaData classMetaData, ResultSet rs, String engineType) throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, SQLException, IOException(Code) | | Creates an instance of the persistent class, as defined in the input ClassMetaData defintion.
It will set the attributes using the values from the ResultSet.
Parameters: classMetaData - The ClassMetaData object, whose corresponding persistent class is to be instantiated. Parameters: rs - The ResultSet used for creating the initial state of the persistent object. Parameters: engineType - The engine type as defined in init.xml throws: ClassNotFoundException - if the Persistent class is not found. throws: InstantiationException - if this Class represents an abstract class, an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason. throws: IllegalAccessException - if the class or its nullary constructor is not accessible. throws: InvocationTargetException - if the mutator method throws an exception. throws: SQLException - if a database access error occurs. throws: IOException - if any error occurs in reading the data from the database. an instance of the Persistent class, defined in the ClassMetaData defintion. |
setInstanceValue | public static void setInstanceValue(IPersistent object, ClassMetaData classMetaData, String attributeName, Object value) throws IllegalAccessException, InvocationTargetException(Code) | | This sets the value of the attribute from the Persistent object, using the mutator method cached in the ClassMetaData defintion.
Parameters: object - The Persistent object. Parameters: classMetaData - The ClassMetaData definition for the Persistent object. Parameters: attributeName - The attribute whose value will be set. Parameters: value - The value to be set. throws: IllegalAccessException - if the mutator Method object enforces Java language access control and the underlying method is inaccessible. throws: InvocationTargetException - if the mutator method throws an exception. |
|
|