public final class ColumnProperty extends Object implements Property
| Modifier and Type | Class and Description |
|---|---|
class |
ColumnProperty.NotNullableException
An exception that signals that a
null value was passed to
the setValue method, but the value of this property can not
be set to null. |
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeEvent, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeEvent, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer| Constructor and Description |
|---|
ColumnProperty(String propertyId,
boolean readOnly,
boolean allowReadOnlyChange,
boolean nullable,
boolean primaryKey,
Object value,
Class<?> type)
Creates a new ColumnProperty instance.
|
ColumnProperty(String propertyId,
boolean readOnly,
boolean allowReadOnlyChange,
boolean nullable,
Object value,
Class<?> type)
Deprecated.
As of 7.0. Use
{@link #ColumnProperty(String, boolean, boolean, boolean, boolean, Object, Class)
instead
|
| Modifier and Type | Method and Description |
|---|---|
void |
commit() |
Object |
getOldValue()
Returns the original non-modified value of this property if it has been
modified.
|
String |
getPropertyId() |
Class<?> |
getType()
Returns the type of the Property.
|
Object |
getValue()
Returns the current value for this property.
|
boolean |
isModified() |
boolean |
isNullable() |
boolean |
isPersistent()
Return whether the value of this property should be persisted to the
database.
|
boolean |
isPrimaryKey() |
boolean |
isReadOnly()
Tests if the Property is in read-only mode.
|
boolean |
isReadOnlyChangeAllowed()
Returns whether the read-only status of this property can be changed
using
setReadOnly(boolean). |
boolean |
isRowIdentifier()
Returns whether or not this property is used as a row identifier.
|
boolean |
isVersionColumn() |
void |
setOwner(RowItem owner) |
void |
setReadOnly(boolean newStatus)
Sets the Property's read-only mode to the specified status.
|
void |
setValue(Object newValue)
Sets the value of the Property.
|
void |
setVersionColumn(boolean versionColumn) |
String |
toString()
Deprecated.
As of 7.0. To get the property value, use
getValue()
instead (and possibly toString on that) |
@Deprecated public ColumnProperty(String propertyId, boolean readOnly, boolean allowReadOnlyChange, boolean nullable, Object value, Class<?> type)
propertyId - readOnly - allowReadOnlyChange - nullable - value - type - public ColumnProperty(String propertyId, boolean readOnly, boolean allowReadOnlyChange, boolean nullable, boolean primaryKey, Object value, Class<?> type)
propertyId - The ID of this property.readOnly - Whether this property is read-only.allowReadOnlyChange - Whether the read-only status of this property can be changed.nullable - Whether this property accepts null values.primaryKey - Whether this property corresponds to a database primary key.value - The value of this property.type - The type of this property.public Object getValue()
getOldValue().public Object getOldValue()
isModified() is true,
getValue() otherwise.public void setValue(Object newValue) throws Property.ReadOnlyException, Converter.ConversionException
Property
Implementing this functionality is optional. If the functionality is
missing, one should declare the Property to be in read-only mode and
throw Property.ReadOnlyException in this function.
setValue in interface PropertynewValue - New value of the Property. This should be assignable to the
type returned by getTypeProperty.ReadOnlyException - if the object is in read-only modeConverter.ConversionExceptionpublic Class<?> getType()
PropertygetValue and
setValue must be compatible with this type: one must be able
to safely cast the value returned from getValue to the given
type and pass any variable assignable to this type as an argument to
setValue.public boolean isReadOnly()
PropertysetValue will throw
ReadOnlyException and will not modify the value of the
Property.isReadOnly in interface Propertytrue if the Property is in read-only mode,
false if it's notpublic boolean isReadOnlyChangeAllowed()
setReadOnly(boolean).
Used to prevent setting to read/write mode a property that is not allowed to be written by the underlying database. Also used for values like VERSION and AUTO_INCREMENT fields that might be set to read-only by the container but the database still allows writes.
public void setReadOnly(boolean newStatus)
PropertyisReadOnly mode query correctly.setReadOnly in interface PropertynewStatus - new read-only status of the Propertypublic boolean isPrimaryKey()
public String getPropertyId()
@Deprecated public String toString()
getValue()
instead (and possibly toString on that)
If legacy Property toString mode is enabled, returns the value of this
Property converted to a String.
If legacy Property toString mode is disabled, the string representation has no special meaning
toString in class ObjectLegacyPropertyHelper.isLegacyToStringEnabled()public void setOwner(RowItem owner)
public boolean isModified()
public boolean isVersionColumn()
public void setVersionColumn(boolean versionColumn)
public boolean isNullable()
public boolean isPersistent()
public boolean isRowIdentifier()
public void commit()
Copyright © 2019 Vaadin Ltd. All rights reserved.