public class StateController extends JDBCObjectController<State>
State
class. Provides methods for
retrieving and persisting state and province table records in the database.Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
The class' serialization version id.
|
ivDBObjCls, ivFieldCount, ivFieldKeyAlt, ivFieldKeyPri, ivFieldResPfx, ivSyncLast, ivSyncType, ivTableName
ivHashCode, ivHashFlds, ivObjAttrs
Constructor and Description |
---|
StateController()
The constructor for the controller.
|
Modifier and Type | Method and Description |
---|---|
State |
get(java.lang.String code)
Returns the state record for the given state code.
|
State |
get(java.lang.String code,
java.lang.String cntry)
Returns the state record for the given state code and country code.
|
java.util.ArrayList<State> |
getAll()
Returns a collection of all state records.
|
java.util.ArrayList<State> |
getAll(boolean blanks)
Returns a collection of all state records.
|
java.util.ArrayList<State> |
getCountry(java.lang.String code)
Returns a collection of state records for a given country code.
|
Select |
getUISelect(java.lang.String code,
java.lang.String cntry)
Returns an HTML
Select object that contains all states and has
the given code as the preselected code in the set of options. |
State |
valuesToObject(java.util.HashMap<java.lang.String,java.lang.Object> attrs)
Returns a database object from the given set of attributes.
|
add, add, add, arrayToMap, arrayToMap, countAll, delete, delete, deleteAll, 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, update
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
public State valuesToObject(java.util.HashMap<java.lang.String,java.lang.Object> attrs)
valuesToObject
in JDBCObjectController
.valuesToObject
in class JDBCObjectController<State>
attrs
- (HashMap) The attributes to assign to the new object.public State get(java.lang.String code)
code
- (String) The state code for the desired record.public State get(java.lang.String code, java.lang.String cntry)
code
- (String) The state code for the desired record.cntry
- (String) The country code for the desired record.public java.util.ArrayList<State> getAll()
getAll
in class JDBCObjectController<State>
public java.util.ArrayList<State> getAll(boolean blanks)
blanks
- (boolean) true
to include blank state codes,
otherwise false
.public java.util.ArrayList<State> getCountry(java.lang.String code)
code
- (String) The country code for the desired records.public Select getUISelect(java.lang.String code, java.lang.String cntry)
Select
object that contains all states 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 state 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.cntry
- (String) The country code for the state to preselect. Pass
an empty string for this parameter if a state is not supplied or
if the country is not known.Select
object.