Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] JPQL + JOIN + SELECT IN

Job and Dependency tables don't have the foreign key set.
The dependeby table has 2 fields I am intrested in source_job_id and
target_job_id
I don't want to set the foreign key constraints for performance reasons,
this is failry rare operation.

tware wrote:
> 
> What are you trying to actually do?  I see "dep" only referenced at the
> end - 
> which seems to me to be trying to do some kind of cartesian product.  Do
> you 
> really mean something like:
> 
> Select Object(job) FROM EntityJob job JOIN job.dependency dep.......
> 
> -Tom
> 
> AnaTatavu wrote:
>>  
>> I am trying to issue the next JPQL query:
>> SELECT Object(job) FROM EntityJob job, Dependency dep WHERE (job
>> IN(SELECT
>> Object(j) FROM EntityJob j where j.jobName = 'TG_HTTP_JOB1')) and
>> (job.nameId=dep.targetNameId)
>> 
>> 
>> Exception Description: Syntax error parsing the query [
>> SELECT Object(job) FROM EntityJob job, Dependency dep WHERE (job
>> IN(SELECT
>> Object(j) FROM EntityJob j where j.jobName = 'TG_HTTP_JOB1')) and
>> (job.nameId=dep.targetNameId)], line 1, column 62: unexpected token [(].
>> Internal Exception: NoViableAltException(69!=[593:1: conditionalPrimary
>> returns [Object node] : ( ( LEFT_ROUND_BRACKET conditionalExpression )=>
>> LEFT_ROUND_BRACKET n= conditionalExpression RIGHT_ROUND_BRACKET | n=
>> simpleConditionalExpression );])
>> at
>> org.eclipse.persistence.exceptions.JPQLException.unexpectedToken(JPQLException.java:365)
>> 
>> 
>> I tried to remove the ( and I got a different exception.
>> 
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
> 
> 

-- 
View this message in context: http://www.nabble.com/JPQL-%2B-JOIN-%2B-SELECT-IN-tp22355819p22358786.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top