org.spicefactory.pimento.service
Interface EntityManagerProxy

All Known Implementing Classes:
DefaultEntityManagerProxy

@Transactional
@CinnamonService
public interface EntityManagerProxy

Server-side proxy for the EntityManager remote service.

The method signatures of this service interface are different than that of the corresponding AS3 EntityManager interface since Pimento modifies some of the parameters and return values under the hood.

This class should be exposed for clients through a Spring ApplicationContext. It is usually not used in server-sider application code directly.

Author:
Jens Halm

Method Summary
 Object executeQuery(DefaultQuery query)
          Executes the specified query and returns the result.
 Object initialize(int metadataId, Object primaryKey)
          Loads the entity with the specified primary key and the specified metadata id.
 Object initialize(int metadataId, Object primaryKey, PropertyMetadata property)
          Loads the collection property for the entity with the specified primary key and the specified metadata id.
 Object load(int metadataId, Object primaryKey)
          Loads the entity with the specified primary key and the specified metadata id.
 Collection<EntityMetadata> loadEntityMetadata()
          Loads the metadata for all managed persistent entities.
 void merge(Object entity)
          Merges the specified entity.
 void persist(Object entity)
          Persists the specified entity.
 Object refresh(int metadataId, Object primaryKey)
          Loads the entity with the specified primary key and the specified metadata id.
 void remove(int metadataId, Object primaryKey)
          Removes the entity with the specified primary key and the specified metadata id.
 

Method Detail

loadEntityMetadata

Collection<EntityMetadata> loadEntityMetadata()
Loads the metadata for all managed persistent entities.

This is an internal operation not exposed to the client-side EntityManager interface. It is always executed as the initial request for any client, since the clients need access to the metadata before they are able to perform other requests.

Returns:
the metadata for all managed persistent entities

executeQuery

Object executeQuery(DefaultQuery query)
Executes the specified query and returns the result.

Parameters:
query - the query to execute
Returns:
the result of the query

load

Object load(int metadataId,
            Object primaryKey)
Loads the entity with the specified primary key and the specified metadata id.

Parameters:
metadataId - the metadata id of the entity
primaryKey - the primary key of the entity
Returns:
the entity with the specified primary key and the specified metadata id

refresh

Object refresh(int metadataId,
               Object primaryKey)
Loads the entity with the specified primary key and the specified metadata id.

Parameters:
metadataId - the metadata id of the entity
primaryKey - the primary key of the entity
Returns:
the entity with the specified primary key and the specified metadata id

initialize

Object initialize(int metadataId,
                  Object primaryKey)
Loads the entity with the specified primary key and the specified metadata id.

Parameters:
metadataId - the metadata id of the entity
primaryKey - the primary key of the entity
Returns:
the entity with the specified primary key and the specified metadata id

initialize

Object initialize(int metadataId,
                  Object primaryKey,
                  PropertyMetadata property)
Loads the collection property for the entity with the specified primary key and the specified metadata id.

Parameters:
metadataId - the metadata id of the owning entity
primaryKey - the primary key of the owning entity
property - the property that holds the collection to load
Returns:
the entity with the specified primary key and the specified metadata id

persist

void persist(Object entity)
Persists the specified entity.

Parameters:
entity - the entity to persist.

merge

void merge(Object entity)
Merges the specified entity.

Parameters:
entity - the entity to merge

remove

void remove(int metadataId,
            Object primaryKey)
Removes the entity with the specified primary key and the specified metadata id.

Parameters:
metadataId - the metadata id of the entity to remove
primaryKey - the primary key of the entity to remove