public class SalesRepCustomerController extends JDBCObjectController<SalesRepCustomer>
SalesRepCustomer
class. Provides methods for
retrieving and persisting sales rep customer x-ref 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 |
---|
SalesRepCustomerController()
The constructor for the controller.
|
Modifier and Type | Method and Description |
---|---|
boolean |
deleteCustomer(Customer customer)
Deletes all sales rep customers from the database for the given customer.
|
boolean |
deleteSalesRep(SalesRep salesrep)
Deletes all sales rep customers from the database for a given sales rep.
|
SalesRepCustomer |
get(java.lang.String repcode,
java.lang.String custid)
Returns the sales rep customer record for the given sales rep code and
customer id.
|
java.util.ArrayList<SalesRepCustomer> |
getMatching(SalesRep rep,
java.lang.String field,
java.lang.String operand,
java.lang.String argument)
Returns a collection of sales rep customer records that have a field that
contains characters matching the given criteria.
|
java.util.ArrayList<SalesRepCustomer> |
getSalesRep(SalesRep rep,
boolean hasUser)
Returns a collection of sales rep customer records for the given sales rep.
|
SalesRepCustomer |
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 SalesRepCustomerController()
public SalesRepCustomer valuesToObject(java.util.HashMap<java.lang.String,java.lang.Object> attrs)
valuesToObject
in JDBCObjectController
.
This method assumes the attributes were obtained using the zcustomer database view.
valuesToObject
in class JDBCObjectController<SalesRepCustomer>
attrs
- (HashMap) The attributes to assign to the new object.public boolean deleteCustomer(Customer customer)
customer
- (Customer) The customer for whom sales rep customers
are to be deleted.true
if the sales rep customers deleted
successfully, otherwise false
.public boolean deleteSalesRep(SalesRep salesrep)
salesrep
- (SalesRep) The sales rep for whom sales rep customers
are to be deleted.true
if the sales rep customers deleted
successfully, otherwise false
.public SalesRepCustomer get(java.lang.String repcode, java.lang.String custid)
repcode
- (String) The sales rep code for the desired record.custid
- (String) The customer id for the desired record.public java.util.ArrayList<SalesRepCustomer> getMatching(SalesRep rep, java.lang.String field, java.lang.String operand, java.lang.String argument)
rep
- (SalesRep) The sales rep for whom sales rep customers are
to be retrieved.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<SalesRepCustomer> getSalesRep(SalesRep rep, boolean hasUser)
rep
- (SalesRep) The sales rep for the desired records.hasUser
- (boolean) true
if only sales rep
customers having at least one matching user are to be returned,
false
if all defined sales rep customers are to be
returned.