-
- Type Parameters:
T
- the underlying type
- All Known Subinterfaces:
AuditProperty<T>
,BlobProperty
,ColumnProperty<T>
,DenormalizedProperty<T>
,DerivedProperty<T>
,ForeignKeyProperty
,ItemProperty<T>
,TransientProperty<T>
public interface Property<T>
Specifies a Property. Factory forProperty
instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Property.Builder<T,B extends Property.Builder<T,B>>
Builds a Property instancestatic interface
Property.ValueSupplier<T>
Supplies values, for example default ones.
-
Field Summary
Fields Modifier and Type Field Description static PropertyValue<String>
DATE_FORMAT
The default date format pattern to use when showing date values in tables and when creating default date input fields
Value type: String
Default value: dd-MM-yyyy [month/day order is locale specific]static PropertyValue<String>
DATE_TIME_FORMAT
The default date/time format pattern to use when showing date/time values in tables and when creating default date/time input fields
Value type: String
Default value: dd-MM-yyyy HH:mm [month/day order is locale specific]static PropertyValue<RoundingMode>
DECIMAL_ROUNDING_MODE
Specifies the default rounding mode used for decimal property values
Value type:RoundingMode
Default value:RoundingMode.HALF_EVEN
static PropertyValue<Character>
DECIMAL_SEPARATOR
Specifies the default number decimal separator.
Value type: Character
Default value: The decimal separator for the default localestatic int
DEFAULT_FOREIGN_KEY_FETCH_DEPTH
static int
DEFAULT_MAXIMUM_FRACTION_DIGITS
static PropertyValue<Integer>
FOREIGN_KEY_FETCH_DEPTH
Specifies the default foreign key fetch depth
Value type: Integer
Default value: 1static PropertyValue<Character>
GROUPING_SEPARATOR
Specifies the default number grouping separator.
Value type: Character
Default value: The grouping separator for the default localestatic PropertyValue<Integer>
MAXIMUM_FRACTION_DIGITS
Specifies the default maximum number of fraction digits for double property values
Note that values are rounded when set.
Value type: Integer
Default value: 10static PropertyValue<Boolean>
NUMBER_FORMAT_GROUPING
Specifies whether number format grouping is used by default
Value type: Boolean
Default value: falsestatic PropertyValue<String>
TIME_FORMAT
The default date format pattern to use when showing time values in tables and when creating default time input fields
Value type: String
Default value: HH:mmstatic PropertyValue<Boolean>
USE_LEXICAL_STRING_COMPARATOR
Specifies whether String values should use a lexical comparator by default
Value type: Boolean
Default value: true
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Attribute<T>
attribute()
TheAttribute
this property is based on, should be unique within an Entity.static <T extends Temporal,B extends ColumnProperty.Builder<T,B>>
ColumnProperty.Builder<T,B>auditInsertTimeProperty(Attribute<T> attribute)
Creates a newColumnProperty.Builder
instance, representing the time a record was inserted.static <T extends Temporal,B extends ColumnProperty.Builder<T,B>>
ColumnProperty.Builder<T,B>auditInsertTimeProperty(Attribute<T> attribute, String caption)
Creates a newColumnProperty.Builder
instance, representing the time a record was inserted.static <B extends ColumnProperty.Builder<String,B>>
ColumnProperty.Builder<String,B>auditInsertUserProperty(Attribute<String> attribute)
Creates a newColumnProperty.Builder
instance, representing the username of the user who inserted a record.static <B extends ColumnProperty.Builder<String,B>>
ColumnProperty.Builder<String,B>auditInsertUserProperty(Attribute<String> attribute, String caption)
Creates a newColumnProperty.Builder
instance, representing the username of the user who inserted a record.static <T extends Temporal,B extends ColumnProperty.Builder<T,B>>
ColumnProperty.Builder<T,B>auditUpdateTimeProperty(Attribute<T> attribute)
Creates a newColumnProperty.Builder
instance, representing the time a record was updated.static <T extends Temporal,B extends ColumnProperty.Builder<T,B>>
ColumnProperty.Builder<T,B>auditUpdateTimeProperty(Attribute<T> attribute, String caption)
Creates a newColumnProperty.Builder
instance, representing the time a record was updated.static <B extends ColumnProperty.Builder<String,B>>
ColumnProperty.Builder<String,B>auditUpdateUserProperty(Attribute<String> attribute)
Creates a newColumnProperty.Builder
instance, representing the username of the user who updated a record.static <B extends ColumnProperty.Builder<String,B>>
ColumnProperty.Builder<String,B>auditUpdateUserProperty(Attribute<String> attribute, String caption)
Creates a newColumnProperty.Builder
instance, representing the username of the user who updated a record.String
beanProperty()
static BlobProperty.Builder
blobProperty(Attribute<byte[]> attribute)
Creates a newBlobProperty.Builder
instance.static BlobProperty.Builder
blobProperty(Attribute<byte[]> attribute, String caption)
Creates a newBlobProperty.Builder
instance.static <C,B extends ColumnProperty.Builder<Boolean,B>>
ColumnProperty.Builder<Boolean,B>booleanProperty(Attribute<Boolean> attribute, Class<C> columnClass, C trueValue, C falseValue)
Creates a newColumnProperty.Builder
instance representing a Boolean value.static <C,B extends ColumnProperty.Builder<Boolean,B>>
ColumnProperty.Builder<Boolean,B>booleanProperty(Attribute<Boolean> attribute, String caption, Class<C> columnClass, C trueValue, C falseValue)
Creates a newColumnProperty.Builder
instance representing a Boolean value.static <T> ColumnProperty.ValueConverter<Boolean,T>
booleanValueConverter(T trueValue, T falseValue)
Creates a newColumnProperty.ValueConverter
instance for converting a column value representing a boolean value to and from an actual Boolean.String
caption()
static <T,B extends ColumnProperty.Builder<T,B>>
ColumnProperty.Builder<T,B>columnProperty(Attribute<T> attribute)
Creates a newColumnProperty.Builder
instance.static <T,B extends ColumnProperty.Builder<T,B>>
ColumnProperty.Builder<T,B>columnProperty(Attribute<T> attribute, String caption)
Creates a newColumnProperty.Builder
instance.Comparator<T>
comparator()
DateTimeFormatter
dateTimeFormatter()
Returns the date time formatter used when presenting and inputting values for this property.String
dateTimePattern()
Returns the date time format pattern used when presenting and inputting values for this property.RoundingMode
decimalRoundingMode()
T
defaultValue()
static <T,B extends ColumnProperty.Builder<T,B>>
ColumnProperty.Builder<T,B>denormalizedProperty(Attribute<T> attribute, Attribute<Entity> entityAttribute, Attribute<T> denormalizedAttribute)
Creates a newColumnProperty.Builder
instance, which value should mirror the value from an entity attribute.static <T,B extends ColumnProperty.Builder<T,B>>
ColumnProperty.Builder<T,B>denormalizedProperty(Attribute<T> attribute, String caption, Attribute<Entity> entityAttribute, Attribute<T> denormalizedAttribute)
Creates a newColumnProperty.Builder
instance, which value should mirror the value from an entity attribute.static <T,B extends TransientProperty.Builder<T,B>>
TransientProperty.Builder<T,B>denormalizedViewProperty(Attribute<T> attribute, Attribute<Entity> entityAttribute, Attribute<T> denormalizedAttribute)
Instantiates aTransientProperty.Builder
instance, for displaying a value from an entity attribute.static <T,B extends TransientProperty.Builder<T,B>>
TransientProperty.Builder<T,B>denormalizedViewProperty(Attribute<T> attribute, String caption, Attribute<Entity> entityAttribute, Attribute<T> denormalizedAttribute)
Instantiates aTransientProperty.Builder
instance, for displaying a value from an entity attribute.static <T,B extends TransientProperty.Builder<T,B>>
TransientProperty.Builder<T,B>derivedProperty(Attribute<T> attribute, DerivedProperty.Provider<T> valueProvider, Attribute<?>... sourceAttributes)
Instantiates aTransientProperty.Builder
instance, which value is derived from one or more source attributes.static <T,B extends TransientProperty.Builder<T,B>>
TransientProperty.Builder<T,B>derivedProperty(Attribute<T> attribute, String caption, DerivedProperty.Provider<T> valueProvider, Attribute<?>... sourceAttributes)
Instantiates aTransientProperty.Builder
instance, which value is derived from one or more source attributes.String
description()
EntityType
entityType()
static ForeignKeyProperty.Builder
foreignKeyProperty(ForeignKey foreignKey)
Instantiates aForeignKeyProperty.Builder
instance.static ForeignKeyProperty.Builder
foreignKeyProperty(ForeignKey foreignKey, String caption)
Instantiates aForeignKeyProperty.Builder
instance.Format
format()
Returns the Format used when presenting values for this property, null if none has been specified.boolean
hasDefaultValue()
boolean
isHidden()
boolean
isNullable()
static <T,B extends ColumnProperty.Builder<T,B>>
ColumnProperty.Builder<T,B>itemProperty(Attribute<T> attribute, String caption, List<Item<T>> validItems)
Creates a newColumnProperty.Builder
instance, based on the given items.static <T,B extends ColumnProperty.Builder<T,B>>
ColumnProperty.Builder<T,B>itemProperty(Attribute<T> attribute, List<Item<T>> validItems)
Creates a newColumnProperty.Builder
instance, based on the given items.int
maximumFractionDigits()
int
maximumLength()
Number
maximumValue()
Number
minimumValue()
Character
mnemonic()
Returns the mnemonic associated with this property.int
preferredColumnWidth()
T
prepareValue(T value)
Prepares the value according to the property configuration, such as rounding to the correct number of fraction digits in case of doublesstatic <T,B extends ColumnProperty.Builder<T,B>>
ColumnProperty.Builder<T,B>primaryKeyProperty(Attribute<T> attribute)
A convenience method for creating a newColumnProperty.Builder
instance, with the primary key index set to 0.static <T,B extends ColumnProperty.Builder<T,B>>
ColumnProperty.Builder<T,B>primaryKeyProperty(Attribute<T> attribute, String caption)
A convenience method for creating a newColumnProperty.Builder
instance, with the primary key index set to 0.static List<Property<?>>
sort(List<Property<?>> properties)
Sorts the given properties by caption, or if that is not available, attribute name, ignoring casestatic <T,B extends ColumnProperty.Builder<T,B>>
ColumnProperty.Builder<T,B>subqueryProperty(Attribute<T> attribute, String subquery)
Creates a newColumnProperty.Builder
instance, based on a subquery.static <T,B extends ColumnProperty.Builder<T,B>>
ColumnProperty.Builder<T,B>subqueryProperty(Attribute<T> attribute, String caption, String subquery)
Creates a newColumnProperty.Builder
instance, based on a subquery.String
toString(T value)
Returns a string representation of the given value formatted with this property's format.static <T,B extends TransientProperty.Builder<T,B>>
TransientProperty.Builder<T,B>transientProperty(Attribute<T> attribute)
Creates a newTransientProperty.Builder
instance, which does not map to an underlying table column.static <T,B extends TransientProperty.Builder<T,B>>
TransientProperty.Builder<T,B>transientProperty(Attribute<T> attribute, String caption)
Creates a newTransientProperty.Builder
instance, which does not map to an underlying table column.
-
-
-
Field Detail
-
DEFAULT_MAXIMUM_FRACTION_DIGITS
static final int DEFAULT_MAXIMUM_FRACTION_DIGITS
- See Also:
- Constant Field Values
-
DEFAULT_FOREIGN_KEY_FETCH_DEPTH
static final int DEFAULT_FOREIGN_KEY_FETCH_DEPTH
- See Also:
- Constant Field Values
-
MAXIMUM_FRACTION_DIGITS
static final PropertyValue<Integer> MAXIMUM_FRACTION_DIGITS
Specifies the default maximum number of fraction digits for double property values
Note that values are rounded when set.
Value type: Integer
Default value: 10
-
DECIMAL_ROUNDING_MODE
static final PropertyValue<RoundingMode> DECIMAL_ROUNDING_MODE
Specifies the default rounding mode used for decimal property values
Value type:RoundingMode
Default value:RoundingMode.HALF_EVEN
-
TIME_FORMAT
static final PropertyValue<String> TIME_FORMAT
The default date format pattern to use when showing time values in tables and when creating default time input fields
Value type: String
Default value: HH:mm
-
DATE_TIME_FORMAT
static final PropertyValue<String> DATE_TIME_FORMAT
The default date/time format pattern to use when showing date/time values in tables and when creating default date/time input fields
Value type: String
Default value: dd-MM-yyyy HH:mm [month/day order is locale specific]
-
DATE_FORMAT
static final PropertyValue<String> DATE_FORMAT
The default date format pattern to use when showing date values in tables and when creating default date input fields
Value type: String
Default value: dd-MM-yyyy [month/day order is locale specific]
-
NUMBER_FORMAT_GROUPING
static final PropertyValue<Boolean> NUMBER_FORMAT_GROUPING
Specifies whether number format grouping is used by default
Value type: Boolean
Default value: false
-
GROUPING_SEPARATOR
static final PropertyValue<Character> GROUPING_SEPARATOR
Specifies the default number grouping separator.
Value type: Character
Default value: The grouping separator for the default locale
-
DECIMAL_SEPARATOR
static final PropertyValue<Character> DECIMAL_SEPARATOR
Specifies the default number decimal separator.
Value type: Character
Default value: The decimal separator for the default locale
-
FOREIGN_KEY_FETCH_DEPTH
static final PropertyValue<Integer> FOREIGN_KEY_FETCH_DEPTH
Specifies the default foreign key fetch depth
Value type: Integer
Default value: 1
-
USE_LEXICAL_STRING_COMPARATOR
static final PropertyValue<Boolean> USE_LEXICAL_STRING_COMPARATOR
Specifies whether String values should use a lexical comparator by default
Value type: Boolean
Default value: true
-
-
Method Detail
-
attribute
Attribute<T> attribute()
TheAttribute
this property is based on, should be unique within an Entity. By default, theAttribute.name()
serves as column name for database properties.- Returns:
- the attribute this property is based on
-
entityType
EntityType entityType()
- Returns:
- the type of the entity this Property is associated with
-
caption
String caption()
- Returns:
- the caption
-
description
String description()
- Returns:
- a String describing this attribute
-
beanProperty
String beanProperty()
- Returns:
- the bean property name associated with this property
-
prepareValue
T prepareValue(T value)
Prepares the value according to the property configuration, such as rounding to the correct number of fraction digits in case of doubles- Parameters:
value
- the value to prepare- Returns:
- the prepared value
-
toString
String toString(T value)
Returns a string representation of the given value formatted with this property's format. If no format is availableObject.toString()
is used. By default, null values result in an empty string.- Parameters:
value
- the value to format.- Returns:
- the value formatted as a string
- See Also:
Property.Builder.format(Format)
,Property.Builder.dateTimePattern(String)
-
hasDefaultValue
boolean hasDefaultValue()
- Returns:
- true if a default value has been set for this property
-
defaultValue
T defaultValue()
- Returns:
- the default value for this property, if no default value has been set null is returned
- See Also:
hasDefaultValue()
-
isHidden
boolean isHidden()
- Returns:
- true if this property should be hidden in table views
-
maximumValue
Number maximumValue()
- Returns:
- the maximum allowed value for this property, null if none is defined, only applicable to numerical properties
-
minimumValue
Number minimumValue()
- Returns:
- the minimum allowed value for this property, null if none is defined, only applicable to numerical properties
-
maximumFractionDigits
int maximumFractionDigits()
- Returns:
- the maximum number of fraction digits to use for this property value, -1 if this property is not based on Types.DOUBLE or Types.DECIMAL
- See Also:
decimalRoundingMode()
-
decimalRoundingMode
RoundingMode decimalRoundingMode()
- Returns:
- the rounding mode to use when working with decimal values
- See Also:
DECIMAL_ROUNDING_MODE
,maximumFractionDigits()
-
preferredColumnWidth
int preferredColumnWidth()
- Returns:
- the preferred column width of this property in pixels when presented in a table, -1 if none has been specified
-
isNullable
boolean isNullable()
- Returns:
- true if null is a valid value for this property
-
maximumLength
int maximumLength()
- Returns:
- the maximum length of this property value, -1 is returned if the maximum length is undefined, this only applies to String (varchar) based properties
-
mnemonic
Character mnemonic()
Returns the mnemonic associated with this property.- Returns:
- the mnemonic to use when creating a label for this property
-
format
Format format()
Returns the Format used when presenting values for this property, null if none has been specified.- Returns:
- the Format object used to format the value of properties when being presented
-
dateTimePattern
String dateTimePattern()
Returns the date time format pattern used when presenting and inputting values for this property.- Returns:
- the date/time format pattern
-
dateTimeFormatter
DateTimeFormatter dateTimeFormatter()
Returns the date time formatter used when presenting and inputting values for this property.- Returns:
- the DateTimeFormatter for this property or null if this is not a date/time based property
-
comparator
Comparator<T> comparator()
- Returns:
- the Comparator to use when comparing values for this attribute
-
columnProperty
static <T,B extends ColumnProperty.Builder<T,B>> ColumnProperty.Builder<T,B> columnProperty(Attribute<T> attribute)
Creates a newColumnProperty.Builder
instance.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attribute- Returns:
- a new
ColumnProperty.Builder
-
columnProperty
static <T,B extends ColumnProperty.Builder<T,B>> ColumnProperty.Builder<T,B> columnProperty(Attribute<T> attribute, String caption)
Creates a newColumnProperty.Builder
instance.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attributecaption
- the property caption- Returns:
- a new
ColumnProperty.Builder
-
primaryKeyProperty
static <T,B extends ColumnProperty.Builder<T,B>> ColumnProperty.Builder<T,B> primaryKeyProperty(Attribute<T> attribute)
A convenience method for creating a newColumnProperty.Builder
instance, with the primary key index set to 0.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attribute- Returns:
- a new
ColumnProperty.Builder
with primary key index 0
-
primaryKeyProperty
static <T,B extends ColumnProperty.Builder<T,B>> ColumnProperty.Builder<T,B> primaryKeyProperty(Attribute<T> attribute, String caption)
A convenience method for creating a newColumnProperty.Builder
instance, with the primary key index set to 0.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attributecaption
- the property caption- Returns:
- a new
ColumnProperty.Builder
with primary key index 0
-
foreignKeyProperty
static ForeignKeyProperty.Builder foreignKeyProperty(ForeignKey foreignKey)
Instantiates aForeignKeyProperty.Builder
instance.- Parameters:
foreignKey
- the foreign key- Returns:
- a new
ForeignKeyProperty.Builder
-
foreignKeyProperty
static ForeignKeyProperty.Builder foreignKeyProperty(ForeignKey foreignKey, String caption)
Instantiates aForeignKeyProperty.Builder
instance.- Parameters:
foreignKey
- the foreign keycaption
- the caption- Returns:
- a new
ForeignKeyProperty.Builder
-
denormalizedViewProperty
static <T,B extends TransientProperty.Builder<T,B>> TransientProperty.Builder<T,B> denormalizedViewProperty(Attribute<T> attribute, Attribute<Entity> entityAttribute, Attribute<T> denormalizedAttribute)
Instantiates aTransientProperty.Builder
instance, for displaying a value from an entity attribute.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attributeentityAttribute
- the entity attribute from which this property gets its valuedenormalizedAttribute
- the property from the referenced entity, from which this property gets its value- Returns:
- a new
TransientProperty.Builder
-
denormalizedViewProperty
static <T,B extends TransientProperty.Builder<T,B>> TransientProperty.Builder<T,B> denormalizedViewProperty(Attribute<T> attribute, String caption, Attribute<Entity> entityAttribute, Attribute<T> denormalizedAttribute)
Instantiates aTransientProperty.Builder
instance, for displaying a value from an entity attribute.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attributecaption
- the caption of this propertyentityAttribute
- the entity attribute from which this property gets its valuedenormalizedAttribute
- the property from the referenced entity, from which this property gets its value- Returns:
- a new
TransientProperty.Builder
-
derivedProperty
static <T,B extends TransientProperty.Builder<T,B>> TransientProperty.Builder<T,B> derivedProperty(Attribute<T> attribute, DerivedProperty.Provider<T> valueProvider, Attribute<?>... sourceAttributes)
Instantiates aTransientProperty.Builder
instance, which value is derived from one or more source attributes.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attributevalueProvider
- aDerivedProperty.Provider
instance responsible for deriving the valuesourceAttributes
- the attributes from which this property derives its value- Returns:
- a new
TransientProperty.Builder
- Throws:
IllegalArgumentException
- in case no source properties are specified
-
derivedProperty
static <T,B extends TransientProperty.Builder<T,B>> TransientProperty.Builder<T,B> derivedProperty(Attribute<T> attribute, String caption, DerivedProperty.Provider<T> valueProvider, Attribute<?>... sourceAttributes)
Instantiates aTransientProperty.Builder
instance, which value is derived from one or more source attributes.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attributecaption
- the captionvalueProvider
- aDerivedProperty.Provider
instance responsible for deriving the valuesourceAttributes
- the ids of the properties from which this property derives its value- Returns:
- a new
TransientProperty.Builder
- Throws:
IllegalArgumentException
- in case no source properties are specified
-
denormalizedProperty
static <T,B extends ColumnProperty.Builder<T,B>> ColumnProperty.Builder<T,B> denormalizedProperty(Attribute<T> attribute, Attribute<Entity> entityAttribute, Attribute<T> denormalizedAttribute)
Creates a newColumnProperty.Builder
instance, which value should mirror the value from an entity attribute.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attribute to base this property onentityAttribute
- the entity attribute owning the attribute which value to mirrordenormalizedAttribute
- the attribute from which this attribute should get its value- Returns:
- a new
ColumnProperty.Builder
-
denormalizedProperty
static <T,B extends ColumnProperty.Builder<T,B>> ColumnProperty.Builder<T,B> denormalizedProperty(Attribute<T> attribute, String caption, Attribute<Entity> entityAttribute, Attribute<T> denormalizedAttribute)
Creates a newColumnProperty.Builder
instance, which value should mirror the value from an entity attribute.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attribute to base this property oncaption
- the property captionentityAttribute
- the entity attribute owning the attribute which value to mirrordenormalizedAttribute
- the attribute from which this attribute should get its value- Returns:
- a new
ColumnProperty.Builder
-
subqueryProperty
static <T,B extends ColumnProperty.Builder<T,B>> ColumnProperty.Builder<T,B> subqueryProperty(Attribute<T> attribute, String subquery)
Creates a newColumnProperty.Builder
instance, based on a subquery.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attributesubquery
- the sql query- Returns:
- a new
ColumnProperty.Builder
-
subqueryProperty
static <T,B extends ColumnProperty.Builder<T,B>> ColumnProperty.Builder<T,B> subqueryProperty(Attribute<T> attribute, String caption, String subquery)
Creates a newColumnProperty.Builder
instance, based on a subquery.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attributecaption
- the property captionsubquery
- the sql query- Returns:
- a new
ColumnProperty.Builder
-
itemProperty
static <T,B extends ColumnProperty.Builder<T,B>> ColumnProperty.Builder<T,B> itemProperty(Attribute<T> attribute, List<Item<T>> validItems)
Creates a newColumnProperty.Builder
instance, based on the given items.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attributevalidItems
- the Items representing all the valid values for this property- Returns:
- a new
ColumnProperty.Builder
- Throws:
IllegalArgumentException
- in case the valid item list contains duplicate values
-
itemProperty
static <T,B extends ColumnProperty.Builder<T,B>> ColumnProperty.Builder<T,B> itemProperty(Attribute<T> attribute, String caption, List<Item<T>> validItems)
Creates a newColumnProperty.Builder
instance, based on the given items.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attributecaption
- the property captionvalidItems
- the Items representing all the valid values for this property- Returns:
- a new
ColumnProperty.Builder
- Throws:
IllegalArgumentException
- in case the valid item list contains duplicate values
-
transientProperty
static <T,B extends TransientProperty.Builder<T,B>> TransientProperty.Builder<T,B> transientProperty(Attribute<T> attribute)
Creates a newTransientProperty.Builder
instance, which does not map to an underlying table column.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attribute- Returns:
- a new
TransientProperty.Builder
-
transientProperty
static <T,B extends TransientProperty.Builder<T,B>> TransientProperty.Builder<T,B> transientProperty(Attribute<T> attribute, String caption)
Creates a newTransientProperty.Builder
instance, which does not map to an underlying table column.- Type Parameters:
T
- the attribute value typeB
- the builder type- Parameters:
attribute
- the attributecaption
- the property caption- Returns:
- a new
TransientProperty.Builder
-
booleanProperty
static <C,B extends ColumnProperty.Builder<Boolean,B>> ColumnProperty.Builder<Boolean,B> booleanProperty(Attribute<Boolean> attribute, Class<C> columnClass, C trueValue, C falseValue)
Creates a newColumnProperty.Builder
instance representing a Boolean value.- Type Parameters:
C
- the column typeB
- the builder type- Parameters:
attribute
- the attributecolumnClass
- the underlying column data type classtrueValue
- the value representing 'true' in the underlying columnfalseValue
- the value representing 'false' in the underlying column- Returns:
- a new
ColumnProperty.Builder
-
booleanProperty
static <C,B extends ColumnProperty.Builder<Boolean,B>> ColumnProperty.Builder<Boolean,B> booleanProperty(Attribute<Boolean> attribute, String caption, Class<C> columnClass, C trueValue, C falseValue)
Creates a newColumnProperty.Builder
instance representing a Boolean value.- Type Parameters:
C
- the column typeB
- the builder type- Parameters:
columnClass
- the underlying column data type classattribute
- the attributecaption
- the property captiontrueValue
- the value representing 'true' in the underlying columnfalseValue
- the value representing 'false' in the underlying column- Returns:
- a new
ColumnProperty.Builder
-
blobProperty
static BlobProperty.Builder blobProperty(Attribute<byte[]> attribute)
Creates a newBlobProperty.Builder
instance.- Parameters:
attribute
- the attribute- Returns:
- a new
BlobProperty.Builder
-
blobProperty
static BlobProperty.Builder blobProperty(Attribute<byte[]> attribute, String caption)
Creates a newBlobProperty.Builder
instance.- Parameters:
attribute
- the attributecaption
- the property caption- Returns:
- a new
BlobProperty.Builder
-
auditInsertTimeProperty
static <T extends Temporal,B extends ColumnProperty.Builder<T,B>> ColumnProperty.Builder<T,B> auditInsertTimeProperty(Attribute<T> attribute)
Creates a newColumnProperty.Builder
instance, representing the time a record was inserted.- Type Parameters:
T
- the Temporal type to base this property onB
- the builder type- Parameters:
attribute
- the attribute- Returns:
- a new
ColumnProperty.Builder
-
auditInsertTimeProperty
static <T extends Temporal,B extends ColumnProperty.Builder<T,B>> ColumnProperty.Builder<T,B> auditInsertTimeProperty(Attribute<T> attribute, String caption)
Creates a newColumnProperty.Builder
instance, representing the time a record was inserted.- Type Parameters:
T
- the Temporal type to base this property onB
- the builder type- Parameters:
attribute
- the attributecaption
- the property caption- Returns:
- a new
ColumnProperty.Builder
-
auditUpdateTimeProperty
static <T extends Temporal,B extends ColumnProperty.Builder<T,B>> ColumnProperty.Builder<T,B> auditUpdateTimeProperty(Attribute<T> attribute)
Creates a newColumnProperty.Builder
instance, representing the time a record was updated.- Type Parameters:
T
- the Temporal type to base this property onB
- the builder type- Parameters:
attribute
- the attribute- Returns:
- a new
ColumnProperty.Builder
-
auditUpdateTimeProperty
static <T extends Temporal,B extends ColumnProperty.Builder<T,B>> ColumnProperty.Builder<T,B> auditUpdateTimeProperty(Attribute<T> attribute, String caption)
Creates a newColumnProperty.Builder
instance, representing the time a record was updated.- Type Parameters:
T
- the Temporal type to base this property onB
- the builder type- Parameters:
attribute
- the attributecaption
- the property caption- Returns:
- a new
ColumnProperty.Builder
-
auditInsertUserProperty
static <B extends ColumnProperty.Builder<String,B>> ColumnProperty.Builder<String,B> auditInsertUserProperty(Attribute<String> attribute)
Creates a newColumnProperty.Builder
instance, representing the username of the user who inserted a record.- Type Parameters:
B
- the builder type- Parameters:
attribute
- the attribute- Returns:
- a new
ColumnProperty.Builder
-
auditInsertUserProperty
static <B extends ColumnProperty.Builder<String,B>> ColumnProperty.Builder<String,B> auditInsertUserProperty(Attribute<String> attribute, String caption)
Creates a newColumnProperty.Builder
instance, representing the username of the user who inserted a record.- Type Parameters:
B
- the builder type- Parameters:
attribute
- the attributecaption
- the property caption- Returns:
- a new
ColumnProperty.Builder
-
auditUpdateUserProperty
static <B extends ColumnProperty.Builder<String,B>> ColumnProperty.Builder<String,B> auditUpdateUserProperty(Attribute<String> attribute)
Creates a newColumnProperty.Builder
instance, representing the username of the user who updated a record.- Type Parameters:
B
- the builder type- Parameters:
attribute
- the attribute- Returns:
- a new
ColumnProperty.Builder
-
auditUpdateUserProperty
static <B extends ColumnProperty.Builder<String,B>> ColumnProperty.Builder<String,B> auditUpdateUserProperty(Attribute<String> attribute, String caption)
Creates a newColumnProperty.Builder
instance, representing the username of the user who updated a record.- Type Parameters:
B
- the builder type- Parameters:
attribute
- the attributecaption
- the property caption- Returns:
- a new
ColumnProperty.Builder
-
booleanValueConverter
static <T> ColumnProperty.ValueConverter<Boolean,T> booleanValueConverter(T trueValue, T falseValue)
Creates a newColumnProperty.ValueConverter
instance for converting a column value representing a boolean value to and from an actual Boolean.- Type Parameters:
T
- the type of the value used to represent a boolean- Parameters:
trueValue
- the value used to represent 'true' in the underlying database, may not be nullfalseValue
- the value used to represent 'false' in the underlying database, may not be null- Returns:
- a value converter for converting an underlying database representation of a boolean value into an actual Boolean
-
-