I'm using eclipse link as JPA implementation. I have a named Query like this:
@NamedQuery(name = "QueryName",
query = "SELECT c FROM Customer c, AccountingUnit au where c.contract.state = :state AND ...")
The resulting SQL query will actually query over 4 tables that get table aliases t0, t1, t2, t3 similar like this:
SELECT ... FROM CUSTOMER t0, ACCOUNTING_UNIT t1, CUSTOMER_CONTRACT t2, ...
and now I want to add an Oracle Hint which works when I say:
query.setHint("eclipselink.sql.hint" , "/*+ USE_NL(t0 t2) */");
but I would prefer to write it like this:
query.setHint("eclipselink.sql.hint" , "/*+ USE_NL(Customer Customer_Contract) */");
Is there any way to do this?