org.spicefactory.pimento.metamodel.impl
Class EntityImpl

java.lang.Object
  extended by org.spicefactory.pimento.metamodel.impl.TypeImpl
      extended by org.spicefactory.pimento.metamodel.impl.ManagedTypeImpl
          extended by org.spicefactory.pimento.metamodel.impl.EntityImpl
All Implemented Interfaces:
Externalizable, Entity, ManagedType, Type

public class EntityImpl
extends ManagedTypeImpl
implements Entity

Default implementation of the Entity interface.

Author:
Jens Halm

Method Summary
 Attribute getIdProperty()
          Returns the property holding the entity id.
 InterceptorManager getInterceptorManager()
          Returns the manager responsible for interceptors of this entity.
 String getName()
          Returns the JPA entity name.
 Set<Operation> getOperations()
          Returns the EnityManager operations permitted for the client.
 PersistenceAdapter getPersistenceAdapter()
          Returns the persistence adapter that is responsible for managing operations of this entity type.
 List<ManagedProperty> getRefreshableProperties()
          Returns all properties that were configured to be refreshable.
 Entity getSupertype()
          Returns the pesistent superclass of this entity.
 int getTypeHandle()
          Returns the type handle for this entity.
 boolean hasOperation(Operation op)
          Checks whether the specified operation is permitted for the client
 boolean isRefreshable()
          Checks whether this entity contains any properties marked as refreshable.
 void writeExternal(DataOutput output)
          Saves the content of this object to the DataOutput instance.
 
Methods inherited from class org.spicefactory.pimento.metamodel.impl.ManagedTypeImpl
getProperties, getProperty
 
Methods inherited from class org.spicefactory.pimento.metamodel.impl.TypeImpl
getJavaType, readExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.spicefactory.pimento.metamodel.ManagedType
getProperties, getProperty
 
Methods inherited from interface org.spicefactory.pimento.metamodel.Type
getJavaType
 

Method Detail

getInterceptorManager

public InterceptorManager getInterceptorManager()
Description copied from interface: Entity
Returns the manager responsible for interceptors of this entity.

Specified by:
getInterceptorManager in interface Entity
Returns:
the manager responsible for interceptors of this entity

getTypeHandle

public int getTypeHandle()
Returns the type handle for this entity.

Specified by:
getTypeHandle in interface Entity
Returns:
the type handle for this entity.

getName

public String getName()
Returns the JPA entity name.

Specified by:
getName in interface Entity
Returns:
the JPA entity name.

getPersistenceAdapter

public PersistenceAdapter getPersistenceAdapter()
Returns the persistence adapter that is responsible for managing operations of this entity type.

Specified by:
getPersistenceAdapter in interface Entity
Returns:
the persistence adapter

getIdProperty

public Attribute getIdProperty()
Returns the property holding the entity id.

Specified by:
getIdProperty in interface Entity
Returns:
the property holding the entity id.

getRefreshableProperties

public List<ManagedProperty> getRefreshableProperties()
Returns all properties that were configured to be refreshable.

Specified by:
getRefreshableProperties in interface Entity
Returns:
all properties that were configured to be refreshable

getOperations

public Set<Operation> getOperations()
Returns the EnityManager operations permitted for the client.

Specified by:
getOperations in interface Entity
Returns:
the EnityManager operations permitted for the client

hasOperation

public boolean hasOperation(Operation op)
Checks whether the specified operation is permitted for the client

Specified by:
hasOperation in interface Entity
Parameters:
op - the operation to check
Returns:
true if the specified operation is permitted for the client

getSupertype

public Entity getSupertype()
Returns the pesistent superclass of this entity. Will be null if the superclass of this entity is not managed by Pimento.

Specified by:
getSupertype in interface Entity
Returns:
the pesistent superclass of this entity or null

isRefreshable

public boolean isRefreshable()
Checks whether this entity contains any properties marked as refreshable.

Specified by:
isRefreshable in interface Entity
Returns:
true if this entity contains any properties marked as refreshable

writeExternal

public void writeExternal(DataOutput output)
Description copied from interface: Externalizable
Saves the content of this object to the DataOutput instance.

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class ManagedTypeImpl
Parameters:
output - the output to write to