Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » How can I get count of distinct left join subquery?
How can I get count of distinct left join subquery? [message #682634] Sat, 11 June 2011 17:56 Go to next message
Viacheslav Petriaiev is currently offline Viacheslav Petriaiev
Messages: 2
Registered: June 2011
Junior Member
How can I get count records of subquery with distinct and joins?

Is it possible using Criteria API to get SQL-query like that?
select count(g.*) from (select distinct from TABLE0 t0 LEFT OUTER JOIN TABLE1 t1 ON (t1.TABLE0_ID = t0.ID)) g;

[Updated on: Sat, 11 June 2011 18:04]

Report message to a moderator

Re: How can I get count of distinct left join subquery? [message #683428 is a reply to message #682634] Mon, 13 June 2011 17:52 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

What is the object model?

In general JPQL and Criteria do not support subselects in the from clause.

For a specific SQL query you can use a native query.


James : Wiki : Book : Blog : Twitter
(no subject) [message #683442 is a reply to message #682634] Mon, 13 June 2011 17:52 Go to previous message
James is currently offline James
Messages: 272
Registered: July 2009
Senior Member
What is the object model?

In general JPQL and Criteria do not support subselects in the from clause.

For a specific SQL query you can use a native query.

--
James : http://wiki.eclipse.org/EclipseLink : http://en.wikibooks.org/wiki/Java_Persistence : http://java-persistence-performance.blogspot.com/
Previous Topic:Update manytomany results in duplicate key exception
Next Topic:Catching Internal Exceptions
Goto Forum:
  


Current Time: Mon Oct 20 11:19:54 GMT 2014

Powered by FUDForum. Page generated in 0.02937 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software