|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dasein.persist.PersistentCache<T>
org.dasein.persist.RelationalHSCache<T>
T - public final class RelationalHSCache<T extends org.dasein.util.CachedItem>
A relational AND HandlerSocket cache. Only use this if you are running Percona MySQL!.
TODO:
| Nested Class Summary | |
|---|---|
static class |
RelationalHSCache.OrderedColumn
|
| Nested classes/interfaces inherited from class org.dasein.persist.PersistentCache |
|---|
PersistentCache.EntityJoin |
| Field Summary | |
|---|---|
static org.apache.log4j.Logger |
logger
|
| Constructor Summary | |
|---|---|
RelationalHSCache()
|
|
| Method Summary | |
|---|---|
long |
count()
Counts the total number of objects governed by this factory in the database. |
long |
count(SearchTerm... terms)
|
T |
create(Transaction xaction,
Map<String,Object> state)
Creates the specified object with the data provided in the specified state under the governance of the specified transaction. |
Collection<T> |
find(SearchTerm[] terms,
org.dasein.util.JiteratorFilter<T> filter,
Boolean orderDesc,
String... orderFields)
|
T |
get(Object primaryKeyValue)
Retrieves the object uniquely identified by the value for the specified ID field. |
protected String |
getSqlName(Class<?> cls)
|
protected String |
getSqlName(String nom)
|
protected String |
getSqlNameForClassName(String cname)
|
protected Map<String,Class<?>> |
getTypes()
|
Object |
getValue(String col,
int i,
ResultSet rs)
|
Collection<T> |
hsFind(String index,
AutomatedSql.Operator operator,
int limit,
int offset,
String... indexValues)
Hits the HandlerSocket index directly, caching objects it finds. |
Collection<T> |
hsFind(String index,
AutomatedSql.Operator operator,
String... indexValues)
|
Collection<T> |
hsFind(String index,
String... indexValues)
|
protected void |
init(Class<T> cls,
Key... keys)
Constructs a new persistent factory for objects of the specified class with the named unique identifier attributes as well as with reading the persistence properties file to find out the HandlerSocket host, database, port and pool size. |
Collection<T> |
list()
Loads all elements of this class from the data store. |
void |
remove(Transaction xaction,
T item)
Removes the specified item from the system permanently. |
String |
toString()
|
void |
update(Transaction xaction,
T item,
Map<String,Object> state)
Updates the specified object with the data provided in the specified state under the governance of the specified transaction. |
| Methods inherited from class org.dasein.persist.PersistentCache |
|---|
addJoinEntity, find, getCache, getCache, getJoin, getJoins, getKeyValue, getKeyValue, getKeyValue, getKeyValues, getNewKeyValue, getPrimaryKey, getPrimaryKeyField, getSecondaryKeys, getTarget, initBase, list, matchKeys |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final org.apache.log4j.Logger logger
| Constructor Detail |
|---|
public RelationalHSCache()
| Method Detail |
|---|
protected void init(Class<T> cls,
Key... keys)
init in class PersistentCache<T extends org.dasein.util.CachedItem>cls - the class of objects managed by this factorykeys - a list of unique identifiers for instances of the specified class
public long count()
throws PersistenceException
count in class PersistentCache<T extends org.dasein.util.CachedItem>PersistenceException - an error occurred counting the elements in the database
public long count(SearchTerm... terms)
throws PersistenceException
count in class PersistentCache<T extends org.dasein.util.CachedItem>PersistenceException
public T create(Transaction xaction,
Map<String,Object> state)
throws PersistenceException
create in class PersistentCache<T extends org.dasein.util.CachedItem>xaction - the transaction governing this eventstate - the new state for the new object
PersistenceException - an error occurred talking to the data store, or
creates are not supported
public Collection<T> find(SearchTerm[] terms,
org.dasein.util.JiteratorFilter<T> filter,
Boolean orderDesc,
String... orderFields)
throws PersistenceException
find in class PersistentCache<T extends org.dasein.util.CachedItem>PersistenceException
public T get(Object primaryKeyValue)
throws PersistenceException
get in class PersistentCache<T extends org.dasein.util.CachedItem>primaryKeyValue - the ID field identifying the object
PersistenceException - an error occurred talking to the data store
public Collection<T> list()
throws PersistenceException
list in class PersistentCache<T extends org.dasein.util.CachedItem>PersistenceException - an error occurred executing the query
public void remove(Transaction xaction,
T item)
throws PersistenceException
remove in class PersistentCache<T extends org.dasein.util.CachedItem>xaction - the transaction under which this event is occurringitem - the item to be removed
PersistenceException - an error occurred talking to the data store or
removal of these objects is prohibitedpublic String toString()
toString in class Object
public void update(Transaction xaction,
T item,
Map<String,Object> state)
throws PersistenceException
update in class PersistentCache<T extends org.dasein.util.CachedItem>xaction - the transaction governing this eventitem - the item to be updatedstate - the new state for the updated object
PersistenceException - an error occurred talking to the data store, or
updates are not supported
public Collection<T> hsFind(String index,
String... indexValues)
throws PersistenceException
PersistenceException
public Collection<T> hsFind(String index,
AutomatedSql.Operator operator,
String... indexValues)
throws PersistenceException
PersistenceException
public Collection<T> hsFind(String index,
AutomatedSql.Operator operator,
int limit,
int offset,
String... indexValues)
throws PersistenceException
index - One of the table's indexes to hit.operator - What type of comparison the query will make.limit - The number of results to return.offset - Where to start to return the results.indexValues - The values of the index to find values for. MAY NOT BE EMPTY!
PersistenceException - Thrown if there's an issue.protected String getSqlNameForClassName(String cname)
protected String getSqlName(Class<?> cls)
protected String getSqlName(String nom)
protected Map<String,Class<?>> getTypes()
public Object getValue(String col,
int i,
ResultSet rs)
throws SQLException
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||