public final class EntityMetadata extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
EntityMetadata.Type
The Enum Type.
|
| Modifier and Type | Field and Description |
|---|---|
private boolean |
cacheable
Cacheable?.
|
private Map<Class<?>,List<? extends CallbackMethod>> |
callbackMethodsMap
The callback methods map.
|
private Class<?> |
entityClazz
class corresponding to this meta.
|
private javax.persistence.metamodel.EntityType |
entityType |
private javax.persistence.metamodel.SingularAttribute |
idAttribute |
private String |
indexName
The index name.
|
private Map<String,PropertyIndex> |
indexPrperties
The index prperties.
|
private boolean |
isCounterColumnType |
private boolean |
isIndexable
The is indexable.
|
private boolean |
isParent |
private boolean |
isRelationViaJoinTable
The is relation via join table.
|
private Map<String,String> |
jpaColumnMapping |
private String |
persistenceUnit
Persistence unit of database this entity is to be persisted.
|
private Method |
readIdentifierMethod
The read identifier method.
|
private List<String> |
relationNames |
private Map<String,Relation> |
relationsMap
Relationship map, key=>property name, value=>relation.
|
private String |
schema
database name.
|
private String |
tableName
Name of Persistence Object.
|
private EntityMetadata.Type |
type
type.
|
private Method |
writeIdentifierMethod
The write identifier method.
|
| Constructor and Description |
|---|
EntityMetadata(Class<?> entityClazz)
Instantiates a new metadata.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIndexProperty(String columnName,
PropertyIndex index)
Adds the index property.
|
void |
addJPAColumnMapping(String jpaColumnName,
String fieldName) |
void |
addRelation(String property,
Relation relation)
Adds the relation.
|
private void |
addRelationName(Relation rField)
Method to add specific relation name for given relational field.
|
private void |
addToRelationNameCollection(String relationName)
Adds relation name to relation name collection.
|
List<? extends CallbackMethod> |
getCallbackMethods(Class<?> event)
Gets the callback methods.
|
Map<Class<?>,List<? extends CallbackMethod>> |
getCallbackMethodsMap()
Gets the callback methods map.
|
Class<?> |
getEntityClazz()
Gets the entity clazz.
|
private javax.persistence.metamodel.EntityType |
getEntityType() |
String |
getFieldName(String jpaColumnName) |
javax.persistence.metamodel.SingularAttribute |
getIdAttribute() |
String |
getIndexName()
Gets the index name.
|
Map<String,PropertyIndex> |
getIndexProperties()
Gets the index properties.
|
private String |
getJoinColumnName(Field relation)
Gets the relation field name.
|
String |
getPersistenceUnit()
Gets the persistence unit.
|
Method |
getReadIdentifierMethod()
Gets the read identifier method.
|
Relation |
getRelation(String property)
Gets the relation.
|
List<String> |
getRelationNames() |
List<Relation> |
getRelations()
Gets the relations.
|
String |
getSchema()
Gets the schema.
|
String |
getTableName()
Gets the table name.
|
EntityMetadata.Type |
getType()
Gets the type.
|
Method |
getWriteIdentifierMethod()
Gets the write identifier method.
|
boolean |
isCacheable()
Checks if is cacheable.
|
boolean |
isCounterColumnType() |
boolean |
isIndexable()
Checks if is indexable.
|
boolean |
isParent() |
boolean |
isRelationViaJoinTable()
Getter method for isRelatedViaJoinTable.
|
void |
setCacheable(boolean cacheable)
Sets the cacheable.
|
void |
setCallbackMethodsMap(Map<Class<?>,List<? extends CallbackMethod>> callbackMethodsMap)
Sets the callback methods map.
|
void |
setCounterColumnType(boolean isCounterColumnType) |
void |
setEntityType(javax.persistence.metamodel.EntityType entityType) |
void |
setIdAttribute(javax.persistence.metamodel.SingularAttribute idAttribute) |
void |
setIndexable(boolean isIndexable)
Sets the indexable.
|
void |
setIndexName(String indexName)
Sets the index name.
|
void |
setParent(boolean isParent) |
void |
setPersistenceUnit(String persistenceUnit)
Sets the persistence unit.
|
void |
setReadIdentifierMethod(Method readIdentifierMethod)
Sets the read identifier method.
|
void |
setRelationViaJoinTable(boolean isRelationViaJoinTable)
Setter method for isRelatedViaJoinTable.
|
void |
setSchema(String schema)
Sets the schema.
|
void |
setTableName(String tableName)
Sets the table name.
|
void |
setType(EntityMetadata.Type type)
Sets the type.
|
void |
setWriteIdentifierMethod(Method writeIdentifierMethod)
Sets the write identifier method.
|
String |
toString() |
private Class<?> entityClazz
private String tableName
private String schema
private String persistenceUnit
private String indexName
private boolean isIndexable
private boolean cacheable
private boolean isCounterColumnType
private javax.persistence.metamodel.SingularAttribute idAttribute
private Method readIdentifierMethod
private Method writeIdentifierMethod
private Map<String,PropertyIndex> indexPrperties
private Map<Class<?>,List<? extends CallbackMethod>> callbackMethodsMap
private Map<String,Relation> relationsMap
private EntityMetadata.Type type
private boolean isRelationViaJoinTable
private boolean isParent
private javax.persistence.metamodel.EntityType entityType
public EntityMetadata(Class<?> entityClazz)
entityClazz - the entity clazzpublic EntityMetadata.Type getType()
public void setType(EntityMetadata.Type type)
type - the new typepublic Class<?> getEntityClazz()
public String getTableName()
private javax.persistence.metamodel.EntityType getEntityType()
public void setTableName(String tableName)
tableName - the tableName to setpublic String getSchema()
public void setSchema(String schema)
schema - the schema to setpublic String getPersistenceUnit()
public void setPersistenceUnit(String persistenceUnit)
persistenceUnit - the persistenceUnit to setpublic Method getReadIdentifierMethod()
public void setReadIdentifierMethod(Method readIdentifierMethod)
readIdentifierMethod - the readIdentifierMethod to setpublic Method getWriteIdentifierMethod()
public void setWriteIdentifierMethod(Method writeIdentifierMethod)
writeIdentifierMethod - the writeIdentifierMethod to setpublic void addIndexProperty(String columnName, PropertyIndex index)
index - the indexpublic void addRelation(String property, Relation relation)
property - the propertyrelation - the relationpublic Relation getRelation(String property)
property - the propertypublic Map<String,PropertyIndex> getIndexProperties()
public String getIndexName()
public void setIndexName(String indexName)
indexName - the new index namepublic boolean isIndexable()
public void setIndexable(boolean isIndexable)
isIndexable - the new indexablepublic void setCallbackMethodsMap(Map<Class<?>,List<? extends CallbackMethod>> callbackMethodsMap)
callbackMethodsMap - the callback methods mappublic Map<Class<?>,List<? extends CallbackMethod>> getCallbackMethodsMap()
public List<? extends CallbackMethod> getCallbackMethods(Class<?> event)
event - the eventpublic boolean isCacheable()
public void setCacheable(boolean cacheable)
cacheable - the cacheable to setpublic boolean isRelationViaJoinTable()
public boolean isParent()
public void setParent(boolean isParent)
isParent - the isParent to setpublic void setRelationViaJoinTable(boolean isRelationViaJoinTable)
isRelationViaJoinTable - the new relation via join tableprivate void addRelationName(Relation rField)
rField - relation object.private void addToRelationNameCollection(String relationName)
relationName - relational nameprivate String getJoinColumnName(Field relation)
relation - the relationpublic boolean isCounterColumnType()
public void setCounterColumnType(boolean isCounterColumnType)
isCounterColumnType - the isCounterColumnType to setpublic javax.persistence.metamodel.SingularAttribute getIdAttribute()
public void setIdAttribute(javax.persistence.metamodel.SingularAttribute idAttribute)
idAttribute - the idAttribute to setpublic void setEntityType(javax.persistence.metamodel.EntityType entityType)
Copyright © 2015. All Rights Reserved.