The problem: I need to abstract my database interaction on my application. The thing is JPA doesn't work for me because the tables/schemas are dynamic and I only know them at runtime. I thought of creating the classes dynamically, but I'm looking at performance problems with that approach since every insertion would result in an instantiation of the class using reflection. I thought about using XML to model, but seems also slow and a bit difficult to manage.
What am I looking for? I'm looking for some middle layer language (something like JPQL [Java Persistence Query Language]) that I don't need to map to objects. Some language that abstracts schema/catalog and table creation as well queries using select clause.
Thanks in advance.