org.gcube.dbinterface.persistence
Class ObjectPersistency<T>

java.lang.Object
  extended by org.gcube.dbinterface.persistence.ObjectPersistency<T>
Type Parameters:
T -

public class ObjectPersistency<T>
extends Object

Author:
Lucio Lelii

Field Summary
static HashMap<String,ObjectPersistency> persistencyMapping
           
 
Method Summary
 void addCallback(PersistencyCallback<T> obj)
           
 void deleteByKey(Object key)
           
 void deleteByValue(String fieldName, Object value)
           
 void drop()
           
 boolean existEntryByFields(HashMap<String,Object> fieldValueMapping)
           
 boolean existsKey(Object key)
           
static
<T> ObjectPersistency<T>
get(Class<T> clazz, org.gcube.common.dbinterface.registry.DBInterface dbInterface)
           
 List<T> getAll()
           
 T getByKey(Object key)
           
 Map<String,String> getInfo()
           
 List<T> getObjectByField(String fieldName, Object value)
           
 List<T> getObjectByFields(HashMap<String,Object> fieldValueMapping)
           
 org.gcube.common.dbinterface.tables.Table getTable()
           
 void insert(T object)
           
 void update(T obj)
           
 void updateByFields(T obj, HashMap<String,Object> fieldValueMapping)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

persistencyMapping

public static HashMap<String,ObjectPersistency> persistencyMapping
Method Detail

addCallback

public void addCallback(PersistencyCallback<T> obj)

get

public static <T> ObjectPersistency<T> get(Class<T> clazz,
                                           org.gcube.common.dbinterface.registry.DBInterface dbInterface)
                                throws Exception
Throws:
Exception

deleteByKey

public void deleteByKey(Object key)
                 throws Exception
Throws:
Exception

getInfo

public Map<String,String> getInfo()
                           throws Exception
Throws:
Exception

getByKey

public T getByKey(Object key)
           throws ObjectNotFoundException,
                  Exception
Throws:
ObjectNotFoundException
Exception

insert

public void insert(T object)
            throws Exception
Throws:
Exception

drop

public void drop()
          throws Exception
Throws:
Exception

deleteByValue

public void deleteByValue(String fieldName,
                          Object value)
                   throws Exception
Throws:
Exception

getObjectByField

public List<T> getObjectByField(String fieldName,
                                Object value)
                         throws Exception
Throws:
Exception

getObjectByFields

public List<T> getObjectByFields(HashMap<String,Object> fieldValueMapping)
                          throws Exception
Throws:
Exception

getAll

public List<T> getAll()
               throws Exception
Throws:
Exception

getTable

public org.gcube.common.dbinterface.tables.Table getTable()

existsKey

public boolean existsKey(Object key)
                  throws Exception
Throws:
Exception

existEntryByFields

public boolean existEntryByFields(HashMap<String,Object> fieldValueMapping)
                           throws Exception
Throws:
Exception

update

public void update(T obj)
            throws ObjectStateChangedException,
                   ObjectNotFoundException,
                   Exception
Parameters:
obj -
Throws:
ObjectStateChangedException
ObjectNotFoundException
Exception

updateByFields

public void updateByFields(T obj,
                           HashMap<String,Object> fieldValueMapping)
                    throws ObjectStateChangedException,
                           ObjectNotFoundException,
                           Exception
Parameters:
obj -
fieldValueMapping -
Throws:
ObjectStateChangedException
ObjectNotFoundException
Exception


Copyright © 2013. All Rights Reserved.