org.castor.cpa.jpa.natures
Class JPAClassNature

java.lang.Object
  extended by org.castor.core.nature.BaseNature
      extended by org.castor.cpa.jpa.natures.JPAClassNature

public class JPAClassNature
extends BaseNature

A BaseNature extension that gives access to information derived from class bound JPA annotations.

Since:
1.3
Author:
Peter Schmidt
See Also:
PropertyHolder

Field Summary
static String CACHE_PROPERTIES
          Property Key for Cache.
static String INHERITANCE_STRATEGY
          Property Key for Inheritance.strategy().
static String MAPPED_SUPERCLASS
          Nature property name for abstract.
static String NAMED_NATIVE_QUERY
          Property Key for NamedNativeQuery.
static String NAMED_QUERY
          Property Key for NamedQuery.
 
Constructor Summary
JPAClassNature(PropertyHolder holder)
          Instantiate a JPAClassNature to access the given PropertyHolder.
 
Method Summary
 Properties getCacheProperties()
           
 String getEntityName()
           
 String getId()
          
 javax.persistence.InheritanceType getInheritanceStrategy()
           
 Map<String,String> getNamedNativeQuery()
           
 Map<String,String> getNamedQuery()
           
 String getTableCatalog()
           
 String getTableName()
           
 String getTableSchema()
           
 boolean hasMappedSuperclass()
          Returns if class has a mapped super class.
 void setCacheProperties(Properties cacheProperties)
           
 void setEntityName(String entityname)
           
 void setInheritanceStrategy(javax.persistence.InheritanceType strategy)
           
 void setMappedSuperclass(Boolean hasMappedSuperclass)
          Set class to have a mapped super class.
 void setNamedNativeQuery(Map<String,String> namedNativeQueryMap)
           
 void setNamedQuery(Map<String,String> namedQuery)
           
 void setTableCatalog(String catalog)
           
 void setTableName(String tablename)
           
 void setTableSchema(String schema)
           
 
Methods inherited from class org.castor.core.nature.BaseNature
getBooleanPropertyDefaultFalse, getHolder, getProperty, getPropertyAsList, getPropertyAsMap, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INHERITANCE_STRATEGY

public static final String INHERITANCE_STRATEGY
Property Key for Inheritance.strategy().

See Also:
Constant Field Values

MAPPED_SUPERCLASS

public static final String MAPPED_SUPERCLASS
Nature property name for abstract.

See Also:
Constant Field Values

NAMED_QUERY

public static final String NAMED_QUERY
Property Key for NamedQuery.

See Also:
Constant Field Values

NAMED_NATIVE_QUERY

public static final String NAMED_NATIVE_QUERY
Property Key for NamedNativeQuery.

See Also:
Constant Field Values

CACHE_PROPERTIES

public static final String CACHE_PROPERTIES
Property Key for Cache.

See Also:
Constant Field Values
Constructor Detail

JPAClassNature

public JPAClassNature(PropertyHolder holder)
Instantiate a JPAClassNature to access the given PropertyHolder.

Parameters:
holder - The underlying PropertyHolder (obviously a ClassInfo).
See Also:
PropertyHolder
Method Detail

getId

public String getId()

See Also:
Nature.getId()

setEntityName

public void setEntityName(String entityname)
Parameters:
entityname - The value of Entity.name().
See Also:
ENTITY_NAME

getEntityName

public String getEntityName()
Returns:
The value of Entity.name().
See Also:
ENTITY_NAME

setTableName

public void setTableName(String tablename)
Parameters:
tablename - The value of Table.name()
See Also:
TABLE_NAME

getTableName

public String getTableName()
Returns:
The value of Table.name()
See Also:
TABLE_NAME

setTableCatalog

public void setTableCatalog(String catalog)
Parameters:
catalog - The value of Table.catalog()
See Also:
TABLE_CATALOG

getTableCatalog

public String getTableCatalog()
Returns:
The value of Table.catalog()
See Also:
TABLE_CATALOG

setTableSchema

public void setTableSchema(String schema)
Parameters:
schema - The value of Table.schema()
See Also:
TABLE_SCHEMA

getTableSchema

public String getTableSchema()
Returns:
The value ofTable.schema()
See Also:
TABLE_SCHEMA

setInheritanceStrategy

public void setInheritanceStrategy(javax.persistence.InheritanceType strategy)
Parameters:
strategy - The value of Inheritance.strategy()
See Also:
INHERITANCE_STRATEGY

getInheritanceStrategy

public javax.persistence.InheritanceType getInheritanceStrategy()
Returns:
The value ofInheritance.strategy()
See Also:
INHERITANCE_STRATEGY

getNamedQuery

public Map<String,String> getNamedQuery()
Returns:
The value ofNamedQuery
See Also:
NAMED_QUERY

setMappedSuperclass

public void setMappedSuperclass(Boolean hasMappedSuperclass)
Set class to have a mapped super class.

Parameters:
abstract - Boolean True if the given class has a mapped super class.

hasMappedSuperclass

public boolean hasMappedSuperclass()
Returns if class has a mapped super class.

Returns:
true if class has a mapped super class.

setNamedQuery

public void setNamedQuery(Map<String,String> namedQuery)
Parameters:
namedQuery - The value of NamedQuery
See Also:
NAMED_QUERY

getNamedNativeQuery

public Map<String,String> getNamedNativeQuery()
Returns:
The value ofNamedNativeQuery
See Also:
NAMED_NATIVE_QUERY

setNamedNativeQuery

public void setNamedNativeQuery(Map<String,String> namedNativeQueryMap)
Parameters:
namedNativeQueryMap - The value of NamedNativeQuery
See Also:
NAMED_NATIVE_QUERY

setCacheProperties

public void setCacheProperties(Properties cacheProperties)
Parameters:
schema - The value of Cache
See Also:
CACHE_PROPERTIES

getCacheProperties

public Properties getCacheProperties()
Returns:
The value of Cache
See Also:
CACHE_PROPERTIES


Copyright © 2011. All Rights Reserved.