Class TableUsage


public class TableUsage extends TypePart
Describes the model information for a table usage.
  • Field Details

  • Constructor Details

    • TableUsage

      public TableUsage(Type parent, Method getter)
  • Method Details

    • getTable

      public ITable<?> getTable(IProductComponent productComponent, Calendar effectiveDate)
      Returns the table the given product component references for this table usage. If this table usage is changing over time (resides in the generation) the date is used to retrieve the correct generation. If the date is null the latest generation is used. If the table usage is not changing over time the date will be ignored.
      Parameters:
      productComponent - The product component that holds the table instance
      effectiveDate - the date to determine the product component generation. If null the latest generation is used. Is ignored if the table usage configuration is not changing over time.
      Returns:
      The table instance hold by the product component and is identified by this table usage
    • getTableName

      public String getTableName(IProductComponent productComponent, Calendar effectiveDate)
      Returns the name of the table for the given product component that references a table usage. If this table usage is changing over time (resides in the generation) the date is used to retrieve the correct generation. If the date is null the latest generation is used. If the table usage is not changing over time the date will be ignored.
      Parameters:
      productComponent - The product component that holds the table instance
      effectiveDate - the date to determine the product component generation. If null the latest generation is used. Is ignored if the table usage configuration is not changing over time.
      Returns:
      The name of the table for this table usage in the product component
      Since:
      24.7
    • setTableName

      public void setTableName(String tableName, IProductComponent productComponent, Calendar effectiveDate)
      Sets the name of the table for the given product component that references a table usage. If this table usage is changing over time (resides in the generation) the date is used to retrieve the correct generation. If the date is null the latest generation is used. If the table usage is not changing over time the date will be ignored.
      Parameters:
      tableName - The name of the table for this table usage in the product component
      productComponent - The product component that holds the table instance
      effectiveDate - the date to determine the product component generation. If null the latest generation is used. Is ignored if the table usage configuration is not changing over time.
      Since:
      24.7
    • setTableName

      public void setTableName(String tableName, IProductComponentGeneration generation)
      Set the table name using a product component generation.

      If the table usage is not changing over time, the underlying product component is used directly; otherwise, the provided generation is used.

      Parameters:
      tableName - the name of the table for this table usage in the product component
      generation - the product component generation to determine the target product component for setting the table name
      Since:
      25.1
    • isRequired

      public boolean isRequired()
      Determines whether the associated table usage is marked as required.

      This method retrieves the IpsTableUsage annotation from the getter method and checks the required attribute of the annotation.

      Returns:
      true if the required attribute of the IpsTableUsage annotation is set to true; otherwise, false.
      Since:
      25.1
    • validate

      public void validate(MessageList list, IValidationContext context, IProductComponent productComponent, Calendar effectiveDate)
      Description copied from class: TypePart
      Validates this part's configuration in the given product against the model.
      Overrides:
      validate in class TypePart
      Parameters:
      list - a MessageList, to which validation messages may be added
      context - the IValidationContext, needed to determine the Locale in which to create Messages
      productComponent - the IProductComponent to validate
      effectiveDate - the date that determines which IProductComponentGeneration is to be validated, if the IProductComponent has any and this part is changing over time
    • isChangingOverTime

      public boolean isChangingOverTime()
      Description copied from class: TypePart
      Checks whether this part is changing over time (resides in the generation) or not (resides in the product component).
      Specified by:
      isChangingOverTime in class TypePart
      Returns:
      whether this association is changing over time
    • getTableStructure

      @Deprecated(forRemoval=true) public TableStructure getTableStructure()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is deprecated. Use getTableStructures() instead.
      Returns:
      the model for the table structure referenced in this table usage.
      Throws:
      UnsupportedOperationException - if this table usage uses multiple table structures.
    • getTableStructures

      public List<TableStructure> getTableStructures()
      Returns a list of models for the table structures referenced in this table usage..
      Returns:
      a list of models for the table structures referenced in this table usage.
    • toString

      public String toString()
      Overrides:
      toString in class ModelElement