Package adalid.core

Class AbstractPersistentEntity

All Implemented Interfaces:
Wrappable, AnnotatableArtifact, Artifact, CalculableProperty, DataArtifact, DatabaseEntity, Entity, EntityReference, EntityReferenceContainer, Nullable, Parameter, PersistentEntity, PersistentEntityReference, Property, TypedArtifact, ValuedArtifact, Serializable, Comparable<Entity>
Direct Known Subclasses:
AbstractPersistentEnumerationEntity, Aplicacion, ArchivoAdjunto, AtributoAplicacion, ClaseRecurso, ColumnasOcultas, ConjuntoSegmento, DialogoDinamicoRemoto, Dominio, DominioParametro, ElementoSegmento, FiltroFuncion, FiltroFuncionPar, Funcion, FuncionParametro, GrupoProceso, GrupoUsuario, MensajeAplicacion, ModuloAplicacion, OpcionMenu, Pagina, PaginaEspecial, PaginaUsuario, Parametro, PasoRutina, PersistentEntityBase, RastroFuncion, RastroFuncionPar, RastroInforme, RastroProceso, RecursoValor, Rol, RolAplicacion, RolFiltroFuncion, RolFuncion, RolFuncionPar, RolPagina, RolPaginaEspecial, RolUsuario, RolVistaFuncion, RutinaUsuario, Segmento, TareaUsuario, TareaUsuarioCorreo, TareaVirtual, Usuario, UsuarioFuncion, UsuarioFuncionPar, UsuarioModulo, UsuarioSegmento, VariableRutina, VistaFuncion, VistaFuncionCol

public abstract class AbstractPersistentEntity extends AbstractDatabaseEntity implements PersistentEntityReference
Author:
Jorge Campins
See Also:
  • Constructor Details

    • AbstractPersistentEntity

      public AbstractPersistentEntity(Artifact declaringArtifact, Field declaringField)
  • Method Details

    • getKeyFeatures

      public String getKeyFeatures(String prefix, String suffix)
      Specified by:
      getKeyFeatures in interface Artifact
      Overrides:
      getKeyFeatures in class AbstractDataArtifact
      Parameters:
      prefix - prefijo
      suffix - sufijo
      Returns:
      the key features
    • finalise

      public boolean finalise()
      Description copied from interface: Artifact
      dot the i's and cross the t's
      Specified by:
      finalise in interface Artifact
      Overrides:
      finalise in class AbstractEntity
      Returns:
      true if this artifact was successfully finalised; otherwise false
    • finish

      public boolean finish()
      Description copied from interface: Artifact
      dot the i's and cross the t's
      Specified by:
      finish in interface Artifact
      Overrides:
      finish in class AbstractEntity
      Returns:
      true if this artifact was successfully finished; otherwise false
    • getUniqueKeyPropertiesList

      public List<Property> getUniqueKeyPropertiesList()
      Specified by:
      getUniqueKeyPropertiesList in interface PersistentEntity
      Returns:
      the properties that are columns of a unique key
    • linkForeignQueryEntityReferences

      protected void linkForeignQueryEntityReferences()
    • getBaseTableClass

      public Class<?> getBaseTableClass()
      Specified by:
      getBaseTableClass in interface PersistentEntity
      Returns:
      the base table class
    • getBaseTableRoot

      public PersistentEntity getBaseTableRoot()
      Specified by:
      getBaseTableRoot in interface PersistentEntity
      Returns:
      the root entity instance of the base table class
    • getInheritanceMappingStrategy

      public InheritanceMappingStrategy getInheritanceMappingStrategy()
      Specified by:
      getInheritanceMappingStrategy in interface PersistentEntity
      Returns:
      the inheritanceMappingStrategy
    • getDiscriminatorFieldName

      public String getDiscriminatorFieldName()
      Returns:
      the discriminator property name
    • getDiscriminatorField

      public Field getDiscriminatorField()
      Returns:
      the discriminator property field
    • getDiscriminatorProperty

      public Property getDiscriminatorProperty()
      Specified by:
      getDiscriminatorProperty in interface PersistentEntity
      Returns:
      the discriminator property
    • getDiscriminatorValue

      public String getDiscriminatorValue()
      Specified by:
      getDiscriminatorValue in interface PersistentEntity
      Returns:
      the discriminatorValue
    • isTriggerBeforeValueEnabled

      public boolean isTriggerBeforeValueEnabled()
      Specified by:
      isTriggerBeforeValueEnabled in interface PersistentEntity
      Returns:
      the triggerBeforeValueEnabled
    • isTriggerAfterValueEnabled

      public boolean isTriggerAfterValueEnabled()
      Specified by:
      isTriggerAfterValueEnabled in interface PersistentEntity
      Returns:
      the triggerAfterValueEnabled
    • isTriggerBeforeCheckEnabled

      public boolean isTriggerBeforeCheckEnabled()
      Specified by:
      isTriggerBeforeCheckEnabled in interface PersistentEntity
      Returns:
      the triggerBeforeCheckEnabled
    • isTriggerAfterCheckEnabled

      public boolean isTriggerAfterCheckEnabled()
      Specified by:
      isTriggerAfterCheckEnabled in interface PersistentEntity
      Returns:
      the triggerAfterCheckEnabled
    • isForeignKey

      public boolean isForeignKey()
      Specified by:
      isForeignKey in interface PersistentEntityReference
      Returns:
      true is the entity defines a foreign key
    • getOnDeleteAction

      public OnDeleteAction getOnDeleteAction()
      Specified by:
      getOnDeleteAction in interface PersistentEntityReference
      Returns:
      the onDeleteAction
    • getOnUpdateAction

      public OnUpdateAction getOnUpdateAction()
      Specified by:
      getOnUpdateAction in interface PersistentEntityReference
      Returns:
      the onUpdateAction
    • isAnnotatedWithInheritanceMapping

      public boolean isAnnotatedWithInheritanceMapping()
      Returns:
      the InheritanceMapping annotation indicator
    • isAnnotatedWithDiscriminatorValue

      public boolean isAnnotatedWithDiscriminatorValue()
      Returns:
      the DiscriminatorValue annotation indicator
    • isAnnotatedWithEntityTriggers

      public boolean isAnnotatedWithEntityTriggers()
      Returns:
      the EntityTriggers annotation indicator
    • isAnnotatedWithForeignKey

      public boolean isAnnotatedWithForeignKey()
      Returns:
      the ForeignKey annotation indicator
    • getValidTypeAnnotations

      protected List<Class<? extends Annotation>> getValidTypeAnnotations()
      Overrides:
      getValidTypeAnnotations in class AbstractEntity
    • getValidFieldAnnotations

      protected List<Class<? extends Annotation>> getValidFieldAnnotations()
      Overrides:
      getValidFieldAnnotations in class AbstractEntity
    • isTable

      public boolean isTable()
      Specified by:
      isTable in interface PersistentEntity
      Returns:
      the table indicator
    • isNotTable

      public boolean isNotTable()
      Specified by:
      isNotTable in interface PersistentEntity
      Returns:
      the table indicator
    • isJoinedTable

      public boolean isJoinedTable()
      Specified by:
      isJoinedTable in interface PersistentEntity
      Returns:
      the joined table indicator
    • isNotJoinedTable

      public boolean isNotJoinedTable()
      Specified by:
      isNotJoinedTable in interface PersistentEntity
      Returns:
      the joined table indicator
    • getDiscriminatorType

      public String getDiscriminatorType()
      Returns:
      the discriminator type
    • getJoinBaseEntity

      public PersistentEntity getJoinBaseEntity()
      Specified by:
      getJoinBaseEntity in interface PersistentEntity
      Returns:
      the join base entity
    • getColumnsList

      public List<Property> getColumnsList()
      Specified by:
      getColumnsList in interface PersistentEntity
      Returns:
      the properties that are columns
    • getEntityTriggerColumnsList

      public List<Property> getEntityTriggerColumnsList()
      Returns:
      the properties that are columns
    • getMatchingColumnsList

      public List<Property> getMatchingColumnsList(List<Property> properties)
      Parameters:
      properties - properties
      Returns:
      the properties that are columns
    • getDataProviderColumnsList

      public List<Property> getDataProviderColumnsList()
      Specified by:
      getDataProviderColumnsList in interface PersistentEntity
      Returns:
      the properties that are columns
    • getEntityClassColumnsList1

      public List<Property> getEntityClassColumnsList1()
      Returns:
      the properties that are not entities
    • getEntityClassColumnsList2

      public List<Property> getEntityClassColumnsList2()
      Returns:
      the properties that are entities
    • getEntityClassColumnsList3

      public List<Property> getEntityClassColumnsList3()
      Returns:
      the properties that reference this entity
    • isUpdateFilterAlsoCheck

      public boolean isUpdateFilterAlsoCheck()
    • getChecksList

      public List<Expression> getChecksList()
      Returns:
      the expressions that are checks
    • getChecksList

      public List<Expression> getChecksList(Checkpoint checkpoint)
      Parameters:
      checkpoint - the point at which the check is performed
      Returns:
      the expressions that are checks checked at the specified checkpoint
    • getChecksList

      public List<Expression> getChecksList(Checkpoint checkpoint, boolean inheritedless)
      Parameters:
      checkpoint - the point at which the check is performed
      inheritedless - exclude inherited checks or not
      Returns:
      the expressions that are checks checked at the specified checkpoint
    • getInsertableRowsList

      public List<Instance> getInsertableRowsList()
      Returns:
      the insertable rows
    • getQueryTable

      public QueryTable getQueryTable()
      Specified by:
      getQueryTable in interface PersistentEntity
      Returns:
      the queryTable
    • getQueryTable

      public QueryTable getQueryTable(int maxDepth)
      Parameters:
      maxDepth - max depth
      Returns:
      the queryTable
    • getQueryTable

      public QueryTable getQueryTable(VirtualEntityType virtualEntityType)
      Parameters:
      virtualEntityType - virtual entity type
      Returns:
      the queryTable
    • getQueryTable

      public QueryTable getQueryTable(int maxDepth, VirtualEntityType virtualEntityType)
      Parameters:
      maxDepth - max depth
      virtualEntityType - virtual entity type
      Returns:
      the queryTable
    • getSearchQueryTable

      public QueryTable getSearchQueryTable()
      Specified by:
      getSearchQueryTable in interface PersistentEntity
      Returns:
      the data searchQueryTable
    • getSearchQueryPropertiesList

      public List<Property> getSearchQueryPropertiesList()
      Specified by:
      getSearchQueryPropertiesList in interface PersistentEntity
      Returns:
      the searchQueryPropertiesList
    • getSearchQueryPropertiesMap

      public Map<String,Property> getSearchQueryPropertiesMap()
      Specified by:
      getSearchQueryPropertiesMap in interface PersistentEntity
      Returns:
      the searchQueryPropertiesMap
    • getEntityListReport

      public Report getEntityListReport()
      Returns:
      the entity list report
    • getChecksColumnsList

      public List<Property> getChecksColumnsList()
      Returns:
      the referenced columns list
    • getChecksColumnsList

      public List<Property> getChecksColumnsList(Checkpoint checkpoint)
      Parameters:
      checkpoint - the point at which the check is performed
      Returns:
      the referenced columns list
    • getChecksColumnsMap

      public Map<String,Property> getChecksColumnsMap()
      Returns:
      the referenced columns map
    • getChecksColumnsMap

      public Map<String,Property> getChecksColumnsMap(Checkpoint checkpoint)
      Parameters:
      checkpoint - the point at which the check is performed
      Returns:
      the referenced columns map
    • getChecksJoinsList

      public List<QueryJoin> getChecksJoinsList()
      Returns:
      the referenced joins list
    • getChecksJoinsList

      public List<QueryJoin> getChecksJoinsList(Checkpoint checkpoint)
      Parameters:
      checkpoint - the point at which the check is performed
      Returns:
      the referenced joins list
    • getChecksJoinsMap

      public Map<String,QueryJoin> getChecksJoinsMap()
      Returns:
      the referenced joins map
    • getChecksJoinsMap

      public Map<String,QueryJoin> getChecksJoinsMap(Checkpoint checkpoint)
      Parameters:
      checkpoint - the point at which the check is performed
      Returns:
      the referenced joins map
    • getInitialValueColumnsList

      public List<Property> getInitialValueColumnsList()
      Returns:
      the referenced columns list
    • getInitialValueColumnsMap

      public Map<String,Property> getInitialValueColumnsMap()
      Returns:
      the referenced columns map
    • getInitialValueJoinsList

      public List<QueryJoin> getInitialValueJoinsList()
      Returns:
      the referenced joins list
    • getInitialValueJoinsMap

      public Map<String,QueryJoin> getInitialValueJoinsMap()
      Returns:
      the referenced joins map
    • getDefaultValueColumnsList

      public List<Property> getDefaultValueColumnsList()
      Returns:
      the referenced columns list
    • getDefaultValueColumnsList

      public List<Property> getDefaultValueColumnsList(String checkpoints, String conditions)
      Parameters:
      checkpoints - valid checkpoint names (null for all)
      conditions - valid conditions names (null for all)
      Returns:
      the referenced columns list
    • getDefaultValueColumnsMap

      public Map<String,Property> getDefaultValueColumnsMap()
      Returns:
      the referenced columns map
    • getDefaultValueColumnsMap

      public Map<String,Property> getDefaultValueColumnsMap(String checkpoints, String conditions)
      Parameters:
      checkpoints - valid checkpoint names (null for all)
      conditions - valid conditions names (null for all)
      Returns:
      the referenced columns map for sql functions
    • getDefaultValueJoinsList

      public List<QueryJoin> getDefaultValueJoinsList()
      Returns:
      the referenced joins list
    • getDefaultValueJoinsList

      public List<QueryJoin> getDefaultValueJoinsList(String checkpoints, String conditions)
      Parameters:
      checkpoints - valid checkpoint names (null for all)
      conditions - valid conditions names (null for all)
      Returns:
      the referenced joins list
    • getDefaultValueJoinsList

      public List<QueryJoin> getDefaultValueJoinsList(String checkpoints, String conditions, boolean calculableless)
      Parameters:
      checkpoints - valid checkpoint names (null for all)
      conditions - valid conditions names (null for all)
      calculableless - exclude values referencing calculable properties
      Returns:
      the referenced joins list
    • getDefaultValueJoinsMap

      public Map<String,QueryJoin> getDefaultValueJoinsMap()
      Returns:
      the referenced joins map
    • getDefaultValueJoinsMap

      public Map<String,QueryJoin> getDefaultValueJoinsMap(String checkpoints, String conditions)
      Parameters:
      checkpoints - valid checkpoint names (null for all)
      conditions - valid conditions names (null for all)
      Returns:
      the referenced joins map
    • getDefaultValueJoinsMap

      public Map<String,QueryJoin> getDefaultValueJoinsMap(String checkpoints, String conditions, boolean calculableless)
      Parameters:
      checkpoints - valid checkpoint names (null for all)
      conditions - valid conditions names (null for all)
      calculableless - exclude values referencing calculable properties
      Returns:
      the referenced joins map
    • getJoinedTablePropertiesList

      public List<Property> getJoinedTablePropertiesList()
      Specified by:
      getJoinedTablePropertiesList in interface PersistentEntity
    • getJoinedTablePropertiesMap

      public Map<String,Property> getJoinedTablePropertiesMap()
      Specified by:
      getJoinedTablePropertiesMap in interface PersistentEntity
    • getJoinedTableMatchingPropertiesList

      public List<Property> getJoinedTableMatchingPropertiesList(Map<String,Property> someProperties)
      Specified by:
      getJoinedTableMatchingPropertiesList in interface PersistentEntity
    • getJoinedTableMatchingPropertiesMap

      public Map<String,Property> getJoinedTableMatchingPropertiesMap(Map<String,Property> someProperties)
      Specified by:
      getJoinedTableMatchingPropertiesMap in interface PersistentEntity
    • getSingleJoinedTablePropertiesList

      public List<Property> getSingleJoinedTablePropertiesList(Map<String,Property> someProperties)
      Specified by:
      getSingleJoinedTablePropertiesList in interface PersistentEntity
    • getSingleJoinedTablePropertiesMap

      public Map<String,Property> getSingleJoinedTablePropertiesMap(Map<String,Property> someProperties)
      Specified by:
      getSingleJoinedTablePropertiesMap in interface PersistentEntity
    • getCrossReferencedExpressionsSet

      public Set<String> getCrossReferencedExpressionsSet()
      Specified by:
      getCrossReferencedExpressionsSet in interface PersistentEntity
    • getDefaultWrapperClass

      public Class<? extends PersistentEntityReferenceWrapper> getDefaultWrapperClass()
      Specified by:
      getDefaultWrapperClass in interface Wrappable
      Overrides:
      getDefaultWrapperClass in class AbstractEntity
      Returns:
      the default wrapper class
    • fieldsToString

      protected String fieldsToString(int n, String key, boolean verbose, boolean fields, boolean maps)
      Overrides:
      fieldsToString in class AbstractEntity