Module is.codion.framework.domain
Interface ColumnDefinition.Builder<T,B extends ColumnDefinition.Builder<T,B>>
- Type Parameters:
T
- the underlying typeB
- the builder type
- All Superinterfaces:
AttributeDefinition.Builder<T,
B>
- Enclosing interface:
- ColumnDefinition<T>
public static interface ColumnDefinition.Builder<T,B extends ColumnDefinition.Builder<T,B>>
extends AttributeDefinition.Builder<T,B>
Builds a
ColumnDefinition
-
Method Summary
Modifier and TypeMethodDescriptionaggregate
(boolean aggregate) Specifies that this column is an aggregate function column.<C> B
columnClass
(Class<C> columnClass, Column.Converter<T, C> converter) Sets the actual column type, and the requiredColumn.Converter
.<C> B
columnClass
(Class<C> columnClass, Column.Converter<T, C> converter, Column.Fetcher<C> fetcher) Sets the actual column type, and the requiredColumn.Converter
.columnHasDefaultValue
(boolean columnHasDefaultValue) Specifies that the underlying table column has a default valueexpression
(String expression) groupBy
(boolean groupBy) Specifies that this column should be grouped by.insertable
(boolean insertable) lazy
(boolean lazy) Sets the actual string used as column when queryingreadOnly
(boolean readOnly) Specifies whether this column should be included during insert and update operationssearchable
(boolean searchable) Specifies whether this column should be included when searching for an entity by a string value.selectable
(boolean selectable) Specifies whether this column should be included in select queriesupdatable
(boolean updatable) Methods inherited from interface is.codion.framework.domain.entity.attribute.AttributeDefinition.Builder
attribute, beanProperty, build, caption, captionResourceKey, comparator, dateTimePattern, decimalRoundingMode, defaultValue, defaultValue, description, format, hidden, items, localeDateTimePattern, maximumFractionDigits, maximumLength, maximumValue, minimumValue, mnemonic, nullable, numberFormatGrouping, valueRange
-
Method Details
-
columnClass
Sets the actual column type, and the requiredColumn.Converter
.- Type Parameters:
C
- the column type- Parameters:
columnClass
- the underlying column type classconverter
- the converter to use when converting to and from column values- Returns:
- this instance
-
columnClass
Sets the actual column type, and the requiredColumn.Converter
.- Type Parameters:
C
- the column type- Parameters:
columnClass
- the underlying column type classconverter
- the converter to use when converting to and from column valuesfetcher
- the fetcher to use to retrieve the value from a ResultSet- Returns:
- this instance
-
name
Sets the actual string used as column when querying- Parameters:
name
- the column name- Returns:
- this instance
-
expression
- Parameters:
expression
- the column expression to use when selecting- Returns:
- this instance
-
readOnly
Specifies whether this column should be included during insert and update operations- Parameters:
readOnly
- true if this column should be read-only- Returns:
- this instance
-
insertable
- Parameters:
insertable
- specifies whether this column should be included during insert operations- Returns:
- this instance
-
updatable
- Parameters:
updatable
- specifies whether this column is updatable- Returns:
- this instance
-
columnHasDefaultValue
Specifies that the underlying table column has a default value- Parameters:
columnHasDefaultValue
- true if the column has a default value- Returns:
- this instance
-
groupBy
Specifies that this column should be grouped by. Also specifies that this column is not an aggregate function column.- Parameters:
groupBy
- true if this is a grouping column- Returns:
- this instance
-
aggregate
Specifies that this column is an aggregate function column. Also specifies that this column should not be grouped by.- Parameters:
aggregate
- true if this is an aggregate function column- Returns:
- this instance
-
selectable
Specifies whether this column should be included in select queries- Parameters:
selectable
- true if this column should be included in select queries- Returns:
- this instance
-
lazy
- Parameters:
lazy
- true if this column should be lazily loaded- Returns:
- this instance
-
searchable
Specifies whether this column should be included when searching for an entity by a string value. Only applicable to attributes of typeTypes.VARCHAR
.- Parameters:
searchable
- true if this column is a searchable column- Returns:
- this instance
- Throws:
IllegalStateException
- in case this column type is not String
-