These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Group by en criteria
PostPosted: Fri Nov 02, 2007 12:24 pm 
Newbie

Joined: Fri Nov 02, 2007 12:21 pm
Posts: 1
Bonjour

J'ai un soucis ...

J'ai fait une requete en criteria mais je suis bloqué aux stades des aggrégats ...

en gros ma requete c'est :

Code:
SELECT [b]voiture.prix + SUM (IF (remorque.id<>0, remorque.poids + 1000, remorque.poids ))[/b]
FROM ...
GROUP BY voiture.id


Je n'arrive pas a faire cela ...

Apparement il faut utiliser cette methode d'Hibernate (SqlProjection) http://www.hibernate.org/hib_docs/v3/api/org/hibernate/criterion/Projections.html#sqlProjection(java.lang.String,%20java.lang.String[],%20org.hibernate.type.Type[])

Mais je ne comprends pas la fonctionnalité de cette méthode, il demande un string, un tableau d'alias et un tableau de type ... à quoi ça sert chacun ? Et comment utiliser ceci ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.