org.tynamo.services
Interface PersistenceService


public interface PersistenceService


Method Summary
<T> T
getInstance(Class<T> type)
          A convenience method for getting a singleton instance of specific type
<T> T
getInstance(Class<T> type, Serializable id)
           
<T> List<T>
getInstances(Class<T> type)
           
<T> List<T>
getInstances(Class<T> type, int startIndex, int maxResults)
           
 boolean isTransient(Object data, TynamoClassDescriptor classDescriptor)
           
<T> T
loadInstance(Class<T> type, Serializable id)
           
 void remove(Object instance)
           
 void removeAll(Collection collection)
           
 void removeCollectionElement(String removeExpression, Object member, Object parent)
           
<T> T
save(T instance)
           
<T> T
saveCollectionElement(String addExpression, T member, Object parent)
           
 

Method Detail

getInstance

<T> T getInstance(Class<T> type,
                  Serializable id)

loadInstance

<T> T loadInstance(Class<T> type,
                   Serializable id)

getInstances

<T> List<T> getInstances(Class<T> type)

getInstances

<T> List<T> getInstances(Class<T> type,
                         int startIndex,
                         int maxResults)

save

<T> T save(T instance)
Returns:
a List containing all the classes this persistence service knows about

remove

void remove(Object instance)

removeAll

void removeAll(Collection collection)

getInstance

<T> T getInstance(Class<T> type)
A convenience method for getting a singleton instance of specific type

Type Parameters:
T - Specific type of the entity
Parameters:
type - Type of singleton entity you want return
Returns:
Returns the singleton entity of requested type

isTransient

boolean isTransient(Object data,
                    TynamoClassDescriptor classDescriptor)

saveCollectionElement

<T> T saveCollectionElement(String addExpression,
                            T member,
                            Object parent)

removeCollectionElement

void removeCollectionElement(String removeExpression,
                             Object member,
                             Object parent)


Copyright © 2004-2009. All Rights Reserved.