I am working on a Java application that would benefit using heterogeneous databases (two different types of database) : one relational (MySQL driven by Hibernate) and one NoSQL document based database (MongoDB).
In my object-model, I have a small number of associations between objects saved in MongoDB et objects saved Hibernate. I want to resolve those associations on the fly (when required). I would like to find way to do this that is compliant with Hibernate. Does this exist?
To make this a more concrete example, let's suppose we have a one-to-many assocation: OjbectSavedInMongoDb (one) --------> (many) ObjectSavedWithHibernate.
I can make sure that OjbectSavedInMongoDb has an id and I can assign a unique id to each object (that's easy). I just want to make sure that when I save ObjectSavedWithHibernate with Hibernate that the right id from OjbectSavedInMongoDb will be put in the foreign key.
Knowing Hibernate, I doubt it has that feature yet. With the popularity of NoSQL databaes, Hibernate must start to support this feature, externally persisted object assocations.
The solution would allow programmers to define EXTERNALLY PERSISTED classes (objects) and allow associations TO / FROM those externally persisted classes. All types of associations should be supported as much as possible.
|