org.spicefactory.pimento.metadata
Class EntityMetadataBuilder

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

public class EntityMetadataBuilder
extends Object

A builder that creates EntityMetadata instances.

Author:
Jens Halm

Method Summary
 void addEmbeddedProperty(String ownerPropertyName, String propertyName, PropertyType propertyType)
          Adds an embedded property to this entity metadata instance.
 void addProperty(String name, PropertyType type)
          Adds a property to this entity metadata instance.
 EntityMetadata build()
          Builds and returns a new EntityMetadata instance applying all property metadata that was added to this builder.
 Bean getBean()
          Returns the bean representing the persistent entity.
 void setIdProperty(String name, PropertyType type)
          Set the id property for this entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBean

public Bean getBean()
Returns the bean representing the persistent entity.

Returns:
the bean representing the persistent entity

setIdProperty

public void setIdProperty(String name,
                          PropertyType type)
Set the id property for this entity.

Parameters:
name - the name of the property
type - the property type

addProperty

public void addProperty(String name,
                        PropertyType type)
Adds a property to this entity metadata instance.

Parameters:
name - the name of the property
type - the property type

addEmbeddedProperty

public void addEmbeddedProperty(String ownerPropertyName,
                                String propertyName,
                                PropertyType propertyType)
Adds an embedded property to this entity metadata instance.

Parameters:
ownerPropertyName - the name of the embedded property
propertyName - the name of the property of the embedded type
propertyType - the property type

build

public EntityMetadata build()
Builds and returns a new EntityMetadata instance applying all property metadata that was added to this builder.

Returns:
a new EntityMetadata instance