Class AliasManager

java.lang.Object
org.seasar.doma.jdbc.criteria.query.AliasManager

public class AliasManager extends Object
The AliasManager class is responsible for managing alias mappings for entity and property metamodels. It helps in generating and retrieving unique aliases for entities and their associated properties to ensure consistency in database queries.

This class provides both static factory methods for instantiation and functionality to link to a parent AliasManager to resolve aliases hierarchically.

  • Field Details

  • Constructor Details

    • AliasManager

      @Deprecated public AliasManager(Context context)
      Deprecated.
      Constructs an instance of AliasManager.

      This constructor is marked as @Deprecated. Usage of of(Config, Context) or of(Config, Context, AliasManager) is recommended.

      Parameters:
      context - the context containing the entity metamodels; must not be null
      Throws:
      NullPointerException - if context is null
    • AliasManager

      @Deprecated public AliasManager(Context context, AliasManager parent)
      Deprecated.
      Constructs an instance of AliasManager.

      This constructor is marked as @Deprecated. Usage of of(Config, Context) or of(Config, Context, AliasManager) is recommended.

      Parameters:
      context - the context containing the entity metamodels; must not be null
      parent - the parent AliasManager, or null if none
      Throws:
      NullPointerException - if context is null
  • Method Details

    • getAlias

      public String getAlias(EntityMetamodel<?> entityMetamodel)
      Retrieves the alias corresponding to the given EntityMetamodel.
      Parameters:
      entityMetamodel - the entity metamodel for which the alias is to be retrieved; must not be null
      Returns:
      the alias as a String, or null if no alias is found
    • getAlias

      public String getAlias(PropertyMetamodel<?> propertyMetamodel)
      Retrieves the alias for the given PropertyMetamodel.
      Parameters:
      propertyMetamodel - the property metamodel for which the alias is to be retrieved; must not be null
      Returns:
      the alias as a String, or null if no alias is found
    • asParent

      protected AliasManager asParent()
    • create

      public static AliasManager create(Config config, Context context)
      Creates a new instance of AliasManager using the provided configuration and context.
      Parameters:
      config - the runtime configuration for DAOs; must not be null
      context - the context containing the entity metamodels; must not be null
      Returns:
      a new instance of AliasManager
      Throws:
      NullPointerException - if config or context is null
    • createEmpty

      public static AliasManager createEmpty(Config config, Context context)
      Creates an empty instance of AliasManager with the provided configuration and context.
      Parameters:
      config - the runtime configuration for DAOs; must not be null
      context - the context containing the entity metamodels; must not be null
      Returns:
      a new instance of EmptyAliasManager with a default aliasing strategy
      Throws:
      NullPointerException - if config or context is null
    • createChild

      public static AliasManager createChild(Config config, Context context, AliasManager parent)
      Creates a child instance of AliasManager using the provided configuration, context, and parent AliasManager.
      Parameters:
      config - the runtime configuration for DAOs; must not be null
      context - the context containing the entity metamodels; must not be null
      parent - the parent AliasManager; must not be null
      Returns:
      a new child instance of AliasManager
      Throws:
      NullPointerException - if config, context, or parent is null