org.spicefactory.pimento.service.impl
Class DefaultEntityManagerProxy

java.lang.Object
  extended by org.spicefactory.pimento.service.impl.DefaultEntityManagerProxy
All Implemented Interfaces:
EntityManagerProxy

public class DefaultEntityManagerProxy
extends Object
implements EntityManagerProxy

Default EntityManagerProxy implementation.

Author:
Jens Halm

Constructor Summary
DefaultEntityManagerProxy(PimentoConfig config)
          Creates a new instance using the specified configuration.
 
Method Summary
 Object executeQuery(DefaultQuery query, int typeHandle)
          Executes the specified query and returns the result.
 Object initialize(int typeHandle, Object primaryKey)
          Intializes the entity with the specified primary key and type handle.
 Object initialize(int typeHandle, Object primaryKey, String propertyName)
          Loads the collection property for the entity with the specified primary key and type handle.
 Object load(int typeHandle, Object primaryKey)
          Loads the entity with the specified primary key and type handle.
 void merge(Object instance)
          Merges the specified entity.
 void persist(Object instance)
          Persists the specified entity.
 Object refresh(int typeHandle, Object primaryKey)
          Refreshes the entity with the specified primary key and type handle.
 void remove(int typeHandle, Object primaryKey)
          Removes the entity with the specified primary key and type handle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEntityManagerProxy

public DefaultEntityManagerProxy(PimentoConfig config)
Creates a new instance using the specified configuration.

Parameters:
config - the Pimento configuration
Method Detail

executeQuery

public Object executeQuery(DefaultQuery query,
                           int typeHandle)
Description copied from interface: EntityManagerProxy
Executes the specified query and returns the result.

Specified by:
executeQuery in interface EntityManagerProxy
Parameters:
query - the query to execute
typeHandle - the type handle of the result objects or 0 if not specified
Returns:
the result of the query

load

public Object load(int typeHandle,
                   Object primaryKey)
Description copied from interface: EntityManagerProxy
Loads the entity with the specified primary key and type handle.

Specified by:
load in interface EntityManagerProxy
Parameters:
typeHandle - the type handle of the entity
primaryKey - the primary key of the entity
Returns:
the entity with the specified primary key and type handle

refresh

public Object refresh(int typeHandle,
                      Object primaryKey)
Description copied from interface: EntityManagerProxy
Refreshes the entity with the specified primary key and type handle.

Specified by:
refresh in interface EntityManagerProxy
Parameters:
typeHandle - the type handle of the entity
primaryKey - the primary key of the entity
Returns:
the entity with the specified primary key and type handle

initialize

public Object initialize(int typeHandle,
                         Object primaryKey)
Description copied from interface: EntityManagerProxy
Intializes the entity with the specified primary key and type handle.

Specified by:
initialize in interface EntityManagerProxy
Parameters:
typeHandle - the type handle of the entity
primaryKey - the primary key of the entity
Returns:
the entity with the specified primary key and type handle

initialize

public Object initialize(int typeHandle,
                         Object primaryKey,
                         String propertyName)
Description copied from interface: EntityManagerProxy
Loads the collection property for the entity with the specified primary key and type handle.

Specified by:
initialize in interface EntityManagerProxy
Parameters:
typeHandle - the type handle of the owning entity
primaryKey - the primary key of the owning entity
propertyName - the name of the collection property
Returns:
the entity with the specified primary key and type handle

persist

public void persist(Object instance)
Description copied from interface: EntityManagerProxy
Persists the specified entity.

Specified by:
persist in interface EntityManagerProxy
Parameters:
instance - the entity to persist.

merge

public void merge(Object instance)
Description copied from interface: EntityManagerProxy
Merges the specified entity.

Specified by:
merge in interface EntityManagerProxy
Parameters:
instance - the entity to merge

remove

public void remove(int typeHandle,
                   Object primaryKey)
Description copied from interface: EntityManagerProxy
Removes the entity with the specified primary key and type handle.

Specified by:
remove in interface EntityManagerProxy
Parameters:
typeHandle - the type handle of the entity to remove
primaryKey - the primary key of the entity to remove