[HHH-2201] session.iterate() does not exist
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@12748 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
73df971530
commit
3ee3577314
|
@ -351,7 +351,7 @@ System.out.println( dc.getWeight() ); // 11.0]]></programlisting>
|
|||
</para>
|
||||
|
||||
<programlisting><![CDATA[Cat cat = (Cat) session.load(CatImpl.class, catid);
|
||||
Iterator iter = session.iterate("from CatImpl as cat where cat.name='fritz'");
|
||||
Iterator iter = session.createQuery("from CatImpl as cat where cat.name='fritz'").iterate();
|
||||
Cat fritz = (Cat) iter.next();]]></programlisting>
|
||||
|
||||
<para>
|
||||
|
|
|
@ -1085,7 +1085,7 @@ order by account.type.sortOrder, account.accountNumber, payment.dueDate]]></prog
|
|||
You can count the number of query results without actually returning them:
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[( (Integer) session.iterate("select count(*) from ....").next() ).intValue()]]></programlisting>
|
||||
<programlisting><![CDATA[( (Integer) session.createQuery("select count(*) from ....").iterate().next() ).intValue()]]></programlisting>
|
||||
|
||||
<para>
|
||||
To order a result by the size of a collection, use the following query:
|
||||
|
@ -1153,7 +1153,7 @@ Collection counts = s.filter( collection, "select this.type, count(this) group b
|
|||
You can find the size of a collection without initializing it:
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[( (Integer) session.iterate("select count(*) from ....").next() ).intValue();]]></programlisting>
|
||||
<programlisting><![CDATA[( (Integer) session.createQuery("select count(*) from ....").iterate().next() ).intValue();]]></programlisting>
|
||||
|
||||
</sect1>
|
||||
|
||||
|
|
|
@ -315,7 +315,7 @@ System.out.println( dc.getWeight() ); // 11.0]]></programlisting>
|
|||
</para>
|
||||
|
||||
<programlisting><![CDATA[Cat cat = (Cat) session.load(CatImpl.class, catid);
|
||||
Iterator iter = session.iterate("from CatImpl as cat where cat.name='fritz'");
|
||||
Iterator iter = session.createQuery("from CatImpl as cat where cat.name='fritz'").iterate();
|
||||
Cat fritz = (Cat) iter.next();]]></programlisting>
|
||||
|
||||
<para>
|
||||
|
|
|
@ -1031,7 +1031,7 @@ order by account.type.sortOrder, account.accountNumber, payment.dueDate]]></prog
|
|||
Puedes contar el número de resultados de una consulta sin devolverlos realmente:
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[( (Integer) session.iterate("select count(*) from ....").next() ).intValue()]]></programlisting>
|
||||
<programlisting><![CDATA[( (Integer) session.createQuery("select count(*) from ....").iterate().next() ).intValue()]]></programlisting>
|
||||
|
||||
<para>
|
||||
Para ordenar un resultado por el tamaño de una colección, usa la siguiente consulta:
|
||||
|
@ -1099,7 +1099,7 @@ Collection counts = s.filter( collection, "select this.type, count(this) group b
|
|||
Puedes hallar el tamaño de una colección sin inicializarla:
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[( (Integer) session.iterate("select count(*) from ....").next() ).intValue();]]></programlisting>
|
||||
<programlisting><![CDATA[( (Integer) session.createQuery("select count(*) from ....").iterate().next() ).intValue();]]></programlisting>
|
||||
|
||||
</sect1>
|
||||
|
||||
|
|
|
@ -369,7 +369,7 @@ System.out.println( dc.getWeight() ); // 11.0]]></programlisting>
|
|||
</para>
|
||||
|
||||
<programlisting><![CDATA[Cat cat = (Cat) session.load(CatImpl.class, catid);
|
||||
Iterator iter = session.iterate("from CatImpl as cat where cat.name='fritz'");
|
||||
Iterator iter = session.createQuery("from CatImpl as cat where cat.name='fritz'").iterate();
|
||||
Cat fritz = (Cat) iter.next();]]></programlisting>
|
||||
|
||||
<para>
|
||||
|
|
|
@ -1074,7 +1074,7 @@ order by account.type.sortOrder, account.accountNumber, payment.dueDate]]></prog
|
|||
Vous pouvez compter le nombre de résultats d'une requête sans les retourner :
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[( (Integer) session.iterate("select count(*) from ....").next() ).intValue()]]></programlisting>
|
||||
<programlisting><![CDATA[( (Integer) session.createQuery("select count(*) from ....").iterate().next() ).intValue()]]></programlisting>
|
||||
|
||||
<para>
|
||||
Pour trier les résultats par la taille d'une collection, utilisez la requête suivante :
|
||||
|
@ -1142,7 +1142,7 @@ Collection counts = s.filter( collection, "select this.type, count(this) group b
|
|||
Vous pouvez récupérer la taille d'une collection sans l'initialiser :
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[( (Integer) session.iterate("select count(*) from ....").next() ).intValue();]]></programlisting>
|
||||
<programlisting><![CDATA[( (Integer) session.createQuery("select count(*) from ....").iterate().next() ).intValue();]]></programlisting>
|
||||
|
||||
</sect1>
|
||||
|
||||
|
|
|
@ -347,7 +347,7 @@ System.out.println( dc.getWeight() ); // 11.0]]></programlisting>
|
|||
</para>
|
||||
|
||||
<programlisting><![CDATA[Cat cat = (Cat) session.load(CatImpl.class, catid);
|
||||
Iterator iter = session.iterate("from CatImpl as cat where cat.name='fritz'");
|
||||
Iterator iter = session.createQuery("from CatImpl as cat where cat.name='fritz'").iterate();
|
||||
Cat fritz = (Cat) iter.next();]]></programlisting>
|
||||
|
||||
<para>
|
||||
|
|
|
@ -1056,7 +1056,7 @@ order by account.type.sortOrder, account.accountNumber, payment.dueDate]]></prog
|
|||
実際に結果を返さなくてもクエリの結果数を数えることができます。:
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[( (Integer) session.iterate("select count(*) from ....").next() ).intValue()]]></programlisting>
|
||||
<programlisting><![CDATA[( (Integer) session.createQuery("select count(*) from ....").iterate().next() ).intValue()]]></programlisting>
|
||||
|
||||
<para>
|
||||
コレクションのサイズにより結果を並べ替えるためには以下のクエリを使用します。:
|
||||
|
@ -1123,7 +1123,7 @@ Collection counts = s.filter( collection, "select this.type, count(this) group b
|
|||
コレクションを初期化せずにコレクションのサイズを得ることができます。:
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[( (Integer) session.iterate("select count(*) from ....").next() ).intValue();]]></programlisting>
|
||||
<programlisting><![CDATA[( (Integer) session.createQuery("select count(*) from ....").iterate().next() ).intValue();]]></programlisting>
|
||||
|
||||
</sect1>
|
||||
|
||||
|
|
|
@ -315,7 +315,7 @@ System.out.println( dc.getWeight() ); // 11.0]]></programlisting>
|
|||
</para>
|
||||
|
||||
<programlisting><![CDATA[Cat cat = (Cat) session.load(CatImpl.class, catid);
|
||||
Iterator iter = session.iterate("from CatImpl as cat where cat.name='fritz'");
|
||||
Iterator iter = session.createQuery("from CatImpl as cat where cat.name='fritz'").iterate();
|
||||
Cat fritz = (Cat) iter.next();]]></programlisting>
|
||||
|
||||
<para>
|
||||
|
|
|
@ -1032,7 +1032,7 @@ order by account.type.sortOrder, account.accountNumber, payment.dueDate]]></prog
|
|||
당신은 실제로 질의 결과들을 반환하지 않고서 그것들(질의 결과들)의 개수를 카운트할 수 있다:
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[( (Integer) session.iterate("select count(*) from ....").next() ).intValue()]]></programlisting>
|
||||
<programlisting><![CDATA[( (Integer) session.createQuery("select count(*) from ....").iterate().next() ).intValue()]]></programlisting>
|
||||
|
||||
<para>
|
||||
콜렉션의 크기에 따라 결과를 순서(ordering)지우려면, 다음 질의를 사용하라:
|
||||
|
@ -1099,7 +1099,7 @@ Collection counts = s.filter( collection, "select this.type, count(this) group b
|
|||
당신은 콜렉션을 초기화 하지 않고서 그것(콜렉션)의 크기를 찾을 수 있다:
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[( (Integer) session.iterate("select count(*) from ....").next() ).intValue();]]></programlisting>
|
||||
<programlisting><![CDATA[( (Integer) session.createQuery("select count(*) from ....").iterate().next() ).intValue();]]></programlisting>
|
||||
|
||||
</sect1>
|
||||
|
||||
|
|
|
@ -346,7 +346,7 @@ System.out.println( dc.getWeight() ); // 11.0]]></programlisting>
|
|||
</para>
|
||||
|
||||
<programlisting><![CDATA[Cat cat = (Cat) session.load(CatImpl.class, catid);
|
||||
Iterator iter = session.iterate("from CatImpl as cat where cat.name='fritz'");
|
||||
Iterator iter = session.createQuery("from CatImpl as cat where cat.name='fritz'").iterate();
|
||||
Cat fritz = (Cat) iter.next();]]></programlisting>
|
||||
|
||||
<para>
|
||||
|
|
|
@ -1085,7 +1085,7 @@ order by account.type.sortOrder, account.accountNumber, payment.dueDate]]></prog
|
|||
Pode-se contar o número de resultados da query, sem realmente retorna-los.
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[( (Integer) session.iterate("select count(*) from ....").next() ).intValue()]]></programlisting>
|
||||
<programlisting><![CDATA[( (Integer) session.createQuery("select count(*) from ....").iterate().next() ).intValue()]]></programlisting>
|
||||
|
||||
<para>
|
||||
Para ordenar um resultado pelo tamanho de uma Collection, use a query a seguir.
|
||||
|
@ -1154,7 +1154,7 @@ Collection counts = s.filter( collection, "select this.type, count(this) group b
|
|||
Pode-se achar o tamanho de uma Collection sem inicializa-la:
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[( (Integer) session.iterate("select count(*) from ....").next() ).intValue();]]></programlisting>
|
||||
<programlisting><![CDATA[( (Integer) session.createQuery("select count(*) from ....").iterate().next() ).intValue();]]></programlisting>
|
||||
|
||||
</sect1>
|
||||
|
||||
|
|
|
@ -310,7 +310,7 @@ System.out.println( dc.getWeight() ); // 11.0]]></programlisting>
|
|||
</para>
|
||||
|
||||
<programlisting><![CDATA[Cat cat = (Cat) session.load(CatImpl.class, catid);
|
||||
Iterator iter = session.iterate("from CatImpl as cat where cat.name='fritz'");
|
||||
Iterator iter = session.createQuery("from CatImpl as cat where cat.name='fritz'").iterate();
|
||||
Cat fritz = (Cat) iter.next();]]></programlisting>
|
||||
|
||||
<para>
|
||||
|
|
|
@ -1014,7 +1014,7 @@ order by account.type.sortOrder, account.accountNumber, payment.dueDate]]></prog
|
|||
你可以统计查询结果的数目而不必实际的返回他们:
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[( (Integer) session.iterate("select count(*) from ....").next() ).intValue()]]></programlisting>
|
||||
<programlisting><![CDATA[( (Integer) session.createQuery("select count(*) from ....").iterate().next() ).intValue()]]></programlisting>
|
||||
|
||||
<para>
|
||||
若想根据一个集合的大小来进行排序,可以使用如下的语句:
|
||||
|
@ -1081,7 +1081,7 @@ Collection counts = s.filter( collection, "select this.type, count(this) group b
|
|||
不用通过初始化,你就可以知道一个集合(Collection)的大小:
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[( (Integer) session.iterate("select count(*) from ....").next() ).intValue();]]></programlisting>
|
||||
<programlisting><![CDATA[( (Integer) session.createQuery("select count(*) from ....").iterate().next() ).intValue();]]></programlisting>
|
||||
|
||||
</sect1>
|
||||
|
||||
|
|
Loading…
Reference in New Issue