I'm trying to explain my problem with an example:
Code:
@Entity
@SecondaryTables({
@SecondaryTable(name="TABLE_A", ...),
@SecondaryTable(name="TABLE_B", ...)
})
public class Example extends Base {
@Column(name = "a", table="TABLE_A")
private String a;
@Column(name = "b", table="TABLE_B")
private String b;
}
I'm working on a legacy database. As the tables are not organized perfect, I want to use each possibility to gain performance.
What do I want for this example: The generated sql query should not use all secondary tables by default. The using of tables should depend on which properties are selected. For the query
Code:
select e.a from example
the table TABLE_B should not be used. Only table TABLE_A should be joined with the table of the Base class.
Is this possible?