com.ibm.mm.sdk.common
Interface dkAttrDef
-
- All Known Implementing Classes:
- dkAbstractAttrDef, DKAttrDefICM
public interface dkAttrDefInterface for defining attribute metadata in CM8.An attribute definition describes the characteristics of a property or field within a CM8 entity, including its name, data type, nullability, and cardinality constraints (min/max occurrences).
Attribute Properties:
- Name: Unique identifier for the attribute
- Type: Data type (string, integer, date, etc.)
- Nullable: Whether null values are allowed
- Cardinality: Min/max number of values (for multi-valued attributes)
Data Types: Attribute types are defined by constants in
DKConstant, such as DK_CM_STRING, DK_CM_INTEGER, DK_CM_TIMESTAMP, etc.Example usage:
dkAttrDef attrDef = datastore.createAttrDef(); attrDef.setName("InvoiceNumber"); attrDef.setDescription("Unique invoice identifier"); attrDef.setType(DKConstant.DK_CM_STRING); attrDef.setNullable(false); attrDef.setMin(1); attrDef.setMax(1);- See Also:
dkEntityDef,DKConstant,dkDatastore
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description java.lang.StringgetDescription()Gets the description of this attribute definition.intgetMax()Gets the maximum cardinality (maximum number of values) for this attribute.intgetMin()Gets the minimum cardinality (minimum number of values) for this attribute.java.lang.StringgetName()Gets the name of this attribute definition.shortgetType()Gets the data type of this attribute.booleanisNullable()Checks if this attribute allows null values.voidsetDescription(java.lang.String description)Sets the description of this attribute definition.voidsetMax(int max)Sets the maximum cardinality (maximum number of values) for this attribute.voidsetMin(int min)Sets the minimum cardinality (minimum number of values) for this attribute.voidsetName(java.lang.String name)Sets the name of this attribute definition.voidsetNullable(boolean nullable)Sets whether this attribute allows null values.voidsetType(short type)Sets the data type of this attribute.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of this attribute definition.- Returns:
- the attribute name
-
setName
void setName(java.lang.String name)
Sets the name of this attribute definition.- Parameters:
name- the attribute name to set
-
getDescription
java.lang.String getDescription()
Gets the description of this attribute definition.- Returns:
- the attribute description
-
setDescription
void setDescription(java.lang.String description)
Sets the description of this attribute definition.- Parameters:
description- a human-readable description of the attribute
-
getType
short getType()
Gets the data type of this attribute.- Returns:
- the attribute type constant (e.g., DKConstant.DK_CM_STRING)
- See Also:
DKConstant
-
setType
void setType(short type)
Sets the data type of this attribute.- Parameters:
type- the attribute type constant (e.g., DKConstant.DK_CM_STRING)- See Also:
DKConstant
-
isNullable
boolean isNullable()
Checks if this attribute allows null values.- Returns:
- true if null values are allowed, false otherwise
-
setNullable
void setNullable(boolean nullable)
Sets whether this attribute allows null values.- Parameters:
nullable- true to allow null values, false to require a value
-
getMin
int getMin()
Gets the minimum cardinality (minimum number of values) for this attribute. For single-valued attributes, this is typically 0 or 1.- Returns:
- the minimum number of values
-
setMin
void setMin(int min)
Sets the minimum cardinality (minimum number of values) for this attribute.- Parameters:
min- the minimum number of values (0 for optional, 1 for required)
-
getMax
int getMax()
Gets the maximum cardinality (maximum number of values) for this attribute. For single-valued attributes, this is typically 1. Use -1 or Integer.MAX_VALUE for unbounded multi-valued attributes.- Returns:
- the maximum number of values
-
setMax
void setMax(int max)
Sets the maximum cardinality (maximum number of values) for this attribute.- Parameters:
max- the maximum number of values (1 for single-valued, greater than 1 for multi-valued)
-
-