|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.scaffold.sql.AccessBase
public class AccessBase
Common data access methods.
Field Summary | |
---|---|
static String |
KEYS_INC
Deprecated. [:TODO: Javadoc] |
static String |
KEYS_NEXT
Deprecated. [:TODO: Javadoc] |
Constructor Summary | |
---|---|
AccessBase()
Deprecated. |
Method Summary | |
---|---|
static Integer |
createKey(String keyName)
Deprecated. Returns next sequential key for given set of keys. |
static int |
delete(Object target,
Integer key,
String command)
Deprecated. Mark entry for deletion. |
static void |
executeUpdate(String command)
Deprecated. Lookup command and execute "update" query to create a table, seed it with data, et cetera. |
static Collection |
findByProperty(Object target,
String property,
String value)
Deprecated. Select entries from data storage by indexed property.. |
static Collection |
findCollection(Object target,
String command)
Deprecated. Retrieve a collection of beans from data stoarge. |
static Collection |
findCollection(Object target,
String command,
int parameter)
Deprecated. Retrieve a collection of beans from data stoarge. |
static Collection |
findCollection(Object target,
String command,
Object parameter)
Deprecated. Retrieve a collection of beans from data stoarge. |
static Collection |
findCollection(Object target,
String command,
Object[] parameters)
Deprecated. Retrieve a collection of beans from data stoarge. |
static Collection |
findCollectionLike(Object target,
String command,
String parameter)
Deprecated. Retrieve a collection of beans from data stoarge. |
static boolean |
findElement(Object target,
Object key,
String command)
Deprecated. Retrieve entry from data storage. |
static String |
getCommand(String key)
Deprecated. Retrieve command from commands Properties for
key . |
static void |
init(Properties _commands)
Deprecated. Set the Properties file to be used for SQL commands. |
static int |
restore(Object target,
Integer key,
String command)
Deprecated. Unmark entry for deletion. |
static int |
store(boolean isInsert,
String insert,
String update,
Object[] parameters)
Deprecated. Commit record to storage. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String KEYS_NEXT
public static String KEYS_INC
Constructor Detail |
---|
public AccessBase()
Method Detail |
---|
public static final String getCommand(String key) throws PropertiesException
commands
Properties for
key
.
PropertiesException
public static final void init(Properties _commands)
public static final void executeUpdate(String command) throws ResourceException
command
- Name of command to execute
Resource
- exception if data access error occurs
ResourceException
public static final Integer createKey(String keyName) throws ResourceException
keyName
- The name of the key set to use to generate the key
ResourceException
- if data access error occurspublic static boolean findElement(Object target, Object key, String command) throws ResourceException
NOTE that the key and command parameters to this utility should have been swapped for consistency with other methods in this package. But since this class is deprecated, a fix has not been made.
key
- The primary key of the entrytarget
- Bean to hold copy of entry being retrievedcommand
- The name of the data access command
collection
ResourceException
- if SQL error occurspublic static final Collection findCollection(Object target, String command) throws ResourceException
target
- Object to use as factory when populatingcommand
- Name of the data access command
collection
throws
- PropertiesException, ResourceException
if data access error occurs
ResourceException
public static final Collection findCollection(Object target, String command, Object[] parameters) throws ResourceException
target
- Object to use as factory when populatingcommand
- Name of the data access command
collectionparameters
- An array of parameters to be used with command
throws
- PropertiesException, ResourceException
if data access error occurs
ResourceException
public static final Collection findCollection(Object target, String command, Object parameter) throws ResourceException
target
- Object to use as factory when populatingcommand
- Name of the data access command
collectionparameter
- A String parameter to be used with command
throws
- PropertiesException, ResourceException
if data access error occurs
ResourceException
public static final Collection findCollection(Object target, String command, int parameter) throws ResourceException
target
- Object to use as factory when populatingcommand
- Name of the data access command
collectionparameter
- An int parameter to be used with command
throws
- PropertiesException, ResourceException
if data access error occurs
ResourceException
public static final Collection findCollectionLike(Object target, String command, String parameter) throws ResourceException
target
- Object to use as factory when populatingcommand
- Name of the data access command
collectionparameter
- A String parameter to be used with command
throws
- PropertiesException, ResourceException
if data access error occurs
ResourceException
public static final Collection findByProperty(Object target, String property, String value) throws ParameterException, PopulateException, ResourceException
value
- Term to matchproperty
- Field to searchtarget
- Object to use as factory when populating
collection
Throws
- ParameterException if value is not a search
term for property
Throws
- PopulateExecption if result cannot be set to
target
throws
- PropertiesException, ResourceException is SQL, IO, or other
data access error occurs.
ParameterException
PopulateException
ResourceException
public static final int store(boolean isInsert, String insert, String update, Object[] parameters) throws ResourceException
insert
- True to insert, false to update.
ResourceException
- if SQL error occurspublic static final int delete(Object target, Integer key, String command) throws ResourceException
target
- Bean to hold copy of record being markedarticle
- Primary key of record to mark
ResourceException
- if SQL or other data-access error occurs
runtime
- Null Pointer Exception if either parameter is nullpublic static final int restore(Object target, Integer key, String command) throws ResourceException
target
- Bean to hold copy of record being unmarkedarticle
- Primary key of record to unmark
ResourceException
- if data access error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |