public class RecentlyUsed
extends java.lang.Object
Constructor and Description |
---|
RecentlyUsed(java.lang.String sBaseTable,
int iListSize,
java.lang.String sPrimaryKey,
java.lang.String sFilterField)
Open access to a recently used list.
|
Modifier and Type | Method and Description |
---|---|
void |
add(JDCConnection oConn,
DBPersist oItem)
Add item to the list
If list has reached its maximum allowed size then the oldest item is removed before inserting the new one
|
void |
clear(JDCConnection oConn,
java.lang.Object oFilterValue)
Clear recently used list
|
DBSubset |
list(JDCConnection oConn,
java.lang.Object oFilterValue)
Get list items
Items are returned ordered by last use.
|
int |
listSize(JDCConnection oConn,
java.lang.Object oFilterValue)
Current list size
|
public RecentlyUsed(java.lang.String sBaseTable, int iListSize, java.lang.String sPrimaryKey, java.lang.String sFilterField)
Open access to a recently used list.
Example: new RecentlyUsed ("k_companies_recent", 10, "gu_company", "gu_user")
sBaseTable
- Name of database table that holds all instances of list classiListSize
- Maximum items per distinct listsPrimaryKey
- Primary key of the items at each listsFilterField
- Field used for filtering items from an specific listpublic void clear(JDCConnection oConn, java.lang.Object oFilterValue) throws java.sql.SQLException
oConn
- JDBC Database ConnectionoFilterValue
- Value for field used for filtering items from this listjava.sql.SQLException
public int listSize(JDCConnection oConn, java.lang.Object oFilterValue) throws java.sql.SQLException
oConn
- JDBC Database connectionoFilterValue
- Value for field used for filtering items from this listjava.sql.SQLException
public DBSubset list(JDCConnection oConn, java.lang.Object oFilterValue) throws java.sql.SQLException
Get list items
Items are returned ordered by last use. First the most recently used one.oConn
- JDBC Database ConnectionoFilterValue
- Value for field used for filtering items from this listjava.sql.SQLException
public void add(JDCConnection oConn, DBPersist oItem) throws java.sql.SQLException
Add item to the list
If list has reached its maximum allowed size then the oldest item is removed before inserting the new oneoConn
- JDBC Database ConnectionoItem
- DBPersist instance containing all neccessary values for the inserted item except the access date.java.sql.SQLException