Why Jongo 1.0 removed support for private properties

65 Views Asked by At

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?

1

There are 1 best solutions below

1
On BEST ANSWER

Jongo stills 'support' private properties in v1.0

Nevertheless due to a regression it was unable to handle private id field.

This has been fixed in v1.1 : https://github.com/bguerout/jongo/issues/198

If you have a Maven pom.xml, just update it with :

<dependencies>
  <dependency>
   <groupId>org.jongo</groupId>
   <artifactId>jongo</artifactId>
   <version>1.1</version>
  </dependency>
 ...
</dependencies>