We have a multi-tenant web-based Enterprise application using Hibernate over MySQL. We use Jasper Reports for any reports that our customers require, but now we also need to offer ad-hoc reporting so that Users can run their own queries.
How have others accomplished this?
I am thinking that I can either:
Provide a full export in excel or xml format where I hydrate the entities so that any
@ManyToOne
is replaced with thetoString()
of that entity. This would be so that the data actually makes sense to the user rather than a whole lot of foreign key IDs.Let them run SQL against a database copy. Ensure that every table has a TENANT_ID, let them access the database copy but append the ID to every query behind the scenes. I could even ensure that this database copy only had their data in it. Sort of defeats the whole multi-tenant approach though.