📄 query_hql.po
字号:
#. Tag: para#: query_hql.xml:190#, no-c-formatmsgid """The queries shown in the previous section all use the <literal>explicit</""literal> form where the join keyword is explicitly used in the from clause. ""This is the recommended form."msgstr """As queries apresentadas na seção anterior usam a forma <literal>explicita</""literal>, onde a palavra chave \"join\" é explicitamente usada na clausula ""\"from\". Essa é a forma recomendada."#. Tag: para#: query_hql.xml:195#, no-c-formatmsgid """The <literal>implicit</literal> form does not use the join keyword. Instead, ""the associations are \"dereferenced\" using dot-notation. <literal>implicit</""literal> joins can appear in any of the HQL clauses. <literal>implicit</""literal> join result in inner joins in the resulting SQL statement."msgstr """A forma <literal>implícita</literal> não usa a palavra chave \"join\". ""Entretanto, as associações são diferenciadas usando pontuação (\".\" - ""dotnation). Uniões implícitas podem aparecer em qualquer das clausulas HQL. ""A união <literal>implícita</literal> resulta em declarações SQL que contem ""inner joins."#. Tag: programlisting#: query_hql.xml:202#, no-c-formatmsgid "<![CDATA[from Cat as cat where cat.mate.name like '%s%']]>"msgstr ""#. Tag: title#: query_hql.xml:206#, no-c-formatmsgid "Refering to identifier property"msgstr "Refering to identifier property"#. Tag: para#: query_hql.xml:208#, no-c-formatmsgid """There are, generally speaking, 2 ways to refer to an entity's identifier ""property:"msgstr """There are, generally speaking, 2 ways to refer to an entity's identifier ""property:"#. Tag: para#: query_hql.xml:213#, no-c-formatmsgid """The special property (lowercase) <literal>id</literal> may be used to ""reference the identifier property of an entity <emphasis>provided that ""entity does not define a non-identifier property named id</emphasis>."msgstr """The special property (lowercase) <literal>id</literal> may be used to ""reference the identifier property of an entity <emphasis>provided that ""entity does not define a non-identifier property named id</emphasis>."#. Tag: para#: query_hql.xml:220#, no-c-formatmsgid """If the entity defines a named identifier property, you may use that property ""name."msgstr """If the entity defines a named identifier property, you may use that property ""name."#. Tag: para#: query_hql.xml:226#, no-c-formatmsgid """References to composite identifier properties follow the same naming rules. ""If the entity has a non-identifier property named id, the composite ""identifier property can only be referenced by its defined named; otherwise, ""the special <literal>id</literal> property can be used to rerference the ""identifier property."msgstr """References to composite identifier properties follow the same naming rules. ""If the entity has a non-identifier property named id, the composite ""identifier property can only be referenced by its defined named; otherwise, ""the special <literal>id</literal> property can be used to rerference the ""identifier property."#. Tag: para#: query_hql.xml:233#, fuzzy, no-c-formatmsgid """Note: this has changed significantly starting in version 3.2.2. In previous ""versions, <literal>id</literal> <emphasis>always</emphasis> referred to the ""identifier property no matter what its actual name. A ramification of that ""decision was that non-identifier properties named <literal>id</literal> ""could never be referenced in Hibernate queries."msgstr """Note: this has changed significantly starting in version 3.2.2. In previous ""versions, <literal>id</literal><emphasis>always</emphasis> referred to the ""identifier property no matter what its actual name. A ramification of that ""decision was that non-identifier properties named <literal>id</literal> ""could never be referenced in Hibernate queries."#. Tag: title#: query_hql.xml:242#, no-c-formatmsgid "The select clause"msgstr "Clausula select"#. Tag: para#: query_hql.xml:244#, no-c-formatmsgid """The <literal>select</literal> clause picks which objects and properties to ""return in the query result set. Consider:"msgstr """A clausula <literal>select</literal> seleciona quais obetos e propriedades ""retornam no resultado da query. Considere:"#. Tag: programlisting#: query_hql.xml:249#, no-c-formatmsgid """<![CDATA[select mate\n""from Cat as cat\n"" inner join cat.mate as mate]]>"msgstr ""#. Tag: para#: query_hql.xml:251#, no-c-formatmsgid """The query will select <literal>mate</literal>s of other <literal>Cat</""literal>s. Actually, you may express this query more compactly as:"msgstr """A query selecionará <literal>mate</literal>s (companheiros), de outros ""<literal>Cat</literal>s. Atualmente, podemos expressar a query de forma mais ""compacta como:"#. Tag: programlisting#: query_hql.xml:256#, no-c-formatmsgid "<![CDATA[select cat.mate from Cat cat]]>"msgstr ""#. Tag: para#: query_hql.xml:258#, no-c-formatmsgid """Queries may return properties of any value type including properties of ""component type:"msgstr """Queries podem retornar propriedades de qualquer tipo de valor, incluindo ""propriedades de tipo de componente:"#. Tag: programlisting#: query_hql.xml:262#, no-c-formatmsgid """<![CDATA[select cat.name from DomesticCat cat\n""where cat.name like 'fri%']]>"msgstr ""#. Tag: programlisting#: query_hql.xml:264#, no-c-formatmsgid "<![CDATA[select cust.name.firstName from Customer as cust]]>"msgstr ""#. Tag: para#: query_hql.xml:266#, no-c-formatmsgid """Queries may return multiple objects and/or properties as an array of type ""<literal>Object[]</literal>,"msgstr """Queries podem retornar múltiplos objetos e/ou propriedades como um array do ""tipo Object[],"#. Tag: programlisting#: query_hql.xml:271#, no-c-formatmsgid """<![CDATA[select mother, offspr, mate.name\n""from DomesticCat as mother\n"" inner join mother.mate as mate\n"" left outer join mother.kittens as offspr]]>"msgstr ""#. Tag: para#: query_hql.xml:273#, no-c-formatmsgid "or as a <literal>List</literal>,"msgstr "ou como um <literal>List</literal>,"#. Tag: programlisting#: query_hql.xml:277#, no-c-formatmsgid """<![CDATA[select new list(mother, offspr, mate.name)\n""from DomesticCat as mother\n"" inner join mother.mate as mate\n"" left outer join mother.kittens as offspr]]>"msgstr ""#. Tag: para#: query_hql.xml:279#, no-c-formatmsgid "or as an actual typesafe Java object,"msgstr "ou como um objeto Java typesafe,"#. Tag: programlisting#: query_hql.xml:283#, no-c-formatmsgid """<![CDATA[select new Family(mother, mate, offspr)\n""from DomesticCat as mother\n"" join mother.mate as mate\n"" left join mother.kittens as offspr]]>"msgstr ""#. Tag: para#: query_hql.xml:285#, no-c-formatmsgid """assuming that the class <literal>Family</literal> has an appropriate ""constructor."msgstr """assumindo que a classe <literal>Family</literal> tenha um construtor ""apropriado."#. Tag: para#: query_hql.xml:289#, no-c-formatmsgid """You may assign aliases to selected expressions using <literal>as</literal>:"msgstr """Pode-se designar referencias a expressões selecionadas, <literal>as</""literal>:"#. Tag: programlisting#: query_hql.xml:293#, no-c-formatmsgid """<![CDATA[select max(bodyWeight) as max, min(bodyWeight) as min, count(*) as ""n\n""from Cat cat]]>"msgstr ""#. Tag: para#: query_hql.xml:295#, no-c-formatmsgid """This is most useful when used together with <literal>select new map</""literal>:"msgstr """Isto é bem mais útil quando usado junto <literal>com</""literal><literal>select new map</literal>:"#. Tag: programlisting#: query_hql.xml:299#, no-c-formatmsgid """<![CDATA[select new map( max(bodyWeight) as max, min(bodyWeight) as min, ""count(*) as n )\n""from Cat cat]]>"msgstr ""#. Tag: para#: query_hql.xml:301#, no-c-formatmsgid """This query returns a <literal>Map</literal> from aliases to selected values."msgstr """Esta query retorna um <literal>Map</literal> de referencias para valores ""selecionados."#. Tag: title#: query_hql.xml:308#, no-c-formatmsgid "Aggregate functions"msgstr "Funções de agregação"#. Tag: para#: query_hql.xml:310#, no-c-formatmsgid """HQL queries may even return the results of aggregate functions on properties:"msgstr """As queries HQL podem retornar o resultado de funções agregadas nas ""propriedades."#. Tag: programlisting#: query_hql.xml:314#, no-c-formatmsgid """<![CDATA[select avg(cat.weight), sum(cat.weight), max(cat.weight), count""(cat)\n""from Cat cat]]>"msgstr ""#. Tag: para#: query_hql.xml:325#, no-c-formatmsgid "The supported aggregate functions are"msgstr "As funções agregadas suportadas são:"#. Tag: literal#: query_hql.xml:332#, no-c-formatmsgid "avg(...), sum(...), min(...), max(...)"msgstr "avg(...), sum(...), min(...), max(...)"#. Tag: literal#: query_hql.xml:337#, no-c-formatmsgid "count(*)"msgstr "count(*)"#. Tag: literal#: query_hql.xml:342#, no-c-formatmsgid "count(...), count(distinct ...), count(all...)"msgstr "count(...), count(distinct ...), count(all...)"#. Tag: para#: query_hql.xml:347#, no-c-formatmsgid """You may use arithmetic operators, concatenation, and recognized SQL ""functions in the select clause:"msgstr """Pode-se usar operadores aritiméticos, concatenação e funções SQL ""reconhecidas na clausula select:"#. Tag: programlisting#: query_hql.xml:352#, no-c-formatmsgid """<![CDATA[select cat.weight + sum(kitten.weight)\n""from Cat cat\n"" join cat.kittens kitten\n""group by cat.id, cat.weight]]>"msgstr ""#. Tag: programlisting#: query_hql.xml:354#, no-c-formatmsgid """<![CDATA[select firstName||' '||initial||' '||upper(lastName) from Person]]>"msgstr ""#. Tag: para#: query_hql.xml:356#, no-c-formatmsgid """The <literal>distinct</literal> and <literal>all</literal> keywords may be ""used and have the same semantics as in SQL."msgstr """As palavras <literal>distinct</literal> e <literal>all</literal> podem ser ""usadas e têm a mesma semântica como no SQL."#. Tag: programlisting#: query_hql.xml:361#, no-c-formatmsgid """<![CDATA[select distinct cat.name from Cat cat\n""\n""select count(distinct cat.name), count(cat) from Cat cat]]>"msgstr ""#. Tag: title#: query_hql.xml:366#, no-c-formatmsgid "Polymorphic queries"msgstr "Queries polimórficas"#. Tag: para#: query_hql.xml:368#, no-c-formatmsgid "A query like:"msgstr "A query:"#. Tag: para#: query_hql.xml:374#, no-c-formatmsgid """returns instances not only of <literal>Cat</literal>, but also of subclasses ""like <literal>DomesticCat</literal>. Hibernate queries may name ""<emphasis>any</emphasis> Java class or interface in the <literal>from</""literal> clause. The query will return instances of all persistent classes ""that extend that class or implement the interface. The following query would ""return all persistent objects:"msgstr """retorna instancias não só de <literal>Cat</literal>, mas também de ""subclasses como <literal>DomesticCat</literal>. As queries do Hibernate ""podem nomear qualquer classe Java ou interface na clausula <literal>from</""literal>. A query retornará instancias de toda classe persistente que ""extenda a determinada classe ou implemente a determinada interface. A ""query , a seguir, pode retornar todo objeto persistente:"#. Tag: programlisting#: query_hql.xml:382#, no-c-formatmsgid "<![CDATA[from java.lang.Object o]]>"msgstr ""#. Tag: para#: query_hql.xml:384#, no-c-formatmsgid """The interface <literal>Named</literal> might be implemented by various ""persistent classes:"msgstr """A interface <literal>Named</literal> pode ser implementada por várias ""classes persistentes:"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -