public class UnitMeasureController extends JDBCObjectController<UnitMeasure>
UnitMeasure
class. Provides methods for
retrieving and persisting unit of measure table records in the database.Modifier and Type | Field and Description |
---|---|
private static java.util.Hashtable<java.lang.String,UnitMeasure> |
cvCache
The cache of all unit of measure objects per unit of measure code.
|
private static long |
serialVersionUID
The class' serialization version id.
|
ivDBObjCls, ivFieldCount, ivFieldKeyAlt, ivFieldKeyPri, ivFieldResPfx, ivSyncLast, ivSyncType, ivTableName
ivHashCode, ivHashFlds, ivObjAttrs
Constructor and Description |
---|
UnitMeasureController()
The constructor for the controller.
|
Modifier and Type | Method and Description |
---|---|
int |
add(UnitMeasure obj,
boolean logdup)
Adds a new record to the table associated with the controller.
|
boolean |
delete(UnitMeasure obj)
Deletes an existing record from the table associated with the controller.
|
boolean |
deleteAll()
Deletes all records in the table associated with the controller.
|
UnitMeasure |
get(java.lang.String code)
Returns the unit of measure record for the given unit of measure code.
|
java.util.ArrayList<UnitMeasure> |
getAll()
Returns a collection of all records in the table associated with the
controller.
|
UnitMeasure |
getISO(java.lang.String code)
Returns the unit of measure record for the given ISO code.
|
Select |
getUISelect(java.lang.String code)
Returns an HTML
Select object that contains all units of measure and
has the given code as the preselected code in the set of options. |
boolean |
hasUom(java.lang.String code)
Answers if a unit of measure code exists in the unit of measure table.
|
private void |
loadCache()
Loads the cache of units of measure with all units of measure.
|
boolean |
update(UnitMeasure obj)
Updates an existing record in the table associated with the controller.
|
add, add, arrayToMap, arrayToMap, countAll, delete, dispose, equals, getConnection, getConnectionInfo, getController, getFieldNames, getFieldNamesForKey, getFieldNamesForUpdate, getFieldNulls, getFieldNullsForKey, getFieldNullsForUpdate, getFieldsForOrderBy, getFieldsForWhere, getFieldSize, getFieldTypes, getFieldTypesForKey, getFieldTypesForUpdate, getStatementForDelete, getStatementForGet, getStatementForGetAll, getStatementForInsert, getStatementForUpdate, getStatementKey, getStatementString, getTableName, hasFieldNamesForKey, hasFieldNamesForUpdate, isDuplicate, resultSetToArray, resultSetToMap, resultSetToMap, resultSetToObject, setConnectionInfo, setPSDeleteValues, setPSExistsValues, setPSInsertValues, setPSUpdateValues, setPSValue, update, valuesToObject
cloneMapAttributes, formatValue, formatValue, getHashFields, getMapArrayList, getMapAttributes, getMapBigDecimal, getMapBoolean, getMapDate, getMapDouble, getMapInteger, getMapLong, getMapMapped, getMapObject, getMapShort, getMapString, getMapString, getMapStringBuffer, getMapStringBuilder, getMapTime, getMapTimestamp, getMapVector, hashCode, setHashFields, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMapAttributes, setMapObject, setMapTime, setMapTimestamp, toStringArray
private static final long serialVersionUID
private static final java.util.Hashtable<java.lang.String,UnitMeasure> cvCache
public UnitMeasureController()
public int add(UnitMeasure obj, boolean logdup)
add
in JDBCObjectController
.add
in class JDBCObjectController<UnitMeasure>
obj
- (JDBCObject) The object for the record to be added.logdup
- (boolean) true
if duplicate errors are to be
logged as an exception, otherwise false
if not. When
duplicates are logged, the return value of 1 is never returned.public boolean delete(UnitMeasure obj)
delete
in JDBCObjectController
.delete
in class JDBCObjectController<UnitMeasure>
obj
- (JDBCObject) The object for the record to be deleted.true
if the record deleted successfully,
otherwise false
.public boolean deleteAll()
deleteAll
in JDBCObjectController
.deleteAll
in class JDBCObjectController<UnitMeasure>
true
if the deletes are successful,
otherwise false
.public java.util.ArrayList<UnitMeasure> getAll()
getAll
in class JDBCObjectController<UnitMeasure>
public boolean update(UnitMeasure obj)
update
in JDBCObjectController
.update
in class JDBCObjectController<UnitMeasure>
obj
- (JDBCObject) The object for the record to be updated.true
if the record updated successfully,
otherwise false
.public UnitMeasure get(java.lang.String code)
code
- (String) The unit of measure code for the desired record.public UnitMeasure getISO(java.lang.String code)
code
- (String) The ISO code for the desired record.public Select getUISelect(java.lang.String code)
Select
object that contains all units of measure and
has the given code as the preselected code in the set of options. Invokers
must assign a form field name to the returned object via the setName
method before adding the object to the velocity template data.code
- (String) The unit of measure code to preselect in the select's
set of options. Pass an empty string for this parameter if a blank
option is to be created as the first option and then preselected.
Pass a null
for this parameter if no blank option and no
preselecting is desired.Select
object.public boolean hasUom(java.lang.String code)
code
- (String) The unit of measure code to check.true
if the unit of measure code exists,
otherwise false
.private void loadCache()