[HHH-2719] adddress --> address

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@12763 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Diego Plentz 2007-07-13 04:14:38 +00:00
parent 24eaebf6aa
commit 0abce7883b
7 changed files with 96 additions and 96 deletions

View File

@ -425,12 +425,12 @@ List pusList = query.setString("name", "Pus%").list(); ]]></programlist
SELECT person.NAME AS {person.name}, SELECT person.NAME AS {person.name},
person.AGE AS {person.age}, person.AGE AS {person.age},
person.SEX AS {person.sex}, person.SEX AS {person.sex},
adddress.STREET AS {address.street}, address.STREET AS {address.street},
adddress.CITY AS {address.city}, address.CITY AS {address.city},
adddress.STATE AS {address.state}, address.STATE AS {address.state},
adddress.ZIP AS {address.zip} address.ZIP AS {address.zip}
FROM PERSON person FROM PERSON person
JOIN ADDRESS adddress JOIN ADDRESS address
ON person.ID = address.PERSON_ID AND address.TYPE='MAILING' ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'
WHERE person.NAME LIKE :namePattern WHERE person.NAME LIKE :namePattern
</sql-query>]]></programlisting> </sql-query>]]></programlisting>
@ -461,12 +461,12 @@ List pusList = query.setString("name", "Pus%").list(); ]]></programlist
SELECT person.NAME AS {person.name}, SELECT person.NAME AS {person.name},
person.AGE AS {person.age}, person.AGE AS {person.age},
person.SEX AS {person.sex}, person.SEX AS {person.sex},
adddress.STREET AS {address.street}, address.STREET AS {address.street},
adddress.CITY AS {address.city}, address.CITY AS {address.city},
adddress.STATE AS {address.state}, address.STATE AS {address.state},
adddress.ZIP AS {address.zip} address.ZIP AS {address.zip}
FROM PERSON person FROM PERSON person
JOIN ADDRESS adddress JOIN ADDRESS address
ON person.ID = address.PERSON_ID AND address.TYPE='MAILING' ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'
WHERE person.NAME LIKE :namePattern WHERE person.NAME LIKE :namePattern
</sql-query>]]></programlisting> </sql-query>]]></programlisting>

View File

@ -139,12 +139,12 @@ List loggedCats = sess.createSQLQuery(sql)
SELECT person.NAME AS {person.name}, SELECT person.NAME AS {person.name},
person.AGE AS {person.age}, person.AGE AS {person.age},
person.SEX AS {person.sex}, person.SEX AS {person.sex},
adddress.STREET AS {address.street}, address.STREET AS {address.street},
adddress.CITY AS {address.city}, address.CITY AS {address.city},
adddress.STATE AS {address.state}, address.STATE AS {address.state},
adddress.ZIP AS {address.zip} address.ZIP AS {address.zip}
FROM PERSON person FROM PERSON person
JOIN ADDRESS adddress JOIN ADDRESS address
ON person.ID = address.PERSON_ID AND address.TYPE='MAILING' ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'
WHERE person.NAME LIKE :namePattern WHERE person.NAME LIKE :namePattern
</sql-query>]]></programlisting> </sql-query>]]></programlisting>

View File

@ -276,12 +276,12 @@ List loggedCats = sess.createSQLQuery(sql)
SELECT person.NAME AS {person.name}, SELECT person.NAME AS {person.name},
person.AGE AS {person.age}, person.AGE AS {person.age},
person.SEX AS {person.sex}, person.SEX AS {person.sex},
adddress.STREET AS {address.street}, address.STREET AS {address.street},
adddress.CITY AS {address.city}, address.CITY AS {address.city},
adddress.STATE AS {address.state}, address.STATE AS {address.state},
adddress.ZIP AS {address.zip} address.ZIP AS {address.zip}
FROM PERSON person FROM PERSON person
JOIN ADDRESS adddress JOIN ADDRESS address
ON person.ID = address.PERSON_ID AND address.TYPE='MAILING' ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'
WHERE person.NAME LIKE :namePattern WHERE person.NAME LIKE :namePattern
&lt;/sql-query&gt;</programlisting> &lt;/sql-query&gt;</programlisting>
@ -315,12 +315,12 @@ List loggedCats = sess.createSQLQuery(sql)
SELECT person.NAME AS {person.name}, SELECT person.NAME AS {person.name},
person.AGE AS {person.age}, person.AGE AS {person.age},
person.SEX AS {person.sex}, person.SEX AS {person.sex},
adddress.STREET AS {address.street}, address.STREET AS {address.street},
adddress.CITY AS {address.city}, address.CITY AS {address.city},
adddress.STATE AS {address.state}, address.STATE AS {address.state},
adddress.ZIP AS {address.zip} address.ZIP AS {address.zip}
FROM PERSON person FROM PERSON person
JOIN ADDRESS adddress JOIN ADDRESS address
ON person.ID = address.PERSON_ID AND address.TYPE='MAILING' ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'
WHERE person.NAME LIKE :namePattern WHERE person.NAME LIKE :namePattern
&lt;/sql-query&gt;</programlisting> &lt;/sql-query&gt;</programlisting>

View File

@ -391,12 +391,12 @@ List pusList = query.setString("name", "Pus%").list(); ]]></programlist
SELECT person.NAME AS {person.name}, SELECT person.NAME AS {person.name},
person.AGE AS {person.age}, person.AGE AS {person.age},
person.SEX AS {person.sex}, person.SEX AS {person.sex},
adddress.STREET AS {address.street}, address.STREET AS {address.street},
adddress.CITY AS {address.city}, address.CITY AS {address.city},
adddress.STATE AS {address.state}, address.STATE AS {address.state},
adddress.ZIP AS {address.zip} address.ZIP AS {address.zip}
FROM PERSON person FROM PERSON person
JOIN ADDRESS adddress JOIN ADDRESS address
ON person.ID = address.PERSON_ID AND address.TYPE='MAILING' ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'
WHERE person.NAME LIKE :namePattern WHERE person.NAME LIKE :namePattern
</sql-query>]]></programlisting> </sql-query>]]></programlisting>
@ -429,12 +429,12 @@ List pusList = query.setString("name", "Pus%").list(); ]]></programlist
SELECT person.NAME AS {person.name}, SELECT person.NAME AS {person.name},
person.AGE AS {person.age}, person.AGE AS {person.age},
person.SEX AS {person.sex}, person.SEX AS {person.sex},
adddress.STREET AS {address.street}, address.STREET AS {address.street},
adddress.CITY AS {address.city}, address.CITY AS {address.city},
adddress.STATE AS {address.state}, address.STATE AS {address.state},
adddress.ZIP AS {address.zip} address.ZIP AS {address.zip}
FROM PERSON person FROM PERSON person
JOIN ADDRESS adddress JOIN ADDRESS address
ON person.ID = address.PERSON_ID AND address.TYPE='MAILING' ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'
WHERE person.NAME LIKE :namePattern WHERE person.NAME LIKE :namePattern
</sql-query>]]></programlisting> </sql-query>]]></programlisting>

View File

@ -394,12 +394,12 @@ List pusList = query.setString("name", "Pus%").list(); ]]></programlist
SELECT person.NAME AS {person.name}, SELECT person.NAME AS {person.name},
person.AGE AS {person.age}, person.AGE AS {person.age},
person.SEX AS {person.sex}, person.SEX AS {person.sex},
adddress.STREET AS {address.street}, address.STREET AS {address.street},
adddress.CITY AS {address.city}, address.CITY AS {address.city},
adddress.STATE AS {address.state}, address.STATE AS {address.state},
adddress.ZIP AS {address.zip} address.ZIP AS {address.zip}
FROM PERSON person FROM PERSON person
JOIN ADDRESS adddress JOIN ADDRESS address
ON person.ID = address.PERSON_ID AND address.TYPE='MAILING' ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'
WHERE person.NAME LIKE :namePattern WHERE person.NAME LIKE :namePattern
</sql-query>]]></programlisting> </sql-query>]]></programlisting>
@ -428,12 +428,12 @@ List pusList = query.setString("name", "Pus%").list(); ]]></programlist
SELECT person.NAME AS {person.name}, SELECT person.NAME AS {person.name},
person.AGE AS {person.age}, person.AGE AS {person.age},
person.SEX AS {person.sex}, person.SEX AS {person.sex},
adddress.STREET AS {address.street}, address.STREET AS {address.street},
adddress.CITY AS {address.city}, address.CITY AS {address.city},
adddress.STATE AS {address.state}, address.STATE AS {address.state},
adddress.ZIP AS {address.zip} address.ZIP AS {address.zip}
FROM PERSON person FROM PERSON person
JOIN ADDRESS adddress JOIN ADDRESS address
ON person.ID = address.PERSON_ID AND address.TYPE='MAILING' ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'
WHERE person.NAME LIKE :namePattern WHERE person.NAME LIKE :namePattern
</sql-query>]]></programlisting> </sql-query>]]></programlisting>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<chapter id="querysql" revision="2"> <chapter id="querysql" revision="2">
<title>Native SQL</title> <title>Native SQL</title>
@ -425,12 +425,12 @@ List pusList = query.setString("name", "Pus%").list(); ]]></programlist
SELECT person.NAME AS {person.name}, SELECT person.NAME AS {person.name},
person.AGE AS {person.age}, person.AGE AS {person.age},
person.SEX AS {person.sex}, person.SEX AS {person.sex},
adddress.STREET AS {address.street}, address.STREET AS {address.street},
adddress.CITY AS {address.city}, address.CITY AS {address.city},
adddress.STATE AS {address.state}, address.STATE AS {address.state},
adddress.ZIP AS {address.zip} address.ZIP AS {address.zip}
FROM PERSON person FROM PERSON person
JOIN ADDRESS adddress JOIN ADDRESS address
ON person.ID = address.PERSON_ID AND address.TYPE='MAILING' ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'
WHERE person.NAME LIKE :namePattern WHERE person.NAME LIKE :namePattern
</sql-query>]]></programlisting> </sql-query>]]></programlisting>
@ -461,12 +461,12 @@ List pusList = query.setString("name", "Pus%").list(); ]]></programlist
SELECT person.NAME AS {person.name}, SELECT person.NAME AS {person.name},
person.AGE AS {person.age}, person.AGE AS {person.age},
person.SEX AS {person.sex}, person.SEX AS {person.sex},
adddress.STREET AS {address.street}, address.STREET AS {address.street},
adddress.CITY AS {address.city}, address.CITY AS {address.city},
adddress.STATE AS {address.state}, address.STATE AS {address.state},
adddress.ZIP AS {address.zip} address.ZIP AS {address.zip}
FROM PERSON person FROM PERSON person
JOIN ADDRESS adddress JOIN ADDRESS address
ON person.ID = address.PERSON_ID AND address.TYPE='MAILING' ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'
WHERE person.NAME LIKE :namePattern WHERE person.NAME LIKE :namePattern
</sql-query>]]></programlisting> </sql-query>]]></programlisting>
@ -601,10 +601,10 @@ BEGIN
<itemizedlist spacing="compact"> <itemizedlist spacing="compact">
<listitem> <listitem>
<para> <para>
A funçãp deve retornar um result set. O primeiro parâmetro da procedure A funçãp deve retornar um result set. O primeiro parâmetro da procedure
dever ser uma <literal>SAÍDA</literal> que retorne um result set. Isto é feito dever ser uma <literal>SAÍDA</literal> que retorne um result set. Isto é feito
usando o tipo a <literal>SYS_REFCURSOR</literal> no Oracle 9 ou 10. No Oracle é usando o tipo a <literal>SYS_REFCURSOR</literal> no Oracle 9 ou 10. No Oracle é
necessário definir o tipo <literal>REF CURSOR</literal>, veja a documentação do Oracle. necessário definir o tipo <literal>REF CURSOR</literal>, veja a documentação do Oracle.
</para> </para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
@ -615,16 +615,16 @@ BEGIN
<listitem> <listitem>
<para> <para>
A procedure deve retornar um result set. Veja que este servidor pode retornar A procedure deve retornar um result set. Veja que este servidor pode retornar
múltiplos result sets e update counts. O Hibernate ira iterar os resultados e múltiplos result sets e update counts. O Hibernate ira iterar os resultados e
pegar o primeiro resultado que é o valor de retorno do result set. pegar o primeiro resultado que é o valor de retorno do result set.
O resto será descartado. O resto será descartado.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Se você habilitar <literal>SET NOCOUNT ON</literal> na sua procedure, ela Se você habilitar <literal>SET NOCOUNT ON</literal> na sua procedure, ela
provavelmente será mais eficiente. Mas, isto não é obrigatório</para> provavelmente será mais eficiente. Mas, isto não é obrigatório</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
</sect3> </sect3>
@ -642,9 +642,9 @@ BEGIN
<literal>&lt;sql-delete&gt;</literal>, and <literal>&lt;sql-delete&gt;</literal>, and
<literal>&lt;sql-update&gt;</literal> override these strings: <literal>&lt;sql-update&gt;</literal> override these strings:
Hibernate3 pode usar SQL customizado para operações de create, update e delete. Hibernate3 pode usar SQL customizado para operações de create, update e delete.
A persistência de classe e collection no hibernate já contem alguma strings A persistência de classe e collection no hibernate já contem alguma strings
de configurações (insertsql, deletesql, updatesql etc.). de configurações (insertsql, deletesql, updatesql etc.).
O mapaemento das tags O mapaemento das tags
<literal>&lt;sql-insert&gt;</literal>, <literal>&lt;sql-insert&gt;</literal>,
<literal>&lt;sql-delete&gt;</literal>, e <literal>&lt;sql-delete&gt;</literal>, e
@ -663,13 +663,13 @@ BEGIN
</class>]]></programlisting> </class>]]></programlisting>
<para> <para>
O SQL é executado diretamente no seu banco de dados, então você pode usar qualquer O SQL é executado diretamente no seu banco de dados, então você pode usar qualquer
linguagem que quiser. Isto com certeza reduzira a portabilidade do seu mapeamento se linguagem que quiser. Isto com certeza reduzira a portabilidade do seu mapeamento se
você utilizar um SQL para um banco de dados especifico. você utilizar um SQL para um banco de dados especifico.
</para> </para>
<para> <para>
Stored Procedures são suportadas se o atributo the Stored Procedures são suportadas se o atributo the
<literal>callable</literal> estiver ativado: <literal>callable</literal> estiver ativado:
</para> </para>
@ -684,22 +684,22 @@ BEGIN
</class>]]></programlisting> </class>]]></programlisting>
<para> <para>
A ordem de posições dos parâmetros são vitais, pois eles devem estar na mesma seqüência A ordem de posições dos parâmetros são vitais, pois eles devem estar na mesma seqüência
esperada pelo Hibernate. esperada pelo Hibernate.
</para> </para>
<para>Você pode ver a ordem esperada ativando o debug logging no nível <para>Você pode ver a ordem esperada ativando o debug logging no nível
<literal>org.hibernate.persister.entity</literal>. Com este nível ativado, o Hibernate <literal>org.hibernate.persister.entity</literal>. Com este nível ativado, o Hibernate
irá imprimir o SQL estático que foi usado para create, update, delete, etc. irá imprimir o SQL estático que foi usado para create, update, delete, etc.
Entidades. (Para ver a seqüência esperada, lembre-se de não incluir seu SQL Entidades. (Para ver a seqüência esperada, lembre-se de não incluir seu SQL
customizado no arquivo de mapeamento, pois ele irá sobreecreve o SQL customizado no arquivo de mapeamento, pois ele irá sobreecreve o SQL
estático gerado pelo Hibernate). estático gerado pelo Hibernate).
</para> </para>
<para>As stored procedures são na maioria dos casos (leia: melhor não fazer) requeridas para <para>As stored procedures são na maioria dos casos (leia: melhor não fazer) requeridas para
retornar o numero de linhas inseridas/atualizadas/deletadas. O hibernate tem algumas retornar o numero de linhas inseridas/atualizadas/deletadas. O hibernate tem algumas
verificações em tempo de execução para o sucesso da declaração. Hibernate sempre registra verificações em tempo de execução para o sucesso da declaração. Hibernate sempre registra
o primeiro parâmetro da declaração como uma saída numérica para operações CRUD. o primeiro parâmetro da declaração como uma saída numérica para operações CRUD.
</para> </para>
<programlisting><![CDATA[CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN VARCHAR2) <programlisting><![CDATA[CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN VARCHAR2)
@ -723,7 +723,7 @@ END updatePerson;]]>
<title>SQL customizado para carga</title> <title>SQL customizado para carga</title>
<para> <para>
Você pode declarar sua própria query SQL (ou HQL) para iniciar entidades: Você pode declarar sua própria query SQL (ou HQL) para iniciar entidades:
</para> </para>
<programlisting><![CDATA[<sql-query name="person"> <programlisting><![CDATA[<sql-query name="person">
@ -735,8 +735,8 @@ END updatePerson;]]>
</sql-query>]]></programlisting> </sql-query>]]></programlisting>
<para> <para>
Este é apenas uma declaração de query com nome, como discutido anteriormente. Este é apenas uma declaração de query com nome, como discutido anteriormente.
Você pode referenciar esta query com nome em um mapeamento de classe: Você pode referenciar esta query com nome em um mapeamento de classe:
</para> </para>
<programlisting><![CDATA[<class name="Person"> <programlisting><![CDATA[<class name="Person">
@ -747,10 +747,10 @@ END updatePerson;]]>
<loader query-ref="person"/> <loader query-ref="person"/>
</class>]]></programlisting> </class>]]></programlisting>
<para>Isto também funciona com stored procedures. <para>Isto também funciona com stored procedures.
</para> </para>
<para>Você pode tembém definir uma query para iniciar collection: <para>Você pode tembém definir uma query para iniciar collection:
</para> </para>
<programlisting><![CDATA[<set name="employments" inverse="true"> <programlisting><![CDATA[<set name="employments" inverse="true">

View File

@ -377,12 +377,12 @@ List pusList = query.setString("name", "Pus%").list(); ]]></programlist
SELECT person.NAME AS {person.name}, SELECT person.NAME AS {person.name},
person.AGE AS {person.age}, person.AGE AS {person.age},
person.SEX AS {person.sex}, person.SEX AS {person.sex},
adddress.STREET AS {address.street}, address.STREET AS {address.street},
adddress.CITY AS {address.city}, address.CITY AS {address.city},
adddress.STATE AS {address.state}, address.STATE AS {address.state},
adddress.ZIP AS {address.zip} address.ZIP AS {address.zip}
FROM PERSON person FROM PERSON person
JOIN ADDRESS adddress JOIN ADDRESS address
ON person.ID = address.PERSON_ID AND address.TYPE='MAILING' ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'
WHERE person.NAME LIKE :namePattern WHERE person.NAME LIKE :namePattern
</sql-query>]]></programlisting> </sql-query>]]></programlisting>
@ -417,12 +417,12 @@ List pusList = query.setString("name", "Pus%").list(); ]]></programlist
SELECT person.NAME AS {person.name}, SELECT person.NAME AS {person.name},
person.AGE AS {person.age}, person.AGE AS {person.age},
person.SEX AS {person.sex}, person.SEX AS {person.sex},
adddress.STREET AS {address.street}, address.STREET AS {address.street},
adddress.CITY AS {address.city}, address.CITY AS {address.city},
adddress.STATE AS {address.state}, address.STATE AS {address.state},
adddress.ZIP AS {address.zip} address.ZIP AS {address.zip}
FROM PERSON person FROM PERSON person
JOIN ADDRESS adddress JOIN ADDRESS address
ON person.ID = address.PERSON_ID AND address.TYPE='MAILING' ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'
WHERE person.NAME LIKE :namePattern WHERE person.NAME LIKE :namePattern
</sql-query>]]></programlisting> </sql-query>]]></programlisting>