java – OrientDB在使用Unicode,土耳其语和枚举时遇到问题
我正在使用一个具有枚举类型的lib,这些类似于consts;
Type.SHORT Type.LONG Type.FLOAT Type.STRING 当我在Eclipse中调试时,我收到一个错误: No enum const class Type.STR?NG 当我使用土耳其语系统时,工作i>有一个问题,但因为这是一个枚举const,即使我将每个属性都设置为UTF-8,也没有什么能让STRING成为Eclipse应该寻找的东西.但它仍然在寻找STR?NG,它无法找到,我无法使用它.我该怎么做? 项目>属性>资源>文本文件编码现在是UTF-8.问题仍然存在 编辑:更多信息可能会提供一些我无法得到的线索; 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 这是OType类:http://code.google.com/p/orient/source/browse/trunk/core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OType.java 和其他班级; OCommandExecutorSQLCreateProperty: 第81行说:type = OType.valueOf(word.toString()); 解决方法
我是否正确假设您使用土耳其语区域设置运行此程序?然后看起来这个bug在OCommandExecutorSQLCreateProperty的第118行:
linkedType = OType.valueOf(linked.toUpperCase()); 您必须指定应使用其上层规则的Locale,可能是Locale.ENGLISH作为toUpperCase的参数. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |