Skip to content

OrientDB having trouble with Unicode, Turkish, and enums

I am using a lib which has an enum type with consts like these;


While I am debugging in Eclipse, I got an error:

No enum const class Type.STRİNG

As I am using a Turkish system, there is a problem on working i>İ but as this is an enum const, even though I put every attributes as UTF-8, nothing could get that STRING is what Eclipse should look for. But it still looks for STRİNG and it can’t find and I can’t use that. What must I do for that?

Project > Properties > Resouce > Text file encoding is UTF-8 now. Problem keeps.

EDIT: More information may give some clues which I can’t get; I am working on OrientDB. This is my first attempt, so I don’t know if the problem could be on OrientDB packages. But I am using many other libs, I have never seen such a problem. There is a OType enum in this package, and I am only trying to connect to the database.

    String url = "local:database";
    ODatabaseObjectTx db = new ODatabaseObjectTx(url).
    Person person = new Person("John");;

There is no more code I use yet. Database created but then I get the java.lang.IllegalArgumentException:

Caused by: java.lang.IllegalArgumentException: No enum const class com.orientechnologies.orient.core.metadata.schema.OType.STRİNG
    at java.lang.Enum.valueOf(Unknown Source)
    at com.orientechnologies.orient.core.metadata.schema.OType.valueOf(
    at com.orientechnologies.orient.core.sql.OCommandExecutorSQLCreateProperty.parse(
    at com.orientechnologies.orient.core.sql.OCommandExecutorSQLCreateProperty.parse(
    at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(
    at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(
    at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(
    at com.orientechnologies.orient.core.metadata.schema.OClassImpl.addProperty(
    at com.orientechnologies.orient.core.metadata.schema.OClassImpl.createProperty(
    at com.orientechnologies.orient.core.metadata.OMetadata.create(
    at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.create(
    ... 4 more

Here is OType class:

And other class; OCommandExecutorSQLCreateProperty:

Line 81 says: type = OType.valueOf(word.toString());


Am I correct to assume you are running this program using a turkish locale? Then it seems the bug is in line 118 of OCommandExecutorSQLCreateProperty:

linkedType = OType.valueOf(linked.toUpperCase());

You would have to specify the Locale whose upper casing rules should be used, probably Locale.ENGLISH as the parameter to toUpperCase.