我正在使用一个具有枚举类型的库,其中包含这样的常量;
Type.SHORT
Type.LONG
Type.FLOAT
Type.STRING
在 Eclipse 中调试时,出现错误:
No enum const class Type.STRİNG
由于我使用的是土耳其语系统,因此在工作 i>İ 时会出现问题,但由于这是一个枚举常量,即使我将每个属性都设置为 UTF-8,也没有什么可以让STRING成为 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());