java - Hibernate group by criteria adds unwanted items to select list -


Is there any way to write hibernate criteria, so that in the selection list did not include properties using projection. GroupProperty Can go?

I prepare my projection list like this:

  launch list launch list = projection Projection list (); // I want these values ​​included in the selected list launch list .add (projection link ("campaign")) .add (projections.rowCount ()); // I do not want to select these values. I need only "group" of Projection List.ed ("Projection GroupProperty (" CAMPAIGN ")) Add (Projections.groupProperty (" ad.ID ")) .add (Projections.groupProperty (" region.id " );;  

Right now, the following query has been generated:

 select  DISTINCT this_.CAMPAIGN AS y0_ , Y1_ as count (*), this_.CAMPAIGN AS y2_, ad2_.ID AS y3_, y4_ account as area 3_.ID y4_ In_Inner Join Campaign Campaign 1_ in this account_CAMPAIGN = Campaign 1_.ID INNER Campaign Join ad2_ at1_.id = ad2_.CAMPAIGN INNER covered area This is AD2_.ID = region3_.AD at area 3_ where it__window = 4 group by_a_.CAMPAIGN, ad2_.ID, region3_.id  

this gives several additional lines which will not be If the last three items are not in the list, I

I want to create the same query without

  this_Y4_, Campaign as y3_ in the form of ad2_.ID, as field 3_.ID y4_  

select IST as part of L.

That is, GROUP BY is a way of objects and can not be included in the selection list?


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -