Class AggregateMetadata<T,​K>

  • Type Parameters:
    T - @Aggregate class.
    K - @AggregateIdentifier class.

    public final class AggregateMetadata<T,​K>
    extends Object
    Metadata for @Aggregate types
    Author:
    Thiago A. de Souza Weber
    • Constructor Detail

      • AggregateMetadata

        public AggregateMetadata​(Class<?> repositoryClass)
        Class constructor with all fields
        Parameters:
        repositoryClass -
    • Method Detail

      • getType

        public Class<T> getType()
        Returns:
        @Aggregate class reference
      • getIdentifierType

        public Class<K> getIdentifierType()
        Returns:
        @AggregateIdentifier class reference
      • getIdentifierProperty

        public String getIdentifierProperty()
        Returns:
        @AggregateIdentifier property name
      • isTenantable

        public boolean isTenantable()
        Returns:
        true if this aggregate supports multitenancy
      • getTableAnnotation

        public javax.persistence.Table getTableAnnotation()
        Returns:
        tableAnnotation if this annotation is present
      • supportsMetadataInfo

        public boolean supportsMetadataInfo()
        Returns:
        true if this aggregate supports metadata info
      • getTableName

        public String getTableName()
        Returns:
        this aggregate table name
      • getIdentifier

        public K getIdentifier​(T instance)
        Try to retrieve the @AggregateIdentifier value from the given @Aggregate instance.
        Parameters:
        instance - the Aggregate instance.
        Returns:
        the @AggregateIdentifier value.
        See Also:
        AbstractNestablePropertyAccessor.getPropertyValue(String)
      • getIdentifierValue

        public K getIdentifierValue​(Object value)
        Try to get the @AggregateIdentifier value according with its instance type.
        Parameters:
        value - identifier value
        Returns:
        value casted to the identifier class type
      • notifyEvent

        public void notifyEvent​(Class<?> event,
                                Object value)
        This method notifies all the event listeners about an specific event and value.
        Parameters:
        event - - the event to be notified
        value - - the value/state of this event