I've read the documentation 10.3 about the fetch clause:
Quote:
A fetch join does not usually need to assign an alias, because the associated objects should not be used in the where clause (or any other clause). Also, the associated objects are not returned directly in the query results. Instead, they may be accessed via the parent object.
-> "fetch join does not usually need to assign an alias", but if I need of the fetch join in the where clause?
In my code I have a many-to-one association and I've defined a alias "secao" to the fetch join, because I must use it in a where clause, is this correct?
Code:
sb = new StringBuffer();
sb.append(" FROM BibliotecaHTMLVO AS html ");
sb.append(" INNER JOIN fetch html.secao as secao");
sb.append(" WHERE secao.titulo like ? ");
thanks