No enum const class com.orientechnologies.orient.core.metadata.schema.OType.INTEGER

314 views
Skip to first unread message

tol...@celi.it

unread,
May 23, 2012, 8:38:16 AM5/23/12
to orient-...@googlegroups.com
Hi,
 I read commands from file and execute them with

db.command(new OCommandSQL(...))

but the Java API rise the attached exception when it executes this command:

CREATE PROPERTY myClass.respStatus INTEGER;

The error occurred both with 1.0 and 1.0.1 release.

Thank you

java.lang.IllegalArgumentException: No enum const class com.orientechnologies.orient.core.metadata.schema.OType.INTEGER;
    at java.lang.Enum.valueOf(Enum.java:214)
    at com.orientechnologies.orient.core.metadata.schema.OType.valueOf(OType.java:44)
    at com.orientechnologies.orient.core.sql.OCommandExecutorSQLCreateProperty.parse(OCommandExecutorSQLCreateProperty.java:84)
    at com.orientechnologies.orient.core.sql.OCommandExecutorSQLCreateProperty.parse(OCommandExecutorSQLCreateProperty.java:38)
    at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:46)
    at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:31)
    at com.orientechnologies.orient.core.storage.OStorageEmbedded.command(OStorageEmbedded.java:62)
    at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:60)
    [...]

Fabrizio Fortino

unread,
May 23, 2012, 9:08:00 AM5/23/12
to orient-...@googlegroups.com
Hi,

I am not sure if this is a bug. But to sort it out you can try to execute the command removing the final semicolon.

CREATE PROPERTY myClass.respStatus INTEGER

Hope it helps,
Fabrizio

tol...@celi.it

unread,
May 23, 2012, 9:45:26 AM5/23/12
to orient-...@googlegroups.com
Thank for your reply.

 I tried to remove semicolon but error occurred. In the same routine I execute statements from other files too and the semicolon cause no problems. I tried to execute that statement alone (with only the class creation statement) but the exception is raised.

 The statements are passed to the OCommand as single string (FileUtils.readFileToString), that's why I used the semicolon at end of each statement (this allow for empty lines and a minimal formatting).
 
 Executing command line by line _and_ removing semicolon did it.

Luca Garulli

unread,
May 26, 2012, 6:36:11 PM5/26/12
to orient-...@googlegroups.com
Ok,
you could also execute the script with the console. Example:

> console.sh cmd.sql

where cmd.sql contains all the console commands, one per line

Lvc@
Reply all
Reply to author
Forward
0 new messages