0
插入,當我試圖插入使用JDBC的embeddedmap以下異常彈出問題與embeddedmap使用JDBC
com.orientechnologies.orient.core.exception.OValidationException: impossible to convert value of field "permission"
at com.orientechnologies.orient.core.record.impl.ODocument.autoConvertValues(ODocument.java:2270)
at com.orientechnologies.orient.core.record.impl.ODocument.validate(ODocument.java:1991)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:2519)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:121)
at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1768)
at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1759)
at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:81)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLInsert.saveRecord(OCommandExecutorSQLInsert.java:323)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLInsert.execute(OCommandExecutorSQLInsert.java:224)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.execute(OCommandExecutorSQLDelegate.java:90)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.executeCommand(OAbstractPaginatedStorage.java:1522)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.command(OAbstractPaginatedStorage.java:1503)
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:67)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.command(ONetworkProtocolBinary.java:1323)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:400)
at com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:223)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:77)
產生的原因:java.lang.ClassCastException:java.lang.String中不能轉換爲Java。 util.Map 在com.orientechnologies.orient.core.record.impl.ODocument.autoConvertValues(ODocument.java:2256) ...... 16多個
什麼是這裏的問題
UPDATE CODE:
Map<String,Object> permission = new HashMap<>();
permission.put("user_permission",Byte.valueOf("15"));
new JdbcTemplate(datasource).update("Insert into Role SET name = ?, permission = ?","Role1",permission);
注: 我使用了Spring JDBC
你可以發佈你的代碼嗎? –
添加的代碼請檢查 –