orientechnologies / orientechnologies/orientdb

MANDATORY DEFAULT READONLY Property Not working for Edge Classes, Working for Vertex Classes

Open
#9,782 0 comments 0 reactions 0 assignees View on GitHub

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:
image

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:

image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.