Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsSelect count(*)
https://www.eclipse.org/forums/index.php/mv/msg/169679/538874/#msg_538874
JPQL: Select count(e) from entity e
to
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.
]]>Mauro Flores2010-06-08T20:41:55-00:00Re: Select count(*)
https://www.eclipse.org/forums/index.php/mv/msg/169679/539348/#msg_539348
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 Sutherland2010-06-10T14:01:58-00:00