<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gronono.fr &#187; criteria</title>
	<atom:link href="http://www.gronono.fr/wordpress/tag/criteria/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gronono.fr/wordpress</link>
	<description>Un site fait par moi pour tout le monde.</description>
	<lastBuildDate>Mon, 16 May 2011 22:41:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Hibernate : Compter les résultats d&#8217;un criteria</title>
		<link>http://www.gronono.fr/wordpress/2008/06/hibernate-compter-les-resultats-dun-criteria/</link>
		<comments>http://www.gronono.fr/wordpress/2008/06/hibernate-compter-les-resultats-dun-criteria/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 07:54:41 +0000</pubDate>
		<dc:creator>Arnaud Brunet</dc:creator>
				<category><![CDATA[Informatique]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[criteria]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.gronono.fr/?p=45</guid>
		<description><![CDATA[Voici une petite astuce pour compter le nombre de résultats d'une requète Hibernate via l'API Critiria : Criteria criteria = createCriteria&#40;...&#41;; criteria.setProjection&#40;Projections.rowCount&#40;&#41;&#41;; int nbResults = &#40;&#40;Integer&#41; criteria.uniqueResult&#40;&#41;&#41;.intValue&#40;&#41;; C'est aussi simple que ça. Il suffit de créer son Critiria puis de faire une projection sur le nombre de résultat.]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-237 alignleft" title="Logo Hibernate" src="http://www.gronono.fr/wordpress/wp-content/uploads/2008/06/images.jpeg" alt="Logo Hibernate" width="45" height="45" />Voici une petite astuce pour compter le nombre de résultats d'une requète Hibernate via l'API Critiria :<br />
<span id="more-45"></span></p>
<pre class="java">Criteria criteria = createCriteria<span style="color: #66cc66;">&#40;</span>...<span style="color: #66cc66;">&#41;</span>;
criteria.<span style="color: #006600;">setProjection</span><span style="color: #66cc66;">&#40;</span>Projections.<span style="color: #006600;">rowCount</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333;">int</span> nbResults = <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AInteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Integer</span></a><span style="color: #66cc66;">&#41;</span> criteria.<span style="color: #006600;">uniqueResult</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">intValue</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre>
<p>C'est aussi simple que ça. Il suffit de créer son Critiria puis de faire une projection sur le nombre de résultat.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gronono.fr/wordpress/2008/06/hibernate-compter-les-resultats-dun-criteria/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

