org.spicefactory.pimento.metadata
Class MetadataCache

java.lang.Object
  extended by org.spicefactory.pimento.metadata.MetadataCache

public class MetadataCache
extends Object

Cache for all entity metadata.

Author:
Jens Halm

Constructor Summary
MetadataCache()
           
 
Method Summary
 void add(EntityMetadata metadata)
          Adds the specified metadata to the cache.
 Collection<EntityMetadata> getAllMetadata()
          Retrieves all entity metadata.
 EntityMetadata getMetadataById(int id)
          Retrieves the metadata for the specified metadata id.
 EntityMetadata getMetadataForClass(Class<?> persistentClass)
          Retrieves the metadata for the specified entity type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetadataCache

public MetadataCache()
Method Detail

add

public void add(EntityMetadata metadata)
Adds the specified metadata to the cache.

Parameters:
metadata - the metadata to add to the cache

getMetadataForClass

public EntityMetadata getMetadataForClass(Class<?> persistentClass)
Retrieves the metadata for the specified entity type.

Parameters:
persistentClass - the entity type to retrieve the metadata for
Returns:
the metadata for the specified entity type or null if no such metadata exists

getMetadataById

public EntityMetadata getMetadataById(int id)
Retrieves the metadata for the specified metadata id.

Parameters:
id - the metadata id
Returns:
the metadata for the specified id or null if no such metadata exists

getAllMetadata

public Collection<EntityMetadata> getAllMetadata()
Retrieves all entity metadata.

Returns:
all entity metadata of this cache