How can i get count() result by using jpql !
I can not get result by EntityManager.getSingleResult() My jpql is that:
"select count(c.id) from Test1Entity "
Can anyone help me!
Aggregate functions are not supported.
-Vivek
Thanks for your response. when paging, i need get the total records nums.... we are using cassandra 1.2 now..
so, can you implement it for me in 2.3. Thank you very mutch!!!!!!
I will try to get this working in 2.3 release.
-Vivek
Thank you very much! I am looking forward to it.......
Support added on latest trunk, will be released with 2.3
-Vivek
thank you very much! i will try it in the new version.
sorry, can you give me a sample to do count by jpql?
it seem that getSingleResult() is not implemented in kundera2.3
Here is a test case: https://github.com/impetus-opensource/Kundera/blob/trunk/kundera-cassandra/src/test/java/com/impetus/client/crud/PersonCassandraTest.java
Method: getCountResult().
As discussed on some other issue thread as well, getSingleResult() will be in future releases. But support for count queries is enabled in 2.3
thanks for your sample! it seems that count can be done by CQL now.
by the way, can i do count by using jpql like "select count(c) from Test1 c " by using excuteQuery()?
Hi Zhouhero,
Native queries in Kundera are passed to database "as it is" and they are run by query language interpreter (or whatever mechanism) provided within datastore.
Since CQL allows only * or 1 in count function, you can run native queries in below two formats only:
- select count(*) from tableName;
- select count(1) from tableName;
Thanks Kuldeep
On Wed, Jan 30, 2013 at 6:01 AM, zhouhero [email protected] wrote:
thanks for your sample! it seems that count can be done by CQL now.
by the way, can i do count by using jpql like "select count(c) from Test1 c " by using excuteQuery()?
— Reply to this email directly or view it on GitHubhttps://github.com/impetus-opensource/Kundera/issues/150#issuecomment-12867262.
Thanks and Regards Kuldeep Kumar Mishra +919540965199
thanks for you explanations. but what i say is using JPQL not CQL. when using JPQL how can i do it?
Will try to assess it for 2.4. As change in JPQL will require more assessment with other databases as well. Even with JPQL, it will get converted into CQL. So i guess it should not much difference in terms of usage. Is there anything you not able achieve via CQL and looking forward to be done with JPQL?
-Vivek
we are using JPQL now, as you know, there are many problems in using CQL(CQLSH) and Shrift at the same time. so we want using Shrift only. if we using JPQL an set the driver to Shrift, we can do well by Shrift withe kundera, i think so.
Well, i guess using CqL for count() should not be any problem with Kundera. It is executed via Thrift only!
-Vivek
As you know , there are many meta infomations' problems in thrift cql api . Pls refer to: https://github.com/impetus-opensource/Kundera/issues/170
"select count(c.id) from Test1Entity c" i s can be used now in kunder2.4 + cassandra1.2?
by the way, is the getCountResult() ok in kundera2.5?