Package org.faktorips.runtime.model.type
Class TableUsage
java.lang.Object
org.faktorips.runtime.model.type.ModelElement
org.faktorips.runtime.model.type.TypePart
org.faktorips.runtime.model.type.TableUsage
Describes the model information for a table usage.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionITable<?>getTable(IProductComponent productComponent, Calendar effectiveDate) Returns the table the given product component references for this table usage.getTableName(IProductComponent productComponent, Calendar effectiveDate) Returns the name of the table for the given product component that references a table usage.Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated.Returns a list of models for the table structures referenced in this table usage..booleanChecks whether this part is changing over time (resides in the generation) or not (resides in the product component).booleanDetermines whether the associated table usage is marked as required.voidsetTableName(String tableName, IProductComponentGeneration generation) Set the table name using a product component generation.voidsetTableName(String tableName, IProductComponent productComponent, Calendar effectiveDate) Sets the name of the table for the given product component that references a table usage.toString()voidvalidate(MessageList list, IValidationContext context, IProductComponent productComponent, Calendar effectiveDate) Validates this part's configuration in the given product against the model.Methods inherited from class org.faktorips.runtime.model.type.TypePart
getMessageHelper, getMessageKey, getModelType, getType, getTypeNameMethods inherited from class org.faktorips.runtime.model.type.ModelElement
createMessageHelper, getDeprecation, getDescription, getDocumentation, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRelevantProductObject, getRelevantProductObject, invokeField, invokeMethod, isDeprecated
-
Field Details
-
MSGCODE_REQUIRED_TABLE_IS_NOT_SET
- See Also:
-
MSGKEY_REQUIRED_TABLE_IS_NOT_SET
- See Also:
-
PROPERTY_REQUIRED_TABLE
- See Also:
-
-
Constructor Details
-
TableUsage
-
-
Method Details
-
getTable
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 isnullthe 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 instanceeffectiveDate- the date to determine the product component generation. Ifnullthe 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
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 isnullthe 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 instanceeffectiveDate- the date to determine the product component generation. Ifnullthe 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 isnullthe 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 componentproductComponent- The product component that holds the table instanceeffectiveDate- the date to determine the product component generation. Ifnullthe latest generation is used. Is ignored if the table usage configuration is not changing over time.- Since:
- 24.7
-
setTableName
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 componentgeneration- 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
IpsTableUsageannotation from the getter method and checks therequiredattribute of the annotation.- Returns:
trueif therequiredattribute of theIpsTableUsageannotation is set totrue; otherwise,false.- Since:
- 25.1
-
validate
public void validate(MessageList list, IValidationContext context, IProductComponent productComponent, Calendar effectiveDate) Description copied from class:TypePartValidates this part's configuration in the given product against the model.- Overrides:
validatein classTypePart- Parameters:
list- aMessageList, to which validation messages may be addedcontext- theIValidationContext, needed to determine theLocalein which to createMessagesproductComponent- theIProductComponentto validateeffectiveDate- the date that determines whichIProductComponentGenerationis to be validated, if theIProductComponenthas any and this partis changing over time
-
isChangingOverTime
public boolean isChangingOverTime()Description copied from class:TypePartChecks whether this part is changing over time (resides in the generation) or not (resides in the product component).- Specified by:
isChangingOverTimein classTypePart- Returns:
- whether this association is changing over time
-
getTableStructure
Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated. UsegetTableStructures()instead.- Returns:
- the model for the table structure referenced in this table usage.
- Throws:
UnsupportedOperationException- if this table usage uses multiple table structures.
-
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
- Overrides:
toStringin classModelElement
-