Oracle Dialect Creates Invalid SQL (misplaced join clause)

Description

The following HQL:

select target from com.vecna.secureTelnet.TOLRemoteTarget as target
where 1 = 1 and upper(target.chcsHost.site.name) like
upper(:chcsHostName) order by target.chcsHost.baseUrl asc

Produces the following SQL using the Oracle9Dialect:

select
tolremotet0_.remote_target_id as id,
tolremotet0_.XXX as XXX_, ....,
tolremotet0_1.name as name1_, ...
from

tol_remote_target tolremotet0_
inner join remote_target tolremotet0_1 on
tolremotet0_.remote_target_id=tolremotet0_1.id,

chcs_host chcshost1_,

mtf mtf2_
left outer join service_location chcshost1_1 on
chcshost1_.service_location_id=chcshost1_1.id

where tolremotet0_.chcs_host=chcshost1_.service_location_id
and ((1=1 )and(upper(mtf2_.name)like upper
and tolremotet0_.chcs_host=chcshost1_.service_location_id
and chcshost1_.site_mtf_id=mtf2_.id))

order by chcshost1_.base_url asc

This is invalid SQL. Oracle complains: ORA-00904: "CHCSHOST1_"."SERVICE_LOCATION_ID": invalid identifier

If I move the left outer join from below the mtf to after the chcs_host, the query works.

Environment

Oracle 9

Assignee

Unassigned

Reporter

ToddT

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Affects versions

Priority

Minor
Configure