org.trails.persistence
Interface PersistenceService


public interface PersistenceService


Method Summary
<T> java.util.List<T>
getAllInstances(java.lang.Class<T> type)
           
 java.util.List getAllTypes()
           
 java.io.Serializable getIdentifier(java.lang.Object data, IClassDescriptor classDescriptor)
           
<T> T
getInstance(java.lang.Class<T> type)
          A convenience method for getting a singleton instance of specific type
<T> T
getInstance(java.lang.Class<T> type, java.io.Serializable id)
           
<T> java.util.List<T>
getInstances(java.lang.Class<T> type, int startIndex, int maxResults)
           
 boolean isTransient(java.lang.Object data, IClassDescriptor classDescriptor)
           
<T> T
loadInstance(java.lang.Class<T> type, java.io.Serializable id)
           
 void remove(java.lang.Object instance)
           
 void removeAll(java.util.Collection collection)
           
<T> T
save(T instance)
           
 

Method Detail

getInstance

<T> T getInstance(java.lang.Class<T> type,
                  java.io.Serializable id)

loadInstance

<T> T loadInstance(java.lang.Class<T> type,
                   java.io.Serializable id)

getAllInstances

<T> java.util.List<T> getAllInstances(java.lang.Class<T> type)

getInstances

<T> java.util.List<T> getInstances(java.lang.Class<T> type,
                                   int startIndex,
                                   int maxResults)

getAllTypes

java.util.List getAllTypes()
Returns:
a List containing all the classes this persistence service knows about

save

<T> T save(T instance)

remove

void remove(java.lang.Object instance)

removeAll

void removeAll(java.util.Collection collection)

getInstance

<T> T getInstance(java.lang.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

getIdentifier

java.io.Serializable getIdentifier(java.lang.Object data,
                                   IClassDescriptor classDescriptor)

isTransient

boolean isTransient(java.lang.Object data,
                    IClassDescriptor classDescriptor)


Copyright © 2004-2007. All Rights Reserved.