orientdbtinkerpop-blueprint

orientDB `OrientGraphNoTx ` Super-class V; not exists


I'm programmatically loading a file containing the OSql statements to create the schema of my DB by using the Blueprint API, specifically, I'm creating a DB in plocal mode by using by instantiating the OrientGraphNoTx class:

val graph = new OrientGraphNoTx(s"plocal:$dbPath", "admin", "admin")

I'm getting a weird error stating that the class V does not exist in my database:

Exception in thread "main" com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #29: Super-class V; not exists
Command: CREATE CLASS Employee EXTENDS V;

Here is some sample code generating the error:

  def main(args: Array[String]) {
    val graph = new OrientGraphNoTx(s"plocal:C:\\Users\\alberto\\tmp\\tmp\\test_orient", "admin", "admin")
    val cmd = "CREATE CLASS Employee EXTENDS V;"
    graph.command(new OCommandSQL(cmd)).execute()
    graph.shutdown(true)
  }

As I have seen that few other people had a similar problem and solved it by specifying the keyword graph to their CREATE DATABASE statements, however, I guess the system should already know I'm working with a graph since I'm using OrientGraphNoTx. I've tried anyway to add a CREATE DATABASE statement to my script but, as expected I got an error:

Exception in thread "main" com.orientechnologies.orient.core.command.OCommandExecutorNotFoundException: Cannot find a command executor for the command request: sql.CREATE DATABASE plocal:C:\Users\alberto\tmp\tmp\synth_1000 admin admin plocal graph

I'm using the jars included in the lib directory of OrientDB 2.1.4.

Does anybody know how to solve this issue?


Solution

  • 1) Remove ; so it's: CREATE CLASS Employee EXTENDS V

    2) CREATE DATABASE is not a SQL command, but rather a console command