Package org.castor.cpa.jpa.natures
Class JPAClassNature
- java.lang.Object
-
- org.castor.core.nature.BaseNature
-
- org.castor.cpa.jpa.natures.JPAClassNature
-
- All Implemented Interfaces:
Nature
public class JPAClassNature extends BaseNature
ABaseNatureextension that gives access to information derived from class bound JPA annotations.- Since:
- 1.3
- Author:
- Peter Schmidt
- See Also:
PropertyHolder
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCACHE_PROPERTIESProperty Key forCache.static java.lang.StringINHERITANCE_STRATEGYProperty Key forInheritance.strategy().static java.lang.StringMAPPED_SUPERCLASSNature property name for abstract.static java.lang.StringNAMED_NATIVE_QUERYProperty Key forNamedNativeQuery.static java.lang.StringNAMED_QUERYProperty Key forNamedQuery.
-
Constructor Summary
Constructors Constructor Description JPAClassNature(PropertyHolder holder)Instantiate aJPAClassNatureto access the givenPropertyHolder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.PropertiesgetCacheProperties()java.lang.StringgetEntityName()java.lang.StringgetId()Returns the fully qualified name of the Nature.javax.persistence.InheritanceTypegetInheritanceStrategy()java.util.Map<java.lang.String,java.lang.String>getNamedNativeQuery()java.util.Map<java.lang.String,java.lang.String>getNamedQuery()java.lang.StringgetTableCatalog()java.lang.StringgetTableName()java.lang.StringgetTableSchema()booleanhasMappedSuperclass()Returns if class has a mapped super class.voidsetCacheProperties(java.util.Properties cacheProperties)voidsetEntityName(java.lang.String entityname)voidsetInheritanceStrategy(javax.persistence.InheritanceType strategy)voidsetMappedSuperclass(java.lang.Boolean hasMappedSuperclass)Set class to have a mapped super class.voidsetNamedNativeQuery(java.util.Map<java.lang.String,java.lang.String> namedNativeQueryMap)voidsetNamedQuery(java.util.Map<java.lang.String,java.lang.String> namedQuery)voidsetTableCatalog(java.lang.String catalog)voidsetTableName(java.lang.String tablename)voidsetTableSchema(java.lang.String schema)-
Methods inherited from class org.castor.core.nature.BaseNature
getBooleanPropertyDefaultFalse, getHolder, getProperty, getPropertyAsList, getPropertyAsMap, setProperty
-
-
-
-
Field Detail
-
INHERITANCE_STRATEGY
public static final java.lang.String INHERITANCE_STRATEGY
Property Key forInheritance.strategy().- See Also:
- Constant Field Values
-
MAPPED_SUPERCLASS
public static final java.lang.String MAPPED_SUPERCLASS
Nature property name for abstract.- See Also:
- Constant Field Values
-
NAMED_QUERY
public static final java.lang.String NAMED_QUERY
Property Key forNamedQuery.- See Also:
- Constant Field Values
-
NAMED_NATIVE_QUERY
public static final java.lang.String NAMED_NATIVE_QUERY
Property Key forNamedNativeQuery.- See Also:
- Constant Field Values
-
CACHE_PROPERTIES
public static final java.lang.String CACHE_PROPERTIES
Property Key forCache.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JPAClassNature
public JPAClassNature(PropertyHolder holder)
Instantiate aJPAClassNatureto access the givenPropertyHolder.- Parameters:
holder- The underlyingPropertyHolder(obviously aClassInfo).- See Also:
PropertyHolder
-
-
Method Detail
-
getId
public java.lang.String getId()
Returns the fully qualified name of the Nature.- Returns:
- qualified name of the nature.
- See Also:
Nature.getId()
-
setEntityName
public void setEntityName(java.lang.String entityname)
- Parameters:
entityname- The value ofEntity.name().- See Also:
ENTITY_NAME
-
getEntityName
public java.lang.String getEntityName()
- Returns:
- The value of
Entity.name(). - See Also:
ENTITY_NAME
-
setTableName
public void setTableName(java.lang.String tablename)
- Parameters:
tablename- The value ofTable.name()- See Also:
TABLE_NAME
-
getTableName
public java.lang.String getTableName()
- Returns:
- The value of
Table.name() - See Also:
TABLE_NAME
-
setTableCatalog
public void setTableCatalog(java.lang.String catalog)
- Parameters:
catalog- The value ofTable.catalog()- See Also:
TABLE_CATALOG
-
getTableCatalog
public java.lang.String getTableCatalog()
- Returns:
- The value of
Table.catalog() - See Also:
TABLE_CATALOG
-
setTableSchema
public void setTableSchema(java.lang.String schema)
- Parameters:
schema- The value ofTable.schema()- See Also:
TABLE_SCHEMA
-
getTableSchema
public java.lang.String getTableSchema()
- Returns:
- The value of
Table.schema() - See Also:
TABLE_SCHEMA
-
setInheritanceStrategy
public void setInheritanceStrategy(javax.persistence.InheritanceType strategy)
- Parameters:
strategy- The value ofInheritance.strategy()- See Also:
INHERITANCE_STRATEGY
-
getInheritanceStrategy
public javax.persistence.InheritanceType getInheritanceStrategy()
- Returns:
- The value of
Inheritance.strategy() - See Also:
INHERITANCE_STRATEGY
-
getNamedQuery
public java.util.Map<java.lang.String,java.lang.String> getNamedQuery()
- Returns:
- The value of
NamedQuery - See Also:
NAMED_QUERY
-
setMappedSuperclass
public void setMappedSuperclass(java.lang.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(java.util.Map<java.lang.String,java.lang.String> namedQuery)
- Parameters:
namedQuery- The value ofNamedQuery- See Also:
NAMED_QUERY
-
getNamedNativeQuery
public java.util.Map<java.lang.String,java.lang.String> getNamedNativeQuery()
- Returns:
- The value of
NamedNativeQuery - See Also:
NAMED_NATIVE_QUERY
-
setNamedNativeQuery
public void setNamedNativeQuery(java.util.Map<java.lang.String,java.lang.String> namedNativeQueryMap)
- Parameters:
namedNativeQueryMap- The value ofNamedNativeQuery- See Also:
NAMED_NATIVE_QUERY
-
setCacheProperties
public void setCacheProperties(java.util.Properties cacheProperties)
- Parameters:
schema- The value ofCache- See Also:
CACHE_PROPERTIES
-
getCacheProperties
public java.util.Properties getCacheProperties()
- Returns:
- The value of
Cache - See Also:
CACHE_PROPERTIES
-
-