public class SchemaUpdatePolicyImpl extends Object implements SchemaUpdatePolicy
SchemaUpdatePolicy
.Constructor and Description |
---|
SchemaUpdatePolicyImpl(DatabaseBackend database)
Construct a
SchemaUpdatePolicy . |
Modifier and Type | Method and Description |
---|---|
<T> void |
willDelete(Property<T> property)
Throw an exception if the property cannot be rejected.
|
void |
willDelete(UpdatableSchema schema)
Throw an exception if the schema cannot be deleted.
|
<T> void |
willDelete(ValueType<T> valueType)
Throw an exception if the the value type cannot be deleted.
|
<T> void |
willDelete(ValueType<T> valueType,
T value)
Throw an exception if the value type value cannot be deleted.
|
void |
willUpdate(UpdatableSchema schema)
Throw an exception if the update is rejected.
|
public SchemaUpdatePolicyImpl(DatabaseBackend database)
SchemaUpdatePolicy
.database
- a databasepublic void willDelete(UpdatableSchema schema) throws T2DBException
A schema cannot be deleted if it serves as the base of another schema or if it is used by a chronicle.
willDelete
in interface SchemaUpdatePolicy
schema
- a schemaT2DBException
public void willUpdate(UpdatableSchema schema) throws T2DBException
It is not allowed to update the base schema of a schema and its attributes or series at the same time. It is allowed to modify the base of a schema if the new resulting schema has all the attributes and all the series of the old schema. It can have additional attributes, additional series, and additional series attributes.
willUpdate
in interface SchemaUpdatePolicy
schema
- a schemaT2DBException
public <T> void willDelete(Property<T> property) throws T2DBException
SchemaUpdatePolicy
willDelete
in interface SchemaUpdatePolicy
property
- a propertyT2DBException
public <T> void willDelete(ValueType<T> valueType) throws T2DBException
SchemaUpdatePolicy
willDelete
in interface SchemaUpdatePolicy
valueType
- a value typeT2DBException
public <T> void willDelete(ValueType<T> valueType, T value) throws T2DBException
SchemaUpdatePolicy
willDelete
in interface SchemaUpdatePolicy
valueType
- a value typevalue
- a valueT2DBException
Copyright © 2017. All rights reserved.