cedricb wrote:
I do not know either if such a framework, that could glue any persistant managment systems together as long as they use standardised CRUD methods exists.
Hi Cedric,
I was at the same position years ago with Hibernate.
We had tables with one-to-many relationships to group->users. Alots of users had alots of documents, who get automatically indexed. The documents where not stored in the db, nor the keywords. They were stored in a Lucene (Java-Search-Engine) backend.
So if I wanted to get all docs by the user peter, you could write (pseudo) "select documentid from documents where user = 'peter'"
But "documents" is not a table by hibernate, documents is the lucene backend. If we added a new user to the system, the same user id was applied to all documents in the search index as "owner".
The reason for this was, that Lucene was manyfold superior to any in-database search functionality you can buy then (and even today).
And it was nice not to hit the already peaked db with stupid search requests ;)
But it was complex to access it in code. You can't work with sql, because hibernate doesn't liked mapping something that's not a db. We fixed this later by simply inserting a table and putting document ids into a "documents" table. But it was cumbersome, because sometimes the documentid didn't reflect the state under high load situations.
I don't know how this would be handled today (I speak about Hibernate 2.x) but I looked into the code and tried to "mimik" a table with a own dbdialect (which in case, would instead use a simple http interface to lucene and simulate rows and ids). But this seemed a heavy stretch and error prone.
Also, the Hibernate SessionFactory didn't allow multiple connection to different dbs then (I don't know how its today). So the real trick would be more like:
a) Create a HSQL string
b) Get the mapping
c) See that there is a "virtual" table mapped
d) Do the thing with the provided HSQL parameters on the "fake" db backend
e) Create a virtual table for hibernate to consumate
f) Execute the HSQL in hibernate
g) Enjoy the results ;)
I thought much about it back then, and I wonder that this is still a open(?), albeit quite esoteric request ;)
Maybe some of the main coders could shed some light on this problem?
greets
zenx