我正在使用一個具有類似const的枚舉類型的lib;OrientDB遇到Unicode,土耳其語和枚舉的問題
Type.SHORT
Type.LONG
Type.FLOAT
Type.STRING
雖然我在Eclipse我調試,我得到了一個錯誤:
No enum const class Type.STRİNG
由於我使用的是土耳其的系統,對工作我一個問題>我的,但因爲這是一個枚舉常量,儘管我將每個屬性都設置爲UTF-8,但沒有什麼可以得到的,它應該是Eclipse應該尋找的。但它仍然尋找STRİNG,它無法找到,我不能使用它。我必須爲此做些什麼?
項目>屬性>資源>文本文件編碼現在是UTF-8。問題不斷。
編輯:更多的信息可能會給我一些線索,我不能得到; 我正在OrientDB上工作。這是我第一次嘗試,所以我不知道這個問題是否可以在OrientDB軟件包上。但我正在使用許多其他庫,我從來沒有見過這樣的問題。在這個包中有一個OType枚舉,我只是試圖連接到數據庫。
String url = "local:database";
ODatabaseObjectTx db = new ODatabaseObjectTx(url).
Person person = new Person("John");
db.save(person);
db.close();
沒有更多的代碼可供使用。數據庫創建的,但後來我得到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(OType.java:41)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLCreateProperty.parse(OCommandExecutorSQLCreateProperty.java:81)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLCreateProperty.parse(OCommandExecutorSQLCreateProperty.java:35)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:43)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:28)
at com.orientechnologies.orient.core.storage.OStorageEmbedded.command(OStorageEmbedded.java:63)
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:63)
at com.orientechnologies.orient.core.metadata.schema.OClassImpl.addProperty(OClassImpl.java:342)
at com.orientechnologies.orient.core.metadata.schema.OClassImpl.createProperty(OClassImpl.java:258)
at com.orientechnologies.orient.core.metadata.security.OSecurityShared.create(OSecurityShared.java:177)
at com.orientechnologies.orient.core.metadata.security.OSecurityProxy.create(OSecurityProxy.java:37)
at com.orientechnologies.orient.core.metadata.OMetadata.create(OMetadata.java:70)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.create(ODatabaseRecordAbstract.java:142)
... 4 more
等班; OCommandExecutorSQLCreateProperty: http://code.google.com/p/orient/source/browse/trunk/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLCreateProperty.java
線81說:type = OType.valueOf(word.toString());
當您在鍵入'Type.STR'後立即按下'CTRL + Space'時,Eclipse會自動完成correclty嗎? –
其實我沒有直接使用它。必須有像反射或使用它的東西。但作爲你的問題的答案,通過打字,沒有問題。 Ctrl + Space給了我Type.STRING(正確,沒有問題) –
也許反射地調用enum的代碼有問題 - 這個值是從哪裏來的?用戶輸入形式只有土耳其語的鍵盤,或另一個發送'İ'而不是'I'的系統? –