Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Select count(*)(Select count(*))
Select count(*) [message #538874] Tue, 08 June 2010 20:41 Go to next message
Mauro Flores is currently offline Mauro FloresFriend
Messages: 84
Registered: September 2009
Location: Brasil
Is there a way to make EclipseLink tronsform

JPQL: Select count(e) from entity e


SQL: Select count(*) from table t

And not to

SQL: Select count(pk_column) from table t

I'm working with a legacy database that just accepts count(*).

The eclipselink version is 1.2.0.

Thanks. Mauro.

Re: Select count(*) [message #539348 is a reply to message #538874] Thu, 10 June 2010 14:01 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

EclipseLink used to print count like this a while ago, but always uses a field in the count now.

What database are you using? You could log a bug for support for a count(*) on the database platform.

You could override the count yourself, but it will be a little tricky. You will need to define an ExpressionOperator and add it to the ExpressionOperator operators to override the Count operator. You could just print COUNT(*) in your operator. You will also need to override the printCollection method in your own Count ExpressionOperator subclass.

James : Wiki : Book : Blog : Twitter
Previous Topic:Invalidate Shared Cache
Next Topic:historical query - only Oracle 9R2 or later?
Goto Forum:

Current Time: Fri Oct 19 23:38:00 GMT 2018

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

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

Back to the top