Adjust Property is an order used to alter or refresh the Property of a specific class. Changing the property implies altering the fields of a table. In this section, you can figure out how to refresh the property.
The accompanying assertion is the fundamental sentence structure of Alter Property Command.
ALTER PROPERTY <class>.<property> <attribute-name> <attribute-value>
Following are the insights regarding the alternatives in the above grammar.
- <class> − Defines the class to which the property has a place.
- <property> − Defines the property you need to refresh.
- <attribute-name> − Defines the trait of a property you need to refresh.
- <attribute-value> − Defines the worth you need to set on the characteristic.
The accompanying table characterizes the rundown of characteristics to adjust the property.
Attribute | Type | Description |
---|---|---|
LINKEDCLASS | String | Defines the linked class name. Use NULL to remove an existing value. |
LINKEDTYPE | String | Defines the link type. Use NULL to remove an existing value. |
MIN | Integer | Defines the minimum value as a constraint. Use NULL to remove an existing constraint. |
MANDATORY | Boolean | Defines whether the property requires a value. |
MAX | Integer | Defines the maximum value as a constraint. Use NULL to remove an existing constraint. |
NAME | String | Defines the property name. |
NOTNULL | Boolean | Defines whether the property can have a NULL value. |
REGEX | String | Defines a Regular Expression as constraint. Use NULL to remove an existing constraint. |
TYPE | String | Defines a property type. |
COLLATE | String | Sets collate to one of the defined comparison strategies. By default, it is set to case-sensitive (cs). You can also set it to case-insensitive (ci). |
READONLY | Boolean | Defines whether the property value is immutable. That is, if it is possible to change it after the first assignment. Use with DEFAULT to have immutable values on creation. |
CUSTOM | String | Defines custom properties. The syntax for custom properties is <custom-name> = <custom-value>, such as stereotype = icon. |
DEFAULT | Defines the default value or function. |
Note − in the event that you are changing NAME or TYPE, this order will set aside some effort to refresh contingent upon the measure of information.
Example
Attempt a few questions which are offered beneath to comprehend Alter property.
Execute the accompanying question to change the name of the property from 'age' to 'conceived' in the class Customer.
orinetdb {db = demo}> ALTER PROPERTY Customer.age NAME born
In the event that the above inquiry is executed effectively, you will get the accompanying yield.
Property altered successfully
Execute the accompanying inquiry to make 'name' as the required property of the class 'Client'.
orientdb {db = demo}> ALTER PROPERTY Customer.name MANDATORY TRUE
In the event that the above question is executed effectively, you will get the accompanying yield.
Property altered successfully