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
ABaseNature
extension 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.String
CACHE_PROPERTIES
Property Key forCache
.static java.lang.String
INHERITANCE_STRATEGY
Property Key forInheritance.strategy()
.static java.lang.String
MAPPED_SUPERCLASS
Nature property name for abstract.static java.lang.String
NAMED_NATIVE_QUERY
Property Key forNamedNativeQuery
.static java.lang.String
NAMED_QUERY
Property Key forNamedQuery
.
-
Constructor Summary
Constructors Constructor Description JPAClassNature(PropertyHolder holder)
Instantiate aJPAClassNature
to access the givenPropertyHolder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Properties
getCacheProperties()
java.lang.String
getEntityName()
java.lang.String
getId()
Returns the fully qualified name of the Nature.javax.persistence.InheritanceType
getInheritanceStrategy()
java.util.Map<java.lang.String,java.lang.String>
getNamedNativeQuery()
java.util.Map<java.lang.String,java.lang.String>
getNamedQuery()
java.lang.String
getTableCatalog()
java.lang.String
getTableName()
java.lang.String
getTableSchema()
boolean
hasMappedSuperclass()
Returns if class has a mapped super class.void
setCacheProperties(java.util.Properties cacheProperties)
void
setEntityName(java.lang.String entityname)
void
setInheritanceStrategy(javax.persistence.InheritanceType strategy)
void
setMappedSuperclass(java.lang.Boolean hasMappedSuperclass)
Set class to have a mapped super class.void
setNamedNativeQuery(java.util.Map<java.lang.String,java.lang.String> namedNativeQueryMap)
void
setNamedQuery(java.util.Map<java.lang.String,java.lang.String> namedQuery)
void
setTableCatalog(java.lang.String catalog)
void
setTableName(java.lang.String tablename)
void
setTableSchema(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 aJPAClassNature
to 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
-
-