org.jminor.framework.domain
Interface Property

All Superinterfaces:
Attribute
All Known Subinterfaces:
Property.AuditProperty, Property.AuditTimeProperty, Property.AuditUserProperty, Property.BlobProperty, Property.BooleanProperty, Property.ColumnProperty, Property.DenormalizedProperty, Property.DenormalizedViewProperty, Property.DerivedProperty, Property.ForeignKeyProperty, Property.MirrorProperty, Property.PrimaryKeyProperty, Property.SearchableProperty, Property.SubqueryProperty, Property.TransientProperty, Property.ValueListProperty

public interface Property
extends Attribute

Specifies a Property.


Nested Class Summary
static interface Property.AuditProperty
          A property representing an audit column
static interface Property.AuditTimeProperty
          Specifiesa audit property with a timestamp value
static interface Property.AuditUserProperty
          Specifiesa audit property with a username value
static interface Property.BlobProperty
          A BLOB property, based on two columns, the actual BLOB column and a column containing the name of the BLOB object.
static interface Property.BooleanProperty
          A boolean property, with special handling since different values are used for representing boolean values in different systems
static interface Property.ColumnProperty
          Specifies a property based on a table column
static interface Property.DenormalizedProperty
          A property representing a column that should get its value automatically from a column in a referenced table
static interface Property.DenormalizedViewProperty
          A property that gets its value from a entity referenced by a foreign key, but is for display only, and does not map to a database column
static interface Property.DerivedProperty
          A property which value is derived from the values of one or more properties.
static interface Property.ForeignKeyProperty
          A wrapper property that represents a reference to another entity, typically but not necessarily based on a foreign key.
static interface Property.MirrorProperty
          Represents a child foreign key property that is already included as part of another reference foreign key property, and should not handle updating the underlying property, useful in rare cases when foreign keys are referencing tables having composite natural primary keys as opposed to surrogate ones.
static interface Property.PrimaryKeyProperty
          A property that is part of a entities primary key.
static interface Property.SearchableProperty
          Specifies a property that can be include in database search criteria
static interface Property.SubqueryProperty
          A property based on a subquery, returning a single value
static interface Property.TransientProperty
          A property that does not map to an underlying database column.
static interface Property.ValueListProperty
          A property based on a list of values, each with a displayable caption.
 
Method Summary
 Object getDefaultValue()
           
 String getEntityID()
           
 Format getFormat()
           
 Double getMax()
           
 int getMaximumFractionDigits()
           
 int getMaxLength()
           
 Double getMin()
           
 Character getMnemonic()
           
 Property.ForeignKeyProperty getParentProperty()
           
 int getPreferredColumnWidth()
           
 String getPropertyID()
          The property identifier, should be unique within an Entity.
 int getType()
           
 boolean hasParentProperty()
           
 boolean is(Property property)
           
 boolean is(String propertyID)
           
 boolean isBoolean()
           
 boolean isCharacter()
           
 boolean isDate()
           
 boolean isDouble()
           
 boolean isHidden()
           
 boolean isInteger()
           
 boolean isNullable()
           
 boolean isNumerical()
           
 boolean isReadOnly()
          Specifies whether or not this attribute is read only
 boolean isString()
           
 boolean isTime()
           
 boolean isTimestamp()
           
 boolean isType(int type)
           
 Property setDefaultValue(Object defaultValue)
          Sets the default value for this property, overrides the underlying column default value, if any
 Property setDescription(String description)
           
 void setEntityID(String entityID)
           
 Property setFormat(Format format)
          Sets the Format to use when presenting property values
 Property setHidden(boolean hidden)
           
 Property setMax(double max)
          Sets the maximum allowed value for this property, only applicable to numerical properties
 Property setMaximumFractionDigits(int maximumFractionDigits)
          Sets the maximum fraction digits to show for this property, only applicable to DOUBLE properties This setting is overridden during subsquence calls to setFormat
 Property setMaxLength(int maxLength)
          Sets the maximum length of this property value, this applies to String (varchar) based properties
 Property setMin(double min)
          Only applicable to numerical properties
 Property setMnemonic(Character mnemonic)
          Sets the mnemonic to use when creating a label for this property
 Property setNullable(boolean nullable)
          Specifies whether or not this property is nullable, in case of properties that have parent properties (properties which comprise a fk property fx) inherit the nullable state of the parent property.
 void setParentProperty(Property.ForeignKeyProperty foreignKeyProperty)
           
 Property setPreferredColumnWidth(int preferredColumnWidth)
           
 Property setReadOnly(boolean readOnly)
           
 Property setUseNumberFormatGrouping(boolean useGrouping)
          Specifies whether to use number grouping when presenting this value.
 
Methods inherited from interface org.jminor.common.model.Attribute
getCaption, getDescription, getTypeClass, hasDescription
 

Method Detail

getEntityID

String getEntityID()
Returns:
the ID of the entity this property is associated with

setEntityID

void setEntityID(String entityID)
Parameters:
entityID - the ID of the entity this property is associated with
Throws:
IllegalStateException - in case the entityID has already been set

getPropertyID

String getPropertyID()
The property identifier, should be unique within an Entity. By default this ID serves as column name for database properties.

Returns:
the ID of this property

is

boolean is(String propertyID)
Parameters:
propertyID - the property ID
Returns:
true if this property is of the given type

is

boolean is(Property property)
Parameters:
property - the property
Returns:
true if this property is of the given type

getType

int getType()
Returns:
the data type of the value of this property

isType

boolean isType(int type)
Parameters:
type - the type to check
Returns:
true if the type of this property is the one given

isNumerical

boolean isNumerical()
Returns:
true if this is a numerical Property, that is, Integer or Double

isTime

boolean isTime()
Returns:
true if this is a time based property, Date or Timestamp

isDate

boolean isDate()
Returns:
true if this is a date property

isTimestamp

boolean isTimestamp()
Returns:
true if this is a timestamp property

isCharacter

boolean isCharacter()
Returns:
true if this is a character property

isString

boolean isString()
Returns:
true if this is a string property

isInteger

boolean isInteger()
Returns:
true if this is a integer property

isDouble

boolean isDouble()
Returns:
true if this is a double property

isBoolean

boolean isBoolean()
Returns:
true if this is a boolean property

setDefaultValue

Property setDefaultValue(Object defaultValue)
Sets the default value for this property, overrides the underlying column default value, if any

Parameters:
defaultValue - the value to use as default
Returns:
the property

getDefaultValue

Object getDefaultValue()
Returns:
the default value for this property, if any

isHidden

boolean isHidden()
Returns:
true if this property should be hidden in table views

setHidden

Property setHidden(boolean hidden)
Parameters:
hidden - specifies whether this property should hidden in table views
Returns:
this Property instance

getMax

Double getMax()
Returns:
the maximum allowed value for this property, null if none is defined, only applicable to numerical properties

setMax

Property setMax(double max)
Sets the maximum allowed value for this property, only applicable to numerical properties

Parameters:
max - the maximum allowed value
Returns:
this Property instance

getMin

Double getMin()
Returns:
the minimum allowed value for this property, null if none is defined, only applicable to numerical properties

setMin

Property setMin(double min)
Only applicable to numerical properties

Parameters:
min - the minimum allowed value for this property
Returns:
this Property instance

setMaximumFractionDigits

Property setMaximumFractionDigits(int maximumFractionDigits)
Sets the maximum fraction digits to show for this property, only applicable to DOUBLE properties This setting is overridden during subsquence calls to setFormat

Parameters:
maximumFractionDigits - the maximum fraction digits
Returns:
this Property instance

getMaximumFractionDigits

int getMaximumFractionDigits()
Returns:
the maximum number of fraction digits to show for this property value, only applicable to DOUBLE properties

setUseNumberFormatGrouping

Property setUseNumberFormatGrouping(boolean useGrouping)
Specifies whether to use number grouping when presenting this value. i.e. 1234567 shown as 1.234.567 or 1,234,567 depending on locale. Only applicable to numerical properties. This setting is overridden during subsquence calls to setFormat

Parameters:
useGrouping - if true then number grouping is used
Returns:
this Property instance

getPreferredColumnWidth

int getPreferredColumnWidth()
Returns:
the preferred column width of this property when presented in a table, 0 if none has been specified

setPreferredColumnWidth

Property setPreferredColumnWidth(int preferredColumnWidth)
Parameters:
preferredColumnWidth - the preferred column width to be used when this property is shown in a table
Returns:
this Property instance

setReadOnly

Property setReadOnly(boolean readOnly)
Parameters:
readOnly - specifies whether this property should be included during insert/update operations
Returns:
this Property instance

setNullable

Property setNullable(boolean nullable)
Specifies whether or not this property is nullable, in case of properties that have parent properties (properties which comprise a fk property fx) inherit the nullable state of the parent property.

Parameters:
nullable - specifies whether or not this property accepts a null value
Returns:
this Property instance

isNullable

boolean isNullable()
Returns:
true if this property accepts a null value

setMaxLength

Property setMaxLength(int maxLength)
Sets the maximum length of this property value, this applies to String (varchar) based properties

Parameters:
maxLength - the maximum length
Returns:
this Property instance

getMaxLength

int getMaxLength()
Returns:
the maximum length of this property value, -1 is returned if the max length is undefined, this applies to String (varchar) based properties

getMnemonic

Character getMnemonic()
Returns:
the mnemonic to use when creating a label for this property

setMnemonic

Property setMnemonic(Character mnemonic)
Sets the mnemonic to use when creating a label for this property

Parameters:
mnemonic - the mnemonic character
Returns:
this Property instance

setDescription

Property setDescription(String description)
Parameters:
description - a String describing this property
Returns:
this Property instance

getFormat

Format getFormat()
Returns:
the Format object used to format the value of properties when being presented

setFormat

Property setFormat(Format format)
Sets the Format to use when presenting property values

Parameters:
format - the format to use
Returns:
this Property instance

isReadOnly

boolean isReadOnly()
Specifies whether or not this attribute is read only

Returns:
true if this attribute is read only

hasParentProperty

boolean hasParentProperty()
Returns:
true if this property is part of a foreign key property todo rename

setParentProperty

void setParentProperty(Property.ForeignKeyProperty foreignKeyProperty)
Parameters:
foreignKeyProperty - the parent foreign key property, if any

getParentProperty

Property.ForeignKeyProperty getParentProperty()
Returns:
the parent property