public class CustomerController extends JDBCObjectController<Customer>
Customer
class. Provides methods for
retrieving and persisting customer 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 |
---|
CustomerController()
The constructor for the controller.
|
Modifier and Type | Method and Description |
---|---|
Customer |
get(java.lang.String id)
Returns the customer record for the given customer id.
|
java.lang.Object[] |
getAllAsRS()
Returns a result set of all customer records.
|
java.util.ArrayList<Customer> |
getBillTos(java.lang.String id)
Returns a collection of customer records having a bill-to customer id
equal to the given customer id.
|
java.util.ArrayList<Customer> |
getMatching(java.lang.String field,
java.lang.String operand,
java.lang.String argument)
Returns a collection of customer records that have a field that contains
characters matching the given criteria.
|
java.util.ArrayList<Customer> |
getShipFors(java.lang.String id)
Returns a collection of customer records having a ship for customer id
equal to the given customer id.
|
boolean |
hasCountry(java.lang.String code)
Answers if a given country code exists in the customer table.
|
boolean |
hasState(java.lang.String state,
java.lang.String country)
Answers if a given state code exists in the customer table.
|
boolean |
hasUser(Customer customer)
Answers if a given customer has at least one user associated with it.
|
Customer |
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, getAll, 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 CustomerController()
public Customer valuesToObject(java.util.HashMap<java.lang.String,java.lang.Object> attrs)
valuesToObject
in JDBCObjectController
.
This method assumes the attributes were obtained from the zcustomer database view.
valuesToObject
in class JDBCObjectController<Customer>
attrs
- (HashMap) The attributes to assign to the new object.public Customer get(java.lang.String id)
id
- (String) The customer id for the desired record.public java.lang.Object[] getAllAsRS()
The invoker of this method is responsible for closing the returned result set and prepared statement.
public java.util.ArrayList<Customer> getBillTos(java.lang.String id)
id
- (String) The customer id for the bill-to customers to retrieve.public java.util.ArrayList<Customer> getMatching(java.lang.String field, java.lang.String operand, java.lang.String argument)
field
- (String) The field that is to be involved in determining
the query results. This value is appended to the end of the
sql properties key when obtaining the appropriate sql statement
for the requested query.operand
- (String) The operation that the query is to perform
on the given field in order to determine the query results.
Currently only "contains" and "equals" are supported.argument
- (String) The query search argument. The character
string that the query is to use in determining its results.public java.util.ArrayList<Customer> getShipFors(java.lang.String id)
id
- (String) The ship for id for the customers to retrieve.public boolean hasCountry(java.lang.String code)
code
- (String) The country code to check.true
if the country code exists, otherwise
false
.public boolean hasState(java.lang.String state, java.lang.String country)
state
- (String) The state code to check.country
- (String) The country code to check.true
if the state code exists, otherwise
false
.public boolean hasUser(Customer customer)
customer
- (Customer) The customer to check.true
if one or more users exists for the
customer, otherwise false
.