Unfortunately today, Hibernate OGM does not support easily what you want. From what I understand, you use these tables as some kind of secondary indexes w/ a materialized view on each entry. And depending on the query you want to perform, you use one or the other of the tables.
We want to have that kind of capability in OGM at some point: declaratively denormalize how the data is stored and have the query engine use the best denormalized form, but we are not there yet. In the mean time indeed, you would need to create three entities which is inconvenient.
I'm tempted to say though that your use case might be solvable by Cassandra secondary indexes, am I missing something?
_________________ Emmanuel
|