Hello,
I'm using the Java Persistence API (JPA) in a library to not lock myself in to using a specific database. In a project that uses said library, I'm using ObjectDB because it is fast and eliminates the need for another dependency to an ORM, such as Hibernate, since it implements the JPA. ObjectDB's been doing a great job so far and I'm glad I found it.
However, I recently wanted to add an index to a field that is an element collection and encountered an issue with duplicate classes. To use the @Index annotation, I had to add a dependency to the JDO API version 3.1. The code works just fine, but when I use a Maven plugin to detect duplicate classes and resources, it points out that both ObjectDB and the JDO API expose the same classes.
I was wondering: is there was a reason why the ObjectDB JAR contains packages and classes that clash with the JDO API's JAR?
If a project uses JPA and JDO, it is most likely to avoid coupling it to a specific database. By adding ObjectDB as a database and ORM in a project, it seems odd that it would clash with classes that are already provided by the JDO API which is an abstraction (I believe). Furthermore, I believe and finding the same packages in two different modules can be problematic in projects that use Java 9 modules.
I've created a sample project that produces the warnings I am referring to: https://github.com/leblancjs/objectdb-jdo-duplicate-classes.
Thanks,
Joel