orientechnologies / orientechnologies/orientdb
MANDATORY DEFAULT READONLY Property Not working for Edge Classes, Working for Vertex Classes
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 5k
- Forks
- 868
- Avg merge
- 15h 6m
- Merged PRs (30d)
- 18
Description
OrientDB Version: 3.2.5
Java Version: 17
OS: Windows 10
Expected behavior
A property on an edge class that is MANDATORY TRUE, DEFAULT "sysdate().asLong()" , READONLy TRUE should put the default value if no value is supplied
Actual behavior
Generating OValidationException:

Steps to reproduce
Create the Vertex Class:
CREATE CLASS z49 EXTENDS V
CREATE PROPERTY z49.nn LONG (MANDATORY TRUE, DEFAULT "sysdate().asLong()", READONLY TRUE)
Create the vertex of the vetrex class from Studio, it creates properly:

Create Edge Class:
CREATE CLASS z46 extends E
CREATE PROPERTY z46.nn LONG (MANDATORY TRUE, DEFAULT "sysdate().asLong()", READONLY TRUE)
Try to create the edge with the edge class from Studio between any two vertices, it generates the above exception
NOTE: I did a bit more experimentation. The problem seems to stem from the fact that properties associated with Edge classes does not consider DEFAULT values in any circumstances. While in vertex classes it does.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in OrientDB 3.2.5 using the supplied CREATE CLASS and CREATE PROPERTY commands, then compare vertex and edge creation in Studio. Trace how DEFAULT and READONLY properties are applied during edge creation. Done means an edge property receives its default value without triggering the mandatory-property validation error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100