[HHH-1694] Documentation Outdated: "10.4.4. Queries in native SQL"
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@12765 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
0abce7883b
commit
394abb8fbf
|
@ -572,19 +572,16 @@ List cats = crit.list();]]></programlisting>
|
||||||
Hibernate API, you must enclose SQL aliases in braces:
|
Hibernate API, you must enclose SQL aliases in braces:
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
<programlisting><![CDATA[List cats = session.createSQLQuery("SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10")
|
||||||
"SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10",
|
.addEntity("cat", Cat.class)
|
||||||
"cat",
|
.list();]]></programlisting>
|
||||||
Cat.class
|
|
||||||
).list();]]></programlisting>
|
|
||||||
|
|
||||||
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
||||||
"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, " +
|
"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, " +
|
||||||
"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... " +
|
"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... " +
|
||||||
"FROM CAT {cat} WHERE ROWNUM<10",
|
"FROM CAT {cat} WHERE ROWNUM<10")
|
||||||
"cat",
|
.addEntity("cat", Cat.class)
|
||||||
Cat.class
|
.list()]]></programlisting>
|
||||||
).list()]]></programlisting>
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
SQL queries may contain named and positional parameters, just like Hibernate queries.
|
SQL queries may contain named and positional parameters, just like Hibernate queries.
|
||||||
|
|
|
@ -564,19 +564,16 @@ List cats = crit.list();]]></programlisting>
|
||||||
Hibernate, debes encerrar los alias de SQL entre llaves:
|
Hibernate, debes encerrar los alias de SQL entre llaves:
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
<programlisting><![CDATA[List cats = session.createSQLQuery("SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10")
|
||||||
"SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10",
|
.addEntity("cat", Cat.class)
|
||||||
"cat",
|
.list();]]></programlisting>
|
||||||
Cat.class
|
|
||||||
).list();]]></programlisting>
|
|
||||||
|
|
||||||
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
||||||
"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, " +
|
"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, " +
|
||||||
"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... " +
|
"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... " +
|
||||||
"FROM CAT {cat} WHERE ROWNUM<10",
|
"FROM CAT {cat} WHERE ROWNUM<10")
|
||||||
"cat",
|
.addEntity("cat", Cat.class)
|
||||||
Cat.class
|
.list()]]></programlisting>
|
||||||
).list()]]></programlisting>
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Las consultas SQL pueden contener parámetros con nombre y posicionales, al igual que
|
Las consultas SQL pueden contener parámetros con nombre y posicionales, al igual que
|
||||||
|
|
|
@ -558,19 +558,16 @@ List cats = crit.list();]]></programlisting>
|
||||||
l'API Hibernate, vous devez mettre les alias SQL entre accolades :
|
l'API Hibernate, vous devez mettre les alias SQL entre accolades :
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
<programlisting><![CDATA[List cats = session.createSQLQuery("SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10")
|
||||||
"SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10",
|
.addEntity("cat", Cat.class)
|
||||||
"cat",
|
.list();]]></programlisting>
|
||||||
Cat.class
|
|
||||||
).list();]]></programlisting>
|
|
||||||
|
|
||||||
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
||||||
"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, " +
|
"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, " +
|
||||||
"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... " +
|
"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... " +
|
||||||
"FROM CAT {cat} WHERE ROWNUM<10",
|
"FROM CAT {cat} WHERE ROWNUM<10")
|
||||||
"cat",
|
.addEntity("cat", Cat.class)
|
||||||
Cat.class
|
.list()]]></programlisting>
|
||||||
).list()]]></programlisting>
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Les requêtes SQL peuvent contenir des paramètres nommés et positionnels, comme des
|
Les requêtes SQL peuvent contenir des paramètres nommés et positionnels, comme des
|
||||||
|
|
|
@ -537,21 +537,16 @@ List cats = crit.list();]]></programlisting>
|
||||||
<literal>Connection</literal> を使用できることを覚えておきましょう。 もし、Hibernate
|
<literal>Connection</literal> を使用できることを覚えておきましょう。 もし、Hibernate
|
||||||
APIを使うのであれば、下記のようにSQLの別名を括弧でくくらなければなりません。 </para>
|
APIを使うのであれば、下記のようにSQLの別名を括弧でくくらなければなりません。 </para>
|
||||||
|
|
||||||
|
<programlisting><![CDATA[List cats = session.createSQLQuery("SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10")
|
||||||
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
.addEntity("cat", Cat.class)
|
||||||
"SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10",
|
.list();]]></programlisting>
|
||||||
"cat",
|
|
||||||
Cat.class
|
|
||||||
).list();]]></programlisting>
|
|
||||||
|
|
||||||
|
|
||||||
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
||||||
"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, " +
|
"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, " +
|
||||||
"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... " +
|
"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... " +
|
||||||
"FROM CAT {cat} WHERE ROWNUM<10",
|
"FROM CAT {cat} WHERE ROWNUM<10")
|
||||||
"cat",
|
.addEntity("cat", Cat.class)
|
||||||
Cat.class
|
.list()]]></programlisting>
|
||||||
).list()]]></programlisting>
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
SQLクエリは、Hibernateクエリと同じように、名前付きのパラメータと位置パラメータを持つことができます。
|
SQLクエリは、Hibernateクエリと同じように、名前付きのパラメータと位置パラメータを持つことができます。
|
||||||
|
|
|
@ -523,19 +523,16 @@ List cats = crit.list();]]></programlisting>
|
||||||
중괄호들 속에 포함시켜야 한다:
|
중괄호들 속에 포함시켜야 한다:
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
<programlisting><![CDATA[List cats = session.createSQLQuery("SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10")
|
||||||
"SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10",
|
.addEntity("cat", Cat.class)
|
||||||
"cat",
|
.list();]]></programlisting>
|
||||||
Cat.class
|
|
||||||
).list();]]></programlisting>
|
|
||||||
|
|
||||||
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
||||||
"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, " +
|
"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, " +
|
||||||
"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... " +
|
"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... " +
|
||||||
"FROM CAT {cat} WHERE ROWNUM<10",
|
"FROM CAT {cat} WHERE ROWNUM<10")
|
||||||
"cat",
|
.addEntity("cat", Cat.class)
|
||||||
Cat.class
|
.list()]]></programlisting>
|
||||||
).list()]]></programlisting>
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
SQL 질의들은 Hibernate 질의들처럼 명명된 파라미터들과 위치 파라미터들을 포함할 수도 있다. SQL 질의들에 대한
|
SQL 질의들은 Hibernate 질의들처럼 명명된 파라미터들과 위치 파라미터들을 포함할 수도 있다. SQL 질의들에 대한
|
||||||
|
|
|
@ -580,19 +580,16 @@ List cats = crit.list();]]></programlisting>
|
||||||
Hibernate API, you must enclose SQL aliases in braces:
|
Hibernate API, you must enclose SQL aliases in braces:
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
<programlisting><![CDATA[List cats = session.createSQLQuery("SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10")
|
||||||
"SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10",
|
.addEntity("cat", Cat.class)
|
||||||
"cat",
|
.list();]]></programlisting>
|
||||||
Cat.class
|
|
||||||
).list();]]></programlisting>
|
|
||||||
|
|
||||||
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
||||||
"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, " +
|
"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, " +
|
||||||
"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... " +
|
"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... " +
|
||||||
"FROM CAT {cat} WHERE ROWNUM<10",
|
"FROM CAT {cat} WHERE ROWNUM<10")
|
||||||
"cat",
|
.addEntity("cat", Cat.class)
|
||||||
Cat.class
|
.list()]]></programlisting>
|
||||||
).list()]]></programlisting>
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
SQL queries may contain named and positional parameters, just like Hibernate queries.
|
SQL queries may contain named and positional parameters, just like Hibernate queries.
|
||||||
|
|
|
@ -517,20 +517,16 @@ List cats = crit.list();]]></programlisting>
|
||||||
如果你选择使用Hibernate的API, 你必须把SQL别名用大括号包围起来:
|
如果你选择使用Hibernate的API, 你必须把SQL别名用大括号包围起来:
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
<programlisting><![CDATA[List cats = session.createSQLQuery("SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10")
|
||||||
"SELECT {cat.*} FROM CAT {cat} WHERE ROWNUM<10",
|
.addEntity("cat", Cat.class)
|
||||||
"cat",
|
.list();]]></programlisting>
|
||||||
Cat.class
|
|
||||||
).list();]]></programlisting>
|
|
||||||
|
|
||||||
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
<programlisting><![CDATA[List cats = session.createSQLQuery(
|
||||||
"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, " +
|
"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, " +
|
||||||
"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... " +
|
"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... " +
|
||||||
"FROM CAT {cat} WHERE ROWNUM<10",
|
"FROM CAT {cat} WHERE ROWNUM<10")
|
||||||
"cat",
|
.addEntity("cat", Cat.class)
|
||||||
Cat.class
|
.list()]]></programlisting>
|
||||||
).list()]]></programlisting>
|
|
||||||
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
和Hibernate查询一样,SQL查询也可以包含命名参数和占位参数。
|
和Hibernate查询一样,SQL查询也可以包含命名参数和占位参数。
|
||||||
|
|
Loading…
Reference in New Issue