| jspPhoneBook.data.PersonDO
PersonDO | public class PersonDO extends com.lutris.dods.builder.generator.dataobject.GenericDO implements PersonDOI,java.io.Serializable(Code) | | Data core class, used to set and retrieve the PersonDO information.
version: $Revision: 1.1 $ author: EnhydraTeam since: PhoneList |
Field Summary | |
final public static int | COLUMN_FIRSTNAME Use for query caching. | final public static int | COLUMN_LASTNAME Use for query caching. | final public static int | COLUMN_PHONENUMBER Use for query caching. | final public static RDBColumn | FirstName static final RDBColumn FirstName for use with QueryBuilder. | final public static RDBColumn | LastName static final RDBColumn LastName for use with QueryBuilder. | final public static RDBColumn | PhoneNumber static final RDBColumn PhoneNumber for use with QueryBuilder. | final public static RDBColumn | PrimaryKey static final RDBColumn PrimaryKey for use with QueryBuilder. | protected static DataStructCache | cache | protected boolean | deleted | final public static int | firstName_MaxLength | final public static int | lastName_MaxLength | final protected static boolean | notUsingOId | protected String | originDatabase | final public static int | phoneNumber_MaxLength | protected static Statistics | statistics Represents table and cache (if there is caching) statistics. | final public static RDBTable | table Static final data members name the table and columns for this DO. |
Constructor Summary | |
protected | PersonDO(boolean is_view) Protected constructor. | protected | PersonDO(boolean is_view, DBTransaction dbTrans) Protected constructor. | protected | PersonDO() Protected constructor. | protected | PersonDO(DBTransaction dbTrans) Protected constructor. | protected | PersonDO(ObjectId id) Protected constructor used by createExisting(ObjectId) above. | protected | PersonDO(ObjectId id, DBTransaction dbTrans) Protected constructor used by createExisting(ObjectId, DBTransaction) above. | protected | PersonDO(ResultSet rs) Protected constructor. | protected | PersonDO(ResultSet rs, HashMap queryRefs) Protected constructor. | protected | PersonDO(ResultSet rs, HashMap queryRefs, DBTransaction dbTrans) Protected constructor. | protected | PersonDO(ResultSet rs, DBTransaction dbTrans) Protected constructor. |
Method Summary | |
protected void | _setFirstName(String firstName) _setFirstName is a protected method that is called by
setFirstName if firstName is not part of
a multicolumn foreign key. | protected void | _setLastName(String lastName) _setLastName is a protected method that is called by
setLastName if lastName is not part of
a multicolumn foreign key. | protected void | _setPhoneNumber(String phoneNumber) _setPhoneNumber is a protected method that is called by
setPhoneNumber if phoneNumber is not part of
a multicolumn foreign key. | public static synchronized PersonDataStruct | addToCache(PersonDataStruct newDS) Add DataStruct object to cache. | public void | addToCache() Add DO's original data object to cache. | public void | checkDup() | protected void | checkLoad() Load the actual DO data if necessary. | public synchronized Object | cloneUnique() Creates a clone of the object, but ensures that
a new and unique object id is created for the object
and that the version number is set to zero. | public void | commit() Inserts/Updates the DO into its table. | public void | commit(DBTransaction dbt) Inserts/Updates the DO into its table. | public boolean | compareCond(Condition cond) Compares whether this DO satisfies condition cond.
Parameters: cond - condition. | public static PersonDO | createCopy(PersonDataStruct data) Creates a DO that has no ObjectId
but has a copy of an existing DO's data.
Such a DO is used to insert a new database entry
that is largely similar to an existing entry.
Parameters: data - The data struct to copy values from. | public static PersonDO | createCopy(PersonDataStruct data, DBTransaction dbTrans) Creates a DO that has no ObjectId
but has a copy of an existing DO's data. | public static PersonDO | createCopy(PersonDO orig) Creates a DO that has no ObjectId
but has a copy of an existing DO's data.
Such a DO is used to insert a new database entry
that is largely similar to an existing entry.
Parameters: orig - The original DO to copy. | public static PersonDO | createCopy(PersonDO orig, DBTransaction dbTrans) | public static GenericDO | createDO(ObjectId oid) Created DO with specified OID.
Parameters: obj - DO which will be copied. | public static GenericDO | createDO(ObjectId oid, DBTransaction dbTrans) Created DO with specified OID.
Parameters: obj - DO which will be copied. Parameters: dbTrans - The current database transaction. | public static PersonDO | createExisting(BigDecimal bd) createExisting( BigDecimal )
Factory method creates a PersonDO object by searching for it
in the database using the passed BigDecimal value as the primary key.
Creates a DO that represents an existing entry in the database.
Such a DO is used to examine and possibly update such an entry.
createExisting() is called only from the code that retrieves
an ObjectId from a ResultSet (database query result).
createExisting() is protected because no other DO or BO should ever
need to call it.
FIX unfortunately the createExisting(BigDecimal) form *does* need
to be public because it is called by the public ctors of other DOs.
For example:
AaaDO contains a ref to a BbbDO,
so there is a method AaaDO.setBbb(BbbDO).
In the ctor AaaDO(ResultSet), we have the call
setBbb( BbbDO.createExisting( rs.getBigDecimal( "bbb")));
Since AaaDO is not in the same package as BbbDO,
BbbDO.createExisting(BigDecimal) must be public, not protected.
Java needs the C++ 'friend' idea.
Parameters: bd - The BigDecimal representation of the ObjectId for the object. | public static PersonDO | createExisting(BigDecimal bd, DBTransaction dbTrans) createExisting( BigDecimal, DBTransaction )
Parameters: bd - The BigDecimal representation of the ObjectId for the object. Parameters: dbTrans - The current database transaction. | public static PersonDO | createExisting(BigDecimal bd, HashMap queryRefs, DBTransaction dbTrans) createExisting( BigDecimal, HashMap, DBTransaction )
Parameters: bd - The BigDecimal representation of the ObjectId for the object. Parameters: queryRefs - HashMap Created referenced DO's (key datamaseName.Oid) Parameters: dbTrans - The current database transaction. | public static PersonDO | createExisting(String handle) createExisting( String )
The createExisting method is used to create a PersonDO
from a string handle.
Parameters: handle - String representation of the ObjectId for the object. | public static PersonDO | createExisting(String handle, DBTransaction dbTrans) createExisting( String, DBTransaction )
The createExisting method is used to create a PersonDO
from a string handle. | protected static PersonDO | createExisting(ObjectId id, DBTransaction dbTrans) createExisting( ObjectId , DBTransaction)
Factory method creates a PersonDO object by searching for it
in the database using the passed ObjectID value as the primary key.
Parameters: id - The ObjectId for the object. Parameters: dbTrans - The current database transaction. | protected static PersonDO | createExisting(ObjectId id, HashMap queryRefs, DBTransaction dbTrans) createExisting( ObjectId , HashMap queryRefs, DBTransaction)
Factory method creates a PersonDO object by searching for it
in the database using the passed ObjectID value as the primary key.
Parameters: id - The ObjectId for the object. Parameters: queryRefs - HashMap of available references. Parameters: dbTrans - The current database transaction. | protected static PersonDO | createExisting(ObjectId id) createExisting( ObjectId )
Factory method creates a PersonDO object by searching for it
in the database using the passed ObjectID value as the primary key.
Parameters: id - The ObjectId for the object. | protected static PersonDO | createExisting(ResultSet rs) createExisting( ResultSet )
Factory method used to create an instance of this class to
represent a Data Object already existing in the database.
Parameters: rs - The ResultSet returned by the Query class foran existing Data Object stored in the database. | protected static PersonDO | createExisting(ResultSet rs, DBTransaction dbTrans) | protected static PersonDO | createExisting(ResultSet rs, HashMap queryRefs) createExisting( ResultSet , HashMap)
Factory method used to create an instance of this class to
represent a Data Object already existing in the database.
Parameters: rs - The ResultSet returned by the Query class foran existing Data Object stored in the database. Parameters: queryRefs - list of created refernce objects. | protected static PersonDO | createExisting(ResultSet rs, HashMap queryRefs, DBTransaction dbTrans) | protected static PersonDO | createExisting(RDBRow row) createExisting( RDBRow )
Factory method creates a PersonDO object by searching for it
in the database using the PersonDO.PrimaryKey value
in the passed RDBRow.
Parameters: RDBRow - A row returned by QueryBuilder.getNextRow(). | protected static PersonDO | createExisting(RDBRow row, DBTransaction dbTrans) createExisting( RDBRow , DBTransaction)
Factory method creates a PersonDO object by searching for it
in the database using the PersonDO.PrimaryKey value
in the passed RDBRow. | protected static PersonDO | createExisting(RDBColumnValue pk) createExisting( RDBColumnValue )
Factory method creates a PersonDO object by searching for it
in the database using the passed PersonDO.PrimaryKey.
Parameters: RDBColumnValue - a PrimaryKey column value from a rowthat was returned by QueryBuilder.getNextRow(). | protected static PersonDO | createExisting(RDBColumnValue pk, DBTransaction dbTrans) createExisting( RDBColumnValue, DBTransaction )
Factory method creates a PersonDO object by searching for it
in the database using the passed PersonDO.PrimaryKey.
Parameters: RDBColumnValue - a PrimaryKey column value from a rowthat was returned by QueryBuilder.getNextRow(). | public static DBQuery | createQuery() createQuery() creates a new DBQuery. | public static DBQuery | createQuery(DBTransaction trans) createQuery() creates a new DBQuery. | public static DBTransaction | createTransaction() createTransaction() creates a new DBTransaction. | public static PersonDO | createVirgin() createVirgin()
Creates a DO that has no ObjectId or data. | public static PersonDO | createVirgin(DBTransaction dbTrans) | public void | delete() Deletes the DO from its table. | public void | delete(DBTransaction dbt) Deletes the DO from its table. | public static synchronized PersonDataStruct | deleteFromCache(PersonDataStruct data) | public void | deleteFromCache() | public static void | disableCaching() | public void | doCheck(boolean value) Specifies whether to lock this DO (row) in database just before commit. | public void | doLock() Locks this DO in database by performing
"update set version=OLD_ONE where OID=X and version=OLD_ONE". | public void | doTouch() Locks this DO in database by performing
"update set version=OLD_ONE where OID=X and version=INCREMENTED". | public static void | enableCaching() | public void | evict() Remove DataStruct from cache. | public static void | evict(PersonDataStruct[] DSs) Remove DataStruct objects from cache. | public static void | evict(String dbName, String[] handles) Remove DataStruct objects from cache. | public synchronized void | executeInsert(DBConnection conn) Inserts this object into the database. | public void | executeLockingStatement(DBConnection conn) Prepares and executes the statement used to lock this object
in the database. | public void | finalizeDelete(boolean success) Currently does nothing. | public void | finalizeInsert(boolean success) If transaction succeeded marks this object as clean. | public void | finalizeUpdate(boolean success) If transaction succeeded marks this object as clean. | public static PersonDataStruct | findCachedObjectByHandle(String cacheHandle) Get DataStruct object with key cacheHandle from the cache.
Parameters: cacheHandle - String version of concatenation of:name of the data object's database, followed by '.', followed bydata object's id. | public PersonDO | findTransactionCachedObjectByHandle(String cacheHandle) Get data object with key cacheHandle from the cache.
Parameters: cacheHandle - String version of concatenation of:name of the data object's database, followed by '.', followed bydata object's id. | public static String | getCacheDodsTableName() Get name of the table that is cached. | public static ConfigurationAdministration | getConfigurationAdministration() Returns person table cache. | public Object | getData() Returns DO's data. | public PersonDataStruct | getDataStruct() Returns dataStruct. | public PreparedStatement | getDeleteStatement(DBConnection conn) Prepares the statement used to delete this object
from the database. | public String | getFirstName() Get firstName of the person. | public String | getHandle() The methods
getHandle
hasMatchingHandle
findCachedObjectByHandle
are used by Presentation Objects that need to populate
HTML select lists with Data Objects as options.
The getHandle() method is used
to set the value for each option,
and the hasMatchingHandle()
methods are used to lookup the Data Object when the selection has
been made.
exception: DatabaseManagerException - If a connection to the database cannot be established, etc. | public PreparedStatement | getInsertStatement(DBConnection conn) Prepares the statement used to insert this object
into the database.
Parameters: conn - The database connection. | public String | getLastName() Get lastName of the person. | public int | getNewVersion() | public ObjectId | getOId() | public String | getOriginDatabase() Return the name of the logical database for which DO object was created. | public String | getPhoneNumber() Get phoneNumber of the person. | public String | getTableName() Return person as the name of the table in the database
which contains PersonDO objects. | public PreparedStatement | getUpdateStatement(DBConnection conn) Prepares the statement used to update this object
in the database. | public static String[] | getUsedLogicalDatabases() Get all used logical databases. | public int | getVersion() | public String | get_CacheHandle() Returns cache handle. | public Object | get_Data() Returns DO's data. | public PersonDataStruct | get_DataStruct() Returns dataStruct. | public String | get_Handle() The methods
get_Handle
hasMatchingHandle
findCachedObjectByHandle
are used by Presentation Objects that need to populate
HTML select lists with Data Objects as options.
The get_Handle() method is used
to set the value for each option,
and the hasMatchingHandle()
methods are used to lookup the Data Object when the selection has
been made.
exception: DatabaseManagerException - If a connection to the database cannot be established, etc. | public int | get_NewVersion() | public ObjectId | get_OId() Returns this object's identifier. | public String | get_OriginDatabase() Return the name of the logical database for which DO object was created. | public static String[] | get_UsedLogicalDatabases() Get all used logical databases. | public int | get_Version() get_Version makes the protected method public in CoreDO. | public static synchronized String | get_logicalDBName() get_logicalDBName retrieves the logical database name
set by setLogicalDBName(). | public static Statistics | get_statistics() Get table statistics. | public DBTransaction | get_transaction() Return transaction which DO belongs. | public boolean | hasMatchingHandle(String handle) Compare string version of the id of this DO and handle.
Parameters: handle - String version of DO id. | protected static boolean | isAllReadOnly() | protected boolean | isAutoSave() | protected boolean | isAutoSaveCreateVirgin() | protected boolean | isDeleteCheckVersion() | public boolean | isDeleted() | public boolean | isLoaded() isLoaded()
Returns information whether object's data is loaded from database. | public boolean | isReadOnly() Return information whether the data for this object has been marked read-only. | protected boolean | isTransactionCaches() | protected boolean | isTransactionCheck() | public boolean | isVirgin() | public void | loadData() Load the fields for the DO from the database. | protected void | makeIdentical(PersonDO orig) Assigns the DataStruct of an existing DO to this DO.
Does not duplicate data. | public void | makeInvisible() | public void | makeReadOnly() Mark the object as read-only. | public void | makeReadWrite() Mark the object as read-write. | public void | makeVisible() | protected void | modifyDO(DBTransaction dbt, boolean delete) Modifies the DO within its table. | protected void | modifyDO(DBTransaction dbt, boolean delete, boolean references) Modifies the DO within its table. | protected void | okToCommit() A stub method for implementing pre-commit assertions
for this PersonDO. | protected void | okToDelete() A stub method for implementing pre-delete assertions
for this PersonDO. | public Object | originalData_get() Returns original DO's data. | public String | originalData_getFirstName() Get original firstName of the person. | public String | originalData_getLastName() Get original lastName of the person. | public String | originalData_getPhoneNumber() Get original phoneNumber of the person. | public void | originalData_set(Object data) Sets original DO's data. | public static void | readCacheConfiguration(String database) Read cache configuration from application configuration file:
cache size for phoneList.data.person table or default cache size. | public void | refresh() This method is invoked whenever object needs to be loaded from database. | public static void | refresh(PersonDO[] DOs) This method is invoked whenever objects needs to be loaded from database. | public static void | refresh(String querySnt) | public static void | refreshCache() Queries all rows in table, and for each row
creates a DO instance in the cache. | public static void | refreshStatistics() Refresh table statistics. | public void | reload() Causes the DO to refresh itself from the database
the next time a set or get method is called. | public static synchronized void | removeFromCache(String dbName, String handle) Remove DataStruct object from cache. | public static synchronized PersonDataStruct | removeFromCache(PersonDataStruct data) Remove DataStruct from cache.
Parameters: data - DataStruct object which will be removed. | public void | save() Inserts/Updates the DO into its table. | public void | save(boolean references) Inserts/Updates the DO into its table. | public void | save(DBTransaction dbt) Inserts/Updates the DO into its table. | public void | save(DBTransaction dbt, boolean references) Inserts/Updates the DO into its table. | public void | setData(Object data) Sets DO's data. | public void | setDeleted(boolean flag) | public void | setFirstName(String firstName) Set firstName of the person. | public void | setLastName(String lastName) Set lastName of the person. | public static synchronized void | setLogicalDBName(String logicalDbNameInConfFile) setLogicalDBName sets the logical database name that will be used
to create DBTransaction and DBQuery objects used by
PersonDO and the corresponding Query class. | public void | setNewVersion(int _ver) | protected void | setOId(ObjectId _oId) | public void | setPhoneNumber(String phoneNumber) Set phoneNumber of the person. | protected boolean | setTransaction(DBTransaction trans) Set Transaction to current DO. | public void | setVersion(int _ver) | public void | set_Data(Object data) Sets DO's data. | protected void | set_OId(ObjectId _oId) Sets this object's identifier. | public void | set_Version(int _ver) | public String | toString() | public String | toString(int indentCount) | public void | unDelete() UnDeletes the DO and inserts to the table. | public void | unDelete(DBTransaction dbt) UnDeletes the DO and inserts to the table. | public void | undo() | public static synchronized PersonDataStruct | updateCache(PersonDataStruct updDS) | public void | updateCache() |
COLUMN_FIRSTNAME | final public static int COLUMN_FIRSTNAME(Code) | | Use for query caching.
|
COLUMN_LASTNAME | final public static int COLUMN_LASTNAME(Code) | | Use for query caching.
|
COLUMN_PHONENUMBER | final public static int COLUMN_PHONENUMBER(Code) | | Use for query caching.
|
FirstName | final public static RDBColumn FirstName(Code) | | static final RDBColumn FirstName for use with QueryBuilder.
See RDBColumn PrimaryKey at the top of this file for usage example.
|
LastName | final public static RDBColumn LastName(Code) | | static final RDBColumn LastName for use with QueryBuilder.
See RDBColumn PrimaryKey at the top of this file for usage example.
|
PhoneNumber | final public static RDBColumn PhoneNumber(Code) | | static final RDBColumn PhoneNumber for use with QueryBuilder.
See RDBColumn PrimaryKey at the top of this file for usage example.
|
PrimaryKey | final public static RDBColumn PrimaryKey(Code) | | static final RDBColumn PrimaryKey for use with QueryBuilder.
See example above.
|
cache | protected static DataStructCache cache(Code) | | |
deleted | protected boolean deleted(Code) | | |
firstName_MaxLength | final public static int firstName_MaxLength(Code) | | |
lastName_MaxLength | final public static int lastName_MaxLength(Code) | | |
notUsingOId | final protected static boolean notUsingOId(Code) | | |
originDatabase | protected String originDatabase(Code) | | Name of the logical database for which DO object was created
|
phoneNumber_MaxLength | final public static int phoneNumber_MaxLength(Code) | | |
statistics | protected static Statistics statistics(Code) | | Represents table and cache (if there is caching) statistics.
|
table | final public static RDBTable table(Code) | | Static final data members name the table and columns for this DO.
By using these members with an instance of the QueryBuilder class,
an application can perform straight SQL queries while retaining
compile-time checking of table and column usage.
Example: List the Cities containing Persons named Bob:
Using straight SQL with QueryBuilder:
Pro: code runs faster because you create fewer objects
Con: code is less clear
Vector fields = new Vector();
fields.addElement( AddressDO.City );
QueryBuilder qb = new QueryBuilder( fields );
qb.addWhere( PersonDO.FirstName, "Bob" );
qb.addWhere( PersonDO.PrimaryKey, AddressDO.Person );
RDBRow row;
while ( null != ( row = qb.getNextRow() ) ) {
String city = row.get( AddressDO.City ).getString();
}
Using Query/DO classes:
Pro: code is (often) clearer
Con: code runs slower because you create more objects
PersonQuery pq = new PersonQuery();
pq.setQueryFirstName( "Bob" );
PersonDO[] bobs = pq.getDOArray();
for ( int i = 0; i < bobs.length; i++ ) {
AddressQuery aq = new AddressQuery();
aq.setQueryPerson( bobs[i] );
AddressDO addr = aq.getNextDO();
String city = addr.getCity();
}
|
PersonDO | protected PersonDO(boolean is_view) throws ObjectIdException, DatabaseManagerException(Code) | | Protected constructor. Only derived classes should call it.
Parameters: is_view - exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. |
PersonDO | protected PersonDO(boolean is_view, DBTransaction dbTrans) throws ObjectIdException, DatabaseManagerException(Code) | | Protected constructor. Only derived classes should call it.
Parameters: is_view - exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. |
PersonDO | protected PersonDO() throws ObjectIdException, DatabaseManagerException(Code) | | Protected constructor. Only derived classes should call it.
exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. |
PersonDO | protected PersonDO(DBTransaction dbTrans) throws ObjectIdException, DatabaseManagerException(Code) | | Protected constructor. Only derived classes should call it.
Parameters: dbTrans - The current database transaction. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. |
PersonDO | protected PersonDO(ObjectId id) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | Protected constructor used by createExisting(ObjectId) above.
Parameters: id - The ObjectId for the object. exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - Should never see this exception since GenericDO.ctor(ObjectId)never accesses the database. |
PersonDO | protected PersonDO(ObjectId id, DBTransaction dbTrans) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | Protected constructor used by createExisting(ObjectId, DBTransaction) above.
Parameters: id - The ObjectId for the object. Parameters: dbTrans - The current database transaction exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - Should never see this exception since GenericDO.ctor(ObjectId)never accesses the database. |
PersonDO | protected PersonDO(ResultSet rs) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | Protected constructor.
Parameters: rs - Result set from which to obtain product data. exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
PersonDO | protected PersonDO(ResultSet rs, HashMap queryRefs) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | Protected constructor.
Parameters: rs - Result set from which to obtain product data. exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
PersonDO | protected PersonDO(ResultSet rs, HashMap queryRefs, DBTransaction dbTrans) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | Protected constructor.
Parameters: rs - Result set from which to obtain product data. exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
PersonDO | protected PersonDO(ResultSet rs, DBTransaction dbTrans) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | Protected constructor.
Parameters: rs - Result set from which to obtain product data. Parameters: dbTrans - The current database transaction exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
_setFirstName | protected void _setFirstName(String firstName) throws DataObjectException(Code) | | _setFirstName is a protected method that is called by
setFirstName if firstName is not part of
a multicolumn foreign key.
Parameters: firstName - of the person. exception: DataObjectException - If the object is not found in the database. |
_setLastName | protected void _setLastName(String lastName) throws DataObjectException(Code) | | _setLastName is a protected method that is called by
setLastName if lastName is not part of
a multicolumn foreign key.
Parameters: lastName - of the person. exception: DataObjectException - If the object is not found in the database. |
_setPhoneNumber | protected void _setPhoneNumber(String phoneNumber) throws DataObjectException(Code) | | _setPhoneNumber is a protected method that is called by
setPhoneNumber if phoneNumber is not part of
a multicolumn foreign key.
Parameters: phoneNumber - of the person. exception: DataObjectException - If the object is not found in the database. |
addToCache | public static synchronized PersonDataStruct addToCache(PersonDataStruct newDS)(Code) | | Add DataStruct object to cache.
If there is no caching newDO object is returned.
param newDS DataStruct object that will be added to cache.
return DataStruct object added to cache.
|
addToCache | public void addToCache()(Code) | | Add DO's original data object to cache.
|
checkDup | public void checkDup() throws DatabaseManagerException, com.lutris.appserver.server.sql.ObjectIdException(Code) | | |
checkLoad | protected void checkLoad() throws DataObjectException(Code) | | Load the actual DO data if necessary.
Called by get/set methods.
exception: DataObjectException - If a data access error occurs. |
cloneUnique | public synchronized Object cloneUnique() throws DatabaseManagerException, ObjectIdException(Code) | | Creates a clone of the object, but ensures that
a new and unique object id is created for the object
and that the version number is set to zero.
exception: DatabaseManagerException - if an error occurs whileallocation a new object id from the default logical database. exception: ObjectIdException - if a new object id could not beallocated. |
commit | public void commit() throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException(Code) | | Inserts/Updates the DO into its table.
exception: com.lutris.appserver.server.sql.DatabaseManagerException - If a Transaction can not be created. exception: RefAssertionException - Thrown by okTo method. exception: java.sql.SQLException - If any SQL errors occur. |
commit | public void commit(DBTransaction dbt) throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException(Code) | | Inserts/Updates the DO into its table.
The transaction is likely provided by the commit() method of another DO
which references this DO.
Parameters: dbt - The transaction object used for this operation. exception: com.lutris.appserver.server.sql.DatabaseManagerException - If a Transaction can not be created. exception: com.lutris.appserver.server.sql.DBRowUpdateException - If a version error occurs. exception: RefAssertionException - Thrown by okTo method. exception: java.sql.SQLException - If any SQL errors occur. |
compareCond | public boolean compareCond(Condition cond)(Code) | | Compares whether this DO satisfies condition cond.
Parameters: cond - condition. true if DO satisfies condition cond, otherwise false. |
createCopy | public static PersonDO createCopy(PersonDataStruct data) throws DatabaseManagerException, ObjectIdException(Code) | | Creates a DO that has no ObjectId
but has a copy of an existing DO's data.
Such a DO is used to insert a new database entry
that is largely similar to an existing entry.
Parameters: data - The data struct to copy values from. Created PersonDO object. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. |
createCopy | public static PersonDO createCopy(PersonDataStruct data, DBTransaction dbTrans) throws DatabaseManagerException, ObjectIdException(Code) | | Creates a DO that has no ObjectId
but has a copy of an existing DO's data.
Such a DO is used to insert a new database entry
that is largely similar to an existing entry.
Parameters: data - The data struct to copy values from. Parameters: dbTrans - The current database transaction Created PersonDO object. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. |
createCopy | public static PersonDO createCopy(PersonDO orig) throws DatabaseManagerException, ObjectIdException(Code) | | Creates a DO that has no ObjectId
but has a copy of an existing DO's data.
Such a DO is used to insert a new database entry
that is largely similar to an existing entry.
Parameters: orig - The original DO to copy. Created PersonDO object. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. |
createCopy | public static PersonDO createCopy(PersonDO orig, DBTransaction dbTrans) throws DatabaseManagerException, ObjectIdException(Code) | | Parameters: orig - The original DO to copy. Parameters: dbTrans - The current database transaction Created PersonDO object. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. |
createDO | public static GenericDO createDO(ObjectId oid) throws java.sql.SQLException, com.lutris.appserver.server.sql.ObjectIdException, com.lutris.dods.builder.generator.query.DataObjectException, com.lutris.appserver.server.sql.DatabaseManagerException(Code) | | Created DO with specified OID.
Parameters: obj - DO which will be copied. copy of DO (with the same id). |
createDO | public static GenericDO createDO(ObjectId oid, DBTransaction dbTrans) throws java.sql.SQLException, com.lutris.appserver.server.sql.ObjectIdException, com.lutris.dods.builder.generator.query.DataObjectException, com.lutris.appserver.server.sql.DatabaseManagerException(Code) | | Created DO with specified OID.
Parameters: obj - DO which will be copied. Parameters: dbTrans - The current database transaction. copy of DO (with the same id). |
createExisting | public static PersonDO createExisting(BigDecimal bd) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | createExisting( BigDecimal )
Factory method creates a PersonDO object by searching for it
in the database using the passed BigDecimal value as the primary key.
Creates a DO that represents an existing entry in the database.
Such a DO is used to examine and possibly update such an entry.
createExisting() is called only from the code that retrieves
an ObjectId from a ResultSet (database query result).
createExisting() is protected because no other DO or BO should ever
need to call it.
FIX unfortunately the createExisting(BigDecimal) form *does* need
to be public because it is called by the public ctors of other DOs.
For example:
AaaDO contains a ref to a BbbDO,
so there is a method AaaDO.setBbb(BbbDO).
In the ctor AaaDO(ResultSet), we have the call
setBbb( BbbDO.createExisting( rs.getBigDecimal( "bbb")));
Since AaaDO is not in the same package as BbbDO,
BbbDO.createExisting(BigDecimal) must be public, not protected.
Java needs the C++ 'friend' idea.
Parameters: bd - The BigDecimal representation of the ObjectId for the object. Created PersonDO object. exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
createExisting | public static PersonDO createExisting(BigDecimal bd, DBTransaction dbTrans) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | createExisting( BigDecimal, DBTransaction )
Parameters: bd - The BigDecimal representation of the ObjectId for the object. Parameters: dbTrans - The current database transaction. Created PersonDO object. exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
createExisting | public static PersonDO createExisting(BigDecimal bd, HashMap queryRefs, DBTransaction dbTrans) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | createExisting( BigDecimal, HashMap, DBTransaction )
Parameters: bd - The BigDecimal representation of the ObjectId for the object. Parameters: queryRefs - HashMap Created referenced DO's (key datamaseName.Oid) Parameters: dbTrans - The current database transaction. Created PersonDO object. exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
createExisting | public static PersonDO createExisting(String handle)(Code) | | createExisting( String )
The createExisting method is used to create a PersonDO
from a string handle.
Parameters: handle - String representation of the ObjectId for the object. Created PersonDO object. |
createExisting | public static PersonDO createExisting(String handle, DBTransaction dbTrans)(Code) | | createExisting( String, DBTransaction )
The createExisting method is used to create a PersonDO
from a string handle.
Parameters: handle - String representation of the ObjectId for the object. Parameters: dbTrans - The current database transaction Created PersonDO object. |
createExisting | protected static PersonDO createExisting(ObjectId id, DBTransaction dbTrans) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | createExisting( ObjectId , DBTransaction)
Factory method creates a PersonDO object by searching for it
in the database using the passed ObjectID value as the primary key.
Parameters: id - The ObjectId for the object. Parameters: dbTrans - The current database transaction. Created PersonDO object. exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
createExisting | protected static PersonDO createExisting(ObjectId id, HashMap queryRefs, DBTransaction dbTrans) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | createExisting( ObjectId , HashMap queryRefs, DBTransaction)
Factory method creates a PersonDO object by searching for it
in the database using the passed ObjectID value as the primary key.
Parameters: id - The ObjectId for the object. Parameters: queryRefs - HashMap of available references. Parameters: dbTrans - The current database transaction. Created PersonDO object. exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
createExisting | protected static PersonDO createExisting(ObjectId id) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | createExisting( ObjectId )
Factory method creates a PersonDO object by searching for it
in the database using the passed ObjectID value as the primary key.
Parameters: id - The ObjectId for the object. Created PersonDO object. exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
createExisting | protected static PersonDO createExisting(ResultSet rs) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | createExisting( ResultSet )
Factory method used to create an instance of this class to
represent a Data Object already existing in the database.
Parameters: rs - The ResultSet returned by the Query class foran existing Data Object stored in the database. Created PersonDO object. exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
createExisting | protected static PersonDO createExisting(ResultSet rs, DBTransaction dbTrans) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | createExisting( ResultSet, DBTransaction )
Parameters: rs - The ResultSet returned by the Query class foran existing Data Object stored in the database. Parameters: dbTrans - The current database transaction Created PersonDO object. exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
createExisting | protected static PersonDO createExisting(ResultSet rs, HashMap queryRefs) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | createExisting( ResultSet , HashMap)
Factory method used to create an instance of this class to
represent a Data Object already existing in the database.
Parameters: rs - The ResultSet returned by the Query class foran existing Data Object stored in the database. Parameters: queryRefs - list of created refernce objects. Created PersonDO object. exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
createExisting | protected static PersonDO createExisting(ResultSet rs, HashMap queryRefs, DBTransaction dbTrans) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | createExisting( ResultSet , HashMap, DBTransaction)
Parameters: rs - The ResultSet returned by the Query class foran existing Data Object stored in the database. Parameters: queryRefs - list of created refernce objects. Parameters: dbTrans - The current database transaction Created PersonDO object. exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
createExisting | protected static PersonDO createExisting(RDBRow row) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | createExisting( RDBRow )
Factory method creates a PersonDO object by searching for it
in the database using the PersonDO.PrimaryKey value
in the passed RDBRow.
Parameters: RDBRow - A row returned by QueryBuilder.getNextRow(). Created PersonDO object. exception: DataObjectException - If the RDBRow does not contain a PersonDO.PrimaryKey.If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
createExisting | protected static PersonDO createExisting(RDBRow row, DBTransaction dbTrans) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | createExisting( RDBRow , DBTransaction)
Factory method creates a PersonDO object by searching for it
in the database using the PersonDO.PrimaryKey value
in the passed RDBRow.
Parameters: RDBRow - A row returned by QueryBuilder.getNextRow(). Parameters: DBTransaction - The current database transaction Created PersonDO object. exception: DataObjectException - If the RDBRow does not contain a PersonDO.PrimaryKey.If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
createExisting | protected static PersonDO createExisting(RDBColumnValue pk) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | createExisting( RDBColumnValue )
Factory method creates a PersonDO object by searching for it
in the database using the passed PersonDO.PrimaryKey.
Parameters: RDBColumnValue - a PrimaryKey column value from a rowthat was returned by QueryBuilder.getNextRow(). Created PersonDO object. exception: DataObjectException - If the RDBColumnValue does not contain a PersonDO.PrimaryKey.If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
createExisting | protected static PersonDO createExisting(RDBColumnValue pk, DBTransaction dbTrans) throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException(Code) | | createExisting( RDBColumnValue, DBTransaction )
Factory method creates a PersonDO object by searching for it
in the database using the passed PersonDO.PrimaryKey.
Parameters: RDBColumnValue - a PrimaryKey column value from a rowthat was returned by QueryBuilder.getNextRow(). Created PersonDO object. exception: DataObjectException - If the RDBColumnValue does not contain a PersonDO.PrimaryKey.If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
createQuery | public static DBQuery createQuery() throws DatabaseManagerException, SQLException(Code) | | createQuery() creates a new DBQuery.
This method uses the logical database name set by method setLogicalDBName().
If setLogicalDBName() was used to set the logical database name
to something other than the value of DatabaseManager.DefaultDatabase
in the application's .conf file, then any DBQuery object used to
access the 'person' table should be created using
PersonDO.createQuery().
The Query class corresponding to PersonDO uses this method.
A DBQuery object to use in accessing the 'person' table. |
createQuery | public static DBQuery createQuery(DBTransaction trans) throws DatabaseManagerException, SQLException(Code) | | createQuery() creates a new DBQuery.
This method uses the logical database name set by method setLogicalDBName().
If setLogicalDBName() was used to set the logical database name
to something other than the value of DatabaseManager.DefaultDatabase
in the application's .conf file, then any DBQuery object used to
access the 'person' table should be created using
PersonDO.createQuery().
The Query class corresponding to PersonDO uses this method.
A DBQuery object to use in accessing the 'person' table. |
createTransaction | public static DBTransaction createTransaction() throws DatabaseManagerException, SQLException(Code) | | createTransaction() creates a new DBTransaction.
This method uses the logical database name set by method setLogicalDBName().
If setLogicalDBName() was used to set the logical database name
to something other than the value of DatabaseManager.DefaultDatabase
in the application's .conf file, then any DBTransaction passed to
save(DBTransaction) or delete(DBTransaction) should be created using
PersonDO.createTransaction().
The PersonDO save() and delete() methods use this method.
A DBTransaction object to use with the PersonDO class. |
createVirgin | public static PersonDO createVirgin() throws DatabaseManagerException, ObjectIdException(Code) | | createVirgin()
Creates a DO that has no ObjectId or data.
Such a DO is used to insert a new database entry
after its data has been set.
Created data object. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. |
createVirgin | public static PersonDO createVirgin(DBTransaction dbTrans) throws DatabaseManagerException, ObjectIdException(Code) | | createVirgin(DBTransaction)
Parameters: dbTrans - The current database transaction Created data object. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. |
delete | public void delete() throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException(Code) | | Deletes the DO from its table.
exception: com.lutris.appserver.server.sql.DatabaseManagerException - If a Transaction can not be created. exception: RefAssertionException - Thrown by okTo method. exception: java.sql.SQLException - If any SQL errors occur. |
delete | public void delete(DBTransaction dbt) throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException(Code) | | Deletes the DO from its table.
The transaction is likely provided by the delete() method of another DO
which references this DO.
Parameters: dbt - The transaction object used for this operation. exception: com.lutris.appserver.server.sql.DatabaseManagerException - If a Transaction can not be created. exception: com.lutris.appserver.server.sql.DBRowUpdateException - If a version error occurs. exception: RefAssertionException - Thrown by okTo method. exception: java.sql.SQLException - If any SQL errors occur. |
deleteFromCache | public static synchronized PersonDataStruct deleteFromCache(PersonDataStruct data)(Code) | | Delete DataStruct object from cache
Parameters: data - DataStruct object for deleting Deleted DataStruct object |
deleteFromCache | public void deleteFromCache()(Code) | | Delete object from cache
|
disableCaching | public static void disableCaching() throws java.sql.SQLException, DatabaseManagerException, ObjectIdException, DataObjectException(Code) | | Disable caching
|
doCheck | public void doCheck(boolean value)(Code) | | Specifies whether to lock this DO (row) in database just before commit.
Locking is attempted via "dummy" update:
"update set version=OLD_ONE where OID=X and version=OLD_ONE".
Parameters: value - true for locking, false otherwise |
doLock | public void doLock() throws SQLException(Code) | | Locks this DO in database by performing
"update set version=OLD_ONE where OID=X and version=OLD_ONE".
|
doTouch | public void doTouch() throws SQLException, DatabaseManagerException, com.lutris.appserver.server.sql.ObjectIdException, DataObjectException(Code) | | Locks this DO in database by performing
"update set version=OLD_ONE where OID=X and version=INCREMENTED".
|
enableCaching | public static void enableCaching() throws java.sql.SQLException, DatabaseManagerException, ObjectIdException, DataObjectException(Code) | | Enable caching
|
evict | public void evict()(Code) | | Remove DataStruct from cache.
|
evict | public static void evict(PersonDataStruct[] DSs)(Code) | | Remove DataStruct objects from cache.
Parameters: DSs - Array of DataStruct objects which will be removed from cache. |
evict | public static void evict(String dbName, String[] handles)(Code) | | Remove DataStruct objects from cache.
Parameters: dbName - Logical name of the database from whichPersonDataStruct object will be removed. Parameters: handles - array of DataStruct object handles that will be removedfrom cache. |
executeInsert | public synchronized void executeInsert(DBConnection conn) throws SQLException, DBRowUpdateException(Code) | | Inserts this object into the database.
Parameters: conn - the database connection. exception: java.sql.SQLException - if a database access error occurs. exception: DBRowUpdateException - If a version error occurs. |
executeLockingStatement | public void executeLockingStatement(DBConnection conn) throws SQLException(Code) | | Prepares and executes the statement used to lock this object
in the database.
Parameters: conn - The database connection exception: java.sql.SQLException - if an error occurs. |
finalizeDelete | public void finalizeDelete(boolean success)(Code) | | Currently does nothing.
Parameters: success - true if the transaction succeededand this object was successfully deleted from thedatabase. |
finalizeInsert | public void finalizeInsert(boolean success)(Code) | | If transaction succeeded marks this object as clean.
Parameters: success - true if the transaction succeededand this object was successfully inserted into the database. |
finalizeUpdate | public void finalizeUpdate(boolean success)(Code) | | If transaction succeeded marks this object as clean.
Parameters: success - true if the transaction succeededand this object was successfully updated in the database. |
findCachedObjectByHandle | public static PersonDataStruct findCachedObjectByHandle(String cacheHandle)(Code) | | Get DataStruct object with key cacheHandle from the cache.
Parameters: cacheHandle - String version of concatenation of:name of the data object's database, followed by '.', followed bydata object's id. PersonDataStruct Object if one is found in cache, otherwise null. See Also: get_Handle |
findTransactionCachedObjectByHandle | public PersonDO findTransactionCachedObjectByHandle(String cacheHandle)(Code) | | Get data object with key cacheHandle from the cache.
Parameters: cacheHandle - String version of concatenation of:name of the data object's database, followed by '.', followed bydata object's id. PersonDO Object if one is found in cache, otherwise null. See Also: get_Handle |
getCacheDodsTableName | public static String getCacheDodsTableName()(Code) | | Get name of the table that is cached.
Name of the table that is cached. |
getConfigurationAdministration | public static ConfigurationAdministration getConfigurationAdministration()(Code) | | Returns person table cache.
person table cache. |
getDeleteStatement | public PreparedStatement getDeleteStatement(DBConnection conn) throws SQLException(Code) | | Prepares the statement used to delete this object
from the database.
Parameters: conn - The database connection The delete statement. exception: java.sql.SQLException - if an error occurs. |
getFirstName | public String getFirstName() throws DataObjectException(Code) | | Get firstName of the person.
firstName of the person. exception: DataObjectException - If the object is not found in the database. |
getHandle | public String getHandle() throws DatabaseManagerException(Code) | | The methods
getHandle
hasMatchingHandle
findCachedObjectByHandle
are used by Presentation Objects that need to populate
HTML select lists with Data Objects as options.
The getHandle() method is used
to set the value for each option,
and the hasMatchingHandle()
methods are used to lookup the Data Object when the selection has
been made.
exception: DatabaseManagerException - If a connection to the database cannot be established, etc. id of this DO as a stringIf an object's id can't be allocated for this object. |
getInsertStatement | public PreparedStatement getInsertStatement(DBConnection conn) throws SQLException(Code) | | Prepares the statement used to insert this object
into the database.
Parameters: conn - The database connection. The insert statement. exception: java.sql.SQLException - if an error occurs. |
getLastName | public String getLastName() throws DataObjectException(Code) | | Get lastName of the person.
lastName of the person. exception: DataObjectException - If the object is not found in the database. |
getNewVersion | public int getNewVersion()(Code) | | getNewVersion overloaded
Data object's version. |
getOId | public ObjectId getOId()(Code) | | this object's identifier. |
getOriginDatabase | public String getOriginDatabase()(Code) | | Return the name of the logical database for which DO object was created.
origin logical database name. |
getPhoneNumber | public String getPhoneNumber() throws DataObjectException(Code) | | Get phoneNumber of the person.
phoneNumber of the person. exception: DataObjectException - If the object is not found in the database. |
getTableName | public String getTableName()(Code) | | Return person as the name of the table in the database
which contains PersonDO objects.
This method overrides CoreDO.getTableName()
and is used by CoreDO.executeUpdate() during error handling.
The database table name. See Also: CoreDO author: Jay Gunter |
getUpdateStatement | public PreparedStatement getUpdateStatement(DBConnection conn) throws SQLException(Code) | | Prepares the statement used to update this object
in the database.
Parameters: conn - The database connection The update statement. exception: java.sql.SQLException - if an error occurs. |
getUsedLogicalDatabases | public static String[] getUsedLogicalDatabases()(Code) | | Get all used logical databases.
Array that contains names of all used logical databases. |
getVersion | public int getVersion()(Code) | | Data object's version. |
get_CacheHandle | public String get_CacheHandle() throws DatabaseManagerException(Code) | | Returns cache handle.
cache handle. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. |
get_Handle | public String get_Handle() throws DatabaseManagerException(Code) | | The methods
get_Handle
hasMatchingHandle
findCachedObjectByHandle
are used by Presentation Objects that need to populate
HTML select lists with Data Objects as options.
The get_Handle() method is used
to set the value for each option,
and the hasMatchingHandle()
methods are used to lookup the Data Object when the selection has
been made.
exception: DatabaseManagerException - If a connection to the database cannot be established, etc. id of this DO as a stringIf an object's id can't be allocated for this object. |
get_NewVersion | public int get_NewVersion()(Code) | | get_NewVersion overloaded
Data object's version. |
get_OId | public ObjectId get_OId()(Code) | | Returns this object's identifier.
this object's identifier. |
get_OriginDatabase | public String get_OriginDatabase()(Code) | | Return the name of the logical database for which DO object was created.
origin logical database name. |
get_UsedLogicalDatabases | public static String[] get_UsedLogicalDatabases()(Code) | | Get all used logical databases.
Array that contains names of all used logical databases. |
get_Version | public int get_Version()(Code) | | get_Version makes the protected method public in CoreDO.
Data object's version. |
get_logicalDBName | public static synchronized String get_logicalDBName()(Code) | | get_logicalDBName retrieves the logical database name
set by setLogicalDBName().
the logical database name that was set by method setLogicalDBName() |
get_statistics | public static Statistics get_statistics()(Code) | | Get table statistics.
Table statistics. |
get_transaction | public DBTransaction get_transaction()(Code) | | Return transaction which DO belongs.
DBTransaction or null if not specified. |
hasMatchingHandle | public boolean hasMatchingHandle(String handle)(Code) | | Compare string version of the id of this DO and handle.
Parameters: handle - String version of DO id. booleanTrue if the string version of the id of this DO matches passed handle. See Also: get_Handle |
isAllReadOnly | protected static boolean isAllReadOnly()(Code) | | |
isAutoSave | protected boolean isAutoSave()(Code) | | |
isAutoSaveCreateVirgin | protected boolean isAutoSaveCreateVirgin()(Code) | | |
isDeleteCheckVersion | protected boolean isDeleteCheckVersion()(Code) | | |
isDeleted | public boolean isDeleted()(Code) | | true if DO has been deleted, but not commited yet |
isLoaded | public boolean isLoaded()(Code) | | isLoaded()
Returns information whether object's data is loaded from database.
true if the data for this object has been retrievedfrom the database. |
isReadOnly | public boolean isReadOnly()(Code) | | Return information whether the data for this object has been marked read-only.
True if the data for this object has been marked read-only. |
isTransactionCaches | protected boolean isTransactionCaches()(Code) | | |
isTransactionCheck | protected boolean isTransactionCheck()(Code) | | |
isVirgin | public boolean isVirgin()(Code) | | true for DO that's created virgin and hasn't been commited yet. |
loadData | public void loadData() throws SQLException, ObjectIdException, DataObjectException(Code) | | Load the fields for the DO from the database.
exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DataObjectException - If the object is not found in the database. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
makeIdentical | protected void makeIdentical(PersonDO orig)(Code) | | Assigns the DataStruct of an existing DO to this DO.
Does not duplicate data. Just assigns the reference.
Parameters: orig - The original DO. |
makeInvisible | public void makeInvisible()(Code) | | Make DO's data from cache Invisible
|
makeReadOnly | public void makeReadOnly()(Code) | | Mark the object as read-only.
WebDocWf extension
|
makeReadWrite | public void makeReadWrite()(Code) | | Mark the object as read-write.
WebDocWf extension
|
makeVisible | public void makeVisible()(Code) | | Make DO's data from cache visible
|
modifyDO | protected void modifyDO(DBTransaction dbt, boolean delete) throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException(Code) | | Modifies the DO within its table.
Performs recursive commit/delete on referenced DOs;
all operations occur within a single transaction
to allow rollback in the event of error.
Only the creator of the transaction releases it.
Parameters: dbt - The transaction object used for this operation. Parameters: delete - True if doing a delete, otherwise false (for insert/update). exception: com.lutris.appserver.server.sql.DatabaseManagerException - If a Transaction can not be created. exception: com.lutris.appserver.server.sql.DBRowUpdateException - If a version error occurs. exception: RefAssertionException - Thrown by okTo method. exception: java.sql.SQLException - If any SQL errors occur.WebDocWf extension |
modifyDO | protected void modifyDO(DBTransaction dbt, boolean delete, boolean references) throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException(Code) | | Modifies the DO within its table.
Performs recursive commit/delete on referenced DOs;
all operations occur within a single transaction
to allow rollback in the event of error.
Only the creator of the transaction releases it.
Parameters: dbt - The transaction object used for this operation. Parameters: delete - True if doing a delete, otherwise false (for insert/update). Parameters: references - True if references should be saved exception: com.lutris.appserver.server.sql.DatabaseManagerException - If a Transaction can not be created. exception: com.lutris.appserver.server.sql.DBRowUpdateException - If a version error occurs. exception: RefAssertionException - Thrown by okTo method. exception: java.sql.SQLException - If any SQL errors occur.WebDocWf extension |
okToCommit | protected void okToCommit() throws RefAssertionException(Code) | | A stub method for implementing pre-commit assertions
for this PersonDO.
Implement this stub to throw an RefAssertionException for cases
where this object is not valid for writing to the database.
|
okToDelete | protected void okToDelete() throws RefAssertionException(Code) | | A stub method for implementing pre-delete assertions
for this PersonDO.
Implement this stub to throw an RefAssertionException for cases
where this object is not valid for deletion from the database.
|
originalData_get | public Object originalData_get()(Code) | | Returns original DO's data.
|
originalData_getFirstName | public String originalData_getFirstName() throws DataObjectException(Code) | | Get original firstName of the person.
firstName of the person. exception: DataObjectException - If the object is not found in the database. |
originalData_getLastName | public String originalData_getLastName() throws DataObjectException(Code) | | Get original lastName of the person.
lastName of the person. exception: DataObjectException - If the object is not found in the database. |
originalData_getPhoneNumber | public String originalData_getPhoneNumber() throws DataObjectException(Code) | | Get original phoneNumber of the person.
phoneNumber of the person. exception: DataObjectException - If the object is not found in the database. |
originalData_set | public void originalData_set(Object data)(Code) | | Sets original DO's data.
|
readCacheConfiguration | public static void readCacheConfiguration(String database) throws CacheObjectException(Code) | | Read cache configuration from application configuration file:
cache size for phoneList.data.person table or default cache size.
|
refresh | public void refresh() throws DataObjectException(Code) | | This method is invoked whenever object needs to be loaded from database.
exception: DataObjectException - If a data access error occurs. |
refresh | public static void refresh(PersonDO[] DOs) throws DataObjectException(Code) | | This method is invoked whenever objects needs to be loaded from database.
Parameters: DOs - Array of DOs which will be red from database. exception: DataObjectException - If a data access error occurs. |
refresh | public static void refresh(String querySnt) throws QueryException(Code) | | Refresh
exception: QueryException - If a data access error occurs. |
refreshCache | public static void refreshCache() throws java.sql.SQLException, DatabaseManagerException, ObjectIdException, DataObjectException(Code) | | Queries all rows in table, and for each row
creates a DO instance in the cache.
For these DOs, data.readOnly = true,
which causes set methods to throw an exception.
exception: DataObjectException - If the object is not found in the database. exception: com.lutris.appserver.server.sql.ObjectIdException - If an object's id can't be allocated for this object. exception: DatabaseManagerException - If a connection to the database cannot be established, etc. exception: SQLException - If the database rejects the SQL generated to retrieve datafor this object, or if the table contains a bad foreign key, etc. |
refreshStatistics | public static void refreshStatistics()(Code) | | Refresh table statistics.
|
reload | public void reload()(Code) | | Causes the DO to refresh itself from the database
the next time a set or get method is called.
|
removeFromCache | public static synchronized void removeFromCache(String dbName, String handle)(Code) | | Remove DataStruct object from cache.
Parameters: dbName - Logical name of the database from whichPersonDataStruct object will be removed. Parameters: handle - Handle of DataStruct object which will be re moved. |
removeFromCache | public static synchronized PersonDataStruct removeFromCache(PersonDataStruct data)(Code) | | Remove DataStruct from cache.
Parameters: data - DataStruct object which will be removed. Removed DataStruct object or null if DataStruct object doesn'texist in the cache. |
save | public void save() throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException(Code) | | Inserts/Updates the DO into its table.
exception: com.lutris.appserver.server.sql.DatabaseManagerException - If a Transaction can not be created. exception: RefAssertionException - Thrown by okTo method. exception: java.sql.SQLException - If any SQL errors occur.WebDocWf extension |
save | public void save(boolean references) throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException(Code) | | Inserts/Updates the DO into its table.
Parameters: references - True if references should be saved with this DO. exception: com.lutris.appserver.server.sql.DatabaseManagerException - If a Transaction can not be created. exception: RefAssertionException - Thrown by okTo method. exception: java.sql.SQLException - If any SQL errors occur.WebDocWf extension |
save | public void save(DBTransaction dbt) throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException(Code) | | Inserts/Updates the DO into its table.
The transaction is likely provided by the commit() method of another DO
which references this DO.
Parameters: dbt - The transaction object used for this operation. exception: com.lutris.appserver.server.sql.DatabaseManagerException - If a Transaction can not be created. exception: com.lutris.appserver.server.sql.DBRowUpdateException - If a version error occurs. exception: RefAssertionException - Thrown by okTo method. exception: java.sql.SQLException - If any SQL errors occur.WebDocWf extension |
save | public void save(DBTransaction dbt, boolean references) throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException(Code) | | Inserts/Updates the DO into its table.
The transaction is likely provided by the commit() method of another DO
which references this DO.
Parameters: dbt - The transaction object used for this operation. Parameters: references - True if references of this DO should be saved. exception: com.lutris.appserver.server.sql.DatabaseManagerException - If a Transaction can not be created. exception: com.lutris.appserver.server.sql.DBRowUpdateException - If a version error occurs. exception: RefAssertionException - Thrown by okTo method. exception: java.sql.SQLException - If any SQL errors occur.WebDocWf extension |
setData | public void setData(Object data)(Code) | | Sets DO's data.
|
setDeleted | public void setDeleted(boolean flag)(Code) | | Parameters: flag - true if DO has been deleted, but not commited yet |
setFirstName | public void setFirstName(String firstName) throws DataObjectException(Code) | | Set firstName of the person.
Parameters: firstName - of the person. exception: DataObjectException - If the object is not found in the database. |
setLastName | public void setLastName(String lastName) throws DataObjectException(Code) | | Set lastName of the person.
Parameters: lastName - of the person. exception: DataObjectException - If the object is not found in the database. |
setLogicalDBName | public static synchronized void setLogicalDBName(String logicalDbNameInConfFile)(Code) | | setLogicalDBName sets the logical database name that will be used
to create DBTransaction and DBQuery objects used by
PersonDO and the corresponding Query class.
Parameters: logicalDbNameInConfFile - The logical database specified in theapplication's .conf file. |
setNewVersion | public void setNewVersion(int _ver)(Code) | | setNewVersion overloaded
|
setOId | protected void setOId(ObjectId _oId)(Code) | | Parameters: oId - this object's identifier. |
setPhoneNumber | public void setPhoneNumber(String phoneNumber) throws DataObjectException(Code) | | Set phoneNumber of the person.
Parameters: phoneNumber - of the person. exception: DataObjectException - If the object is not found in the database. |
setTransaction | protected boolean setTransaction(DBTransaction trans)(Code) | | Set Transaction to current DO.
DBTransaction. |
setVersion | public void setVersion(int _ver)(Code) | | setVersion overloaded
|
set_Data | public void set_Data(Object data)(Code) | | Sets DO's data.
|
set_OId | protected void set_OId(ObjectId _oId)(Code) | | Sets this object's identifier.
Parameters: oId - this object's identifier. |
set_Version | public void set_Version(int _ver)(Code) | | set_Version overloaded
|
unDelete | public void unDelete() throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException(Code) | | UnDeletes the DO and inserts to the table.
exception: com.lutris.appserver.server.sql.DatabaseManagerException - If a Transaction can not be created. exception: RefAssertionException - Thrown by okTo method. exception: java.sql.SQLException - If any SQL errors occur. |
unDelete | public void unDelete(DBTransaction dbt) throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException(Code) | | UnDeletes the DO and inserts to the table.
Parameters: dbt - The transaction object used for this operation. exception: com.lutris.appserver.server.sql.DatabaseManagerException - If a Transaction can not be created. exception: com.lutris.appserver.server.sql.DBRowUpdateException - If a version error occurs. exception: RefAssertionException - Thrown by okTo method. exception: java.sql.SQLException - If any SQL errors occur. |
undo | public void undo() throws com.lutris.dods.builder.generator.query.DataObjectException(Code) | | |
updateCache | public void updateCache()(Code) | | Update Cache
|
|
|