0

Recently I migrated from Jongo 0.4 to Jongo 1.0, and suddenly I started to receive this exception:

! java.lang.IllegalArgumentException: Unable to set objectid on class: class *Myclass*
! at org.jongo.ReflectiveObjectIdUpdater.updateField(ReflectiveObjectIdUpdater.java:72) ~[jongo-1.0.jar:na]
! at org.jongo.ReflectiveObjectIdUpdater.setObjectId(ReflectiveObjectIdUpdater.java:60) ~[jongo-1.0.jar:na]
! at org.jongo.Insert.preparePojo(Insert.java:71) ~[jongo-1.0.jar:na]
! at org.jongo.Insert.insert(Insert.java:56) ~[jongo-1.0.jar:na]
! at org.jongo.MongoCollection.insert(MongoCollection.java:140) ~[jongo-1.0.jar:na]
! at org.jongo.MongoCollection.insert(MongoCollection.java:132) ~[jongo-1.0.jar:na]
...

That means that Jongo now has problems setting a private field, which in 0.4 wasn't a problem.

Is there some reason for this limitation?

4

1 回答 1

0

Jongo 在 v1.0 中仍然“支持”私有属性

然而,由于回归,它无法处理私有 id 字段。

这已在 v1.1 中修复:https ://github.com/bguerout/jongo/issues/198

如果你有一个 Maven pom.xml,只需更新它:

<dependencies>
  <dependency>
   <groupId>org.jongo</groupId>
   <artifactId>jongo</artifactId>
   <version>1.1</version>
  </dependency>
 ...
</dependencies>
于 2014-07-27T20:04:42.150 回答