I\'m currently stuck with what seems to be a very simple problem, but I just can\'t seem to find a way around:
I have 2 identical tables:
The other way to do it would be to use a partioned table on the database layer that would then make visible one single table to your java code.
This is probably the way to go as a general rule, the more smart partitioning you do, the faster your queries can be.