org.dasein.persist
Class HandlerSocketCache<T extends org.dasein.util.CachedItem>
java.lang.Object
org.dasein.persist.PersistentCache<T>
org.dasein.persist.HandlerSocketCache<T>
public class HandlerSocketCache<T extends org.dasein.util.CachedItem>
- extends PersistentCache<T>
Implements HanderSocket. You must use indexes (like PRIMARY) to access data.
TODO: Handle translation field types!
When you want to do additional development on this class, hs4j isn't yet in Sonatype - follow these steps to install it locally:
- Make sure Eclipse is turned off (or have to refresh local repository)
- Download hs4j source from https://github.com/killme2008/hs4j
- Change to directory and run: mvn install -Dmaven.test.skip=true
- Author:
- morgan
- See Also:
HandlerSocketCache.getSession()},
https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL/blob/master/docs-en/protocol.en.txt,
http://code.google.com/p/hs4j/wiki/GettingStarted
|
Field Summary |
static org.apache.log4j.Logger |
logger
|
|
Method Summary |
T |
create(Transaction xaction,
Map<String,Object> state)
|
Collection<T> |
find(SearchTerm[] terms,
org.dasein.util.JiteratorFilter<T> filter,
Boolean orderDesc,
String... orderFields)
Very simply this the specified index by term.getColumn() using
term.getValue(). |
T |
get(Object valueOfPrimaryKey)
|
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)
|
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. |
Collection<T> |
list()
|
void |
remove(Transaction xaction,
T item)
|
void |
update(Transaction xaction,
T item,
Map<String,Object> state)
|
| Methods inherited from class org.dasein.persist.PersistentCache |
addJoinEntity, count, count, 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, toString, wait, wait, wait |
logger
public static final org.apache.log4j.Logger logger
HandlerSocketCache
public HandlerSocketCache()
init
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.
- Overrides:
init in class PersistentCache<T extends org.dasein.util.CachedItem>
- Parameters:
cls - the class of objects managed by this factorykeys - a list of unique identifiers for instances of the specified class
create
public T create(Transaction xaction,
Map<String,Object> state)
throws PersistenceException
- Specified by:
create in class PersistentCache<T extends org.dasein.util.CachedItem>
- Throws:
PersistenceException
find
public Collection<T> find(SearchTerm[] terms,
org.dasein.util.JiteratorFilter<T> filter,
Boolean orderDesc,
String... orderFields)
throws PersistenceException
- Very simply this the specified index by term.getColumn() using
term.getValue(). THIS DOES NOT USE COLUMNS IN ITS SEARCH, IT USES
INDEXES!!!!!!!!!
- Specified by:
find in class PersistentCache<T extends org.dasein.util.CachedItem>
- Throws:
PersistenceException
get
public T get(Object valueOfPrimaryKey)
throws PersistenceException
- Specified by:
get in class PersistentCache<T extends org.dasein.util.CachedItem>
- Throws:
PersistenceException
list
public Collection<T> list()
throws PersistenceException
- Specified by:
list in class PersistentCache<T extends org.dasein.util.CachedItem>
- Throws:
PersistenceException
remove
public void remove(Transaction xaction,
T item)
throws PersistenceException
- Specified by:
remove in class PersistentCache<T extends org.dasein.util.CachedItem>
- Throws:
PersistenceException
update
public void update(Transaction xaction,
T item,
Map<String,Object> state)
throws PersistenceException
- Specified by:
update in class PersistentCache<T extends org.dasein.util.CachedItem>
- Throws:
PersistenceException
getSqlNameForClassName
protected String getSqlNameForClassName(String cname)
getSqlName
protected String getSqlName(Class<?> cls)
getSqlName
protected String getSqlName(String nom)
getTypes
protected Map<String,Class<?>> getTypes()
getValue
public Object getValue(String col,
int i,
ResultSet rs)
throws SQLException
- Throws:
SQLException
Copyright © 2011 enStratus Networks LLC. All Rights Reserved.