Class AggregateMetadata<T,K>
- java.lang.Object
-
- com.totvs.tjf.repository.aggregate.metadata.AggregateMetadata<T,K>
-
- Type Parameters:
T-@Aggregateclass.K-@AggregateIdentifierclass.
public final class AggregateMetadata<T,K> extends Object
Metadata for@Aggregatetypes- Author:
- Thiago A. de Souza Weber
-
-
Constructor Summary
Constructors Constructor Description AggregateMetadata(Class<?> repositoryClass)Class constructor with all fields
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KgetIdentifier(T instance)Try to retrieve the@AggregateIdentifiervalue from the given@Aggregateinstance.StringgetIdentifierProperty()Class<K>getIdentifierType()KgetIdentifierValue(Object value)Try to get the@AggregateIdentifiervalue according with its instance type.javax.persistence.TablegetTableAnnotation()StringgetTableName()Class<T>getType()booleanisTenantable()voidnotifyEvent(Class<?> event, Object value)This method notifies all the event listeners about an specific event and value.booleansupportsMetadataInfo()
-
-
-
Constructor Detail
-
AggregateMetadata
public AggregateMetadata(Class<?> repositoryClass)
Class constructor with all fields- Parameters:
repositoryClass-
-
-
Method Detail
-
getIdentifierProperty
public String getIdentifierProperty()
- Returns:
@AggregateIdentifierproperty name
-
isTenantable
public boolean isTenantable()
- Returns:
trueif this aggregate supports multitenancy
-
getTableAnnotation
public javax.persistence.Table getTableAnnotation()
- Returns:
- tableAnnotation if this annotation is present
-
supportsMetadataInfo
public boolean supportsMetadataInfo()
- Returns:
trueif this aggregate supports metadata info
-
getTableName
public String getTableName()
- Returns:
- this aggregate table name
-
getIdentifier
public K getIdentifier(T instance)
Try to retrieve the@AggregateIdentifiervalue from the given@Aggregateinstance.- Parameters:
instance- theAggregateinstance.- Returns:
- the
@AggregateIdentifiervalue. - See Also:
AbstractNestablePropertyAccessor.getPropertyValue(String)
-
getIdentifierValue
public K getIdentifierValue(Object value)
Try to get the@AggregateIdentifiervalue according with its instance type.- Parameters:
value- identifier value- Returns:
- value casted to the identifier class type
-
-