public interface

DAO

vars.DAO
Known Indirect Subclasses

Summary

Public Methods
abstract void close()
abstract void commit()
abstract void endTransaction()
abstract boolean equalInDatastore(Object thisObj, Object thatObj)
True if the to objects represent the same object in the datastore.
abstract <T> T find(T object)
Retrieves the object from the datastore.
abstract List findByNamedQuery(String name)
Executes a named query that does not take any parameters
abstract List findByNamedQuery(String name, Map<String, Object> namedParameters)
Executes a named query using a map of named parameters
abstract <T> T findByPrimaryKey(Class<T> clazz, Object primaryKey)
abstract EntityManager getEntityManager()
abstract boolean isPersistent(Object entity)
Checks to see if the given object is persisted in the databas
abstract void loadLazyRelations(Object entity)
Many one-to-many relations are lazy loaded in JPA.
abstract <T> T merge(T object)
abstract void persist(Object object)
abstract void remove(Object object)
abstract void startTransaction()

Public Methods

public abstract void close ()

public abstract void commit ()

public abstract void endTransaction ()

public abstract boolean equalInDatastore (Object thisObj, Object thatObj)

True if the to objects represent the same object in the datastore. (e.g. It basically compares the primary key)

public abstract T find (T object)

Retrieves the object from the datastore. This ignores all state changes in the provided object and returns the copy as found in the data store.

public abstract List findByNamedQuery (String name)

Executes a named query that does not take any parameters

Parameters
name The name of the JPL query
Returns
  • A list of objects returned by the query

public abstract List findByNamedQuery (String name, Map<String, Object> namedParameters)

Executes a named query using a map of named parameters

Parameters
name The name of the query to execute
namedParameters A Map of the 'named' parameters to assign in the query
Returns
  • A list of objects returned by the query.

public abstract T findByPrimaryKey (Class<T> clazz, Object primaryKey)

public abstract EntityManager getEntityManager ()

public abstract boolean isPersistent (Object entity)

Checks to see if the given object is persisted in the databas

Parameters
entity The object of interest
Returns
  • true if it's in the database. False if it is not

public abstract void loadLazyRelations (Object entity)

Many one-to-many relations are lazy loaded in JPA. For convenience, this method will load all lazy relations of an IEntity object. This method has no effect on objects that are not persistent

Parameters
entity The persistent object who's children will be loaded from the database.

public abstract T merge (T object)

public abstract void persist (Object object)

public abstract void remove (Object object)

public abstract void startTransaction ()