org.spicefactory.pimento.provider
Interface JpaProvider

All Known Implementing Classes:
HibernateJpaProvider

public interface JpaProvider

Encapsulates functionality that is specific for a particular JPA implementation.

Author:
Jens Halm

Method Summary
 List<EntityMetadata> getMetadata(MetadataFactory factory, Set<Operation> defaultOperations, boolean manageAllEntities)
          Creates metadata for all persistent entities managed by Pimento.
 Class<?> getPersistentClass(Object entity)
          Returns the persistent class for the specified entity.
 boolean isUninitializedProxy(Object entity)
          Checks whether the specified entity is an uninitialized proxy.
 

Method Detail

getMetadata

List<EntityMetadata> getMetadata(MetadataFactory factory,
                                 Set<Operation> defaultOperations,
                                 boolean manageAllEntities)
Creates metadata for all persistent entities managed by Pimento.

Implementations must inspect all entities configured for JPA. If the @Managed annotation is present the entity must be included in the returned metadata collection.

Furthermore properties annotated with @Hidden must be excluded from the managed properties.

Parameters:
factory - the factory to use for creating EntityMetadataBuilder instances
defaultOperations - the operations permitted for the EntityManager remote service
manageAllEntities - whether all entities should be managed by Pimento, even if no Managed annotation is present
Returns:
metadata instances for all managed persistent entities

isUninitializedProxy

boolean isUninitializedProxy(Object entity)
Checks whether the specified entity is an uninitialized proxy.

Parameters:
entity - the entity to check
Returns:
true if the specified entity is an uninitialized proxy

getPersistentClass

Class<?> getPersistentClass(Object entity)
Returns the persistent class for the specified entity.

Parameters:
entity - the entity to return the persistent class for
Returns:
the persistent class for the specified entity