public class DBRecordListModel<C extends ApplicationContext> extends ZListModel implements ApplicationObject<C>
DBRecord
s. It provides methods for record
manipulation like INSERT, UPDATE and DELETE. Those actions are in fact
forwarded to the current Database
instance, which may be a local or remote database.
Note that his class is intentionally NOT generic, because it may contain a mixture of
different sub-types of DBRecord
.Constructor and Description |
---|
DBRecordListModel(C ctx,
DBRecord master) |
DBRecordListModel(C ctx,
DBRecord[] masters) |
Modifier and Type | Method and Description |
---|---|
int |
addRecord(DBRecord newRecord) |
C |
getApplicationContext() |
DBRecord |
getMasterRecord()
Returns the first record of the master records.
|
DBRecord[] |
getMasterRecords() |
int |
indexOf(DBRecord record)
Finds the index of the DBRecord stored in column 0 of the TableModel.
|
int |
indexOf(java.lang.String recordId)
Finds the index of the DBRecord which has the given primary key value.
|
void |
load()
This method loads all Records of the instantiation type available in the database
|
void |
load(SqlCondition condition) |
void |
load(SqlCondition condition,
SqlOrder order) |
int |
removeRecord(DBRecord record) |
boolean |
replaceRecord(DBRecord record) |
addItem, addItem, addItems, addItems, clear, fireContentsChanged, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getAllItems, getComparator, getElementAt, getFirstItem, getItem, getItem, getItemCount, getLastItem, getModifyFlag, isModified, isNumb, isSortAscending, loadFrom, loadFrom, removeItem, removeItem, replaceItem, replaceOrAddItem, setComparator, setItem, setModified, setModifyFlag, setNumb, setSortAscending
add, addElement, capacity, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, get, getSize, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, removeAllElements, removeElement, removeElementAt, removeRange, set, setElementAt, setSize, size, toArray, toString, trimToSize
public final C getApplicationContext()
getApplicationContext
in interface ApplicationObject<C extends ApplicationContext>
public DBRecord[] getMasterRecords()
public DBRecord getMasterRecord()
getMasterRecords()
public int removeRecord(DBRecord record)
public boolean replaceRecord(DBRecord record)
public int indexOf(DBRecord record)
public int indexOf(java.lang.String recordId)
public void load() throws java.lang.Exception
load
in class ZListModel
java.lang.Exception
public void load(SqlCondition condition) throws java.lang.Exception
java.lang.Exception
public void load(SqlCondition condition, SqlOrder order) throws java.lang.Exception
java.lang.Exception
public int addRecord(DBRecord newRecord)
Copyright © 2014 EsprIT-Systems. All Rights Reserved.