📄 query_hql.po
字号:
msgid ""msgstr """Project-Id-Version: PACKAGE VERSION\n""Report-Msgid-Bugs-To: http://bugs.kde.org\n""POT-Creation-Date: 2007-10-25 07:47+0000\n""PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n""Last-Translator: FULL NAME <EMAIL@ADDRESS>\n""Language-Team: LANGUAGE <LL@li.org>\n""MIME-Version: 1.0\n""Content-Type: text/plain; charset=UTF-8\n""Content-Transfer-Encoding: 8bit\n"#. Tag: title#: query_hql.xml:5#, no-c-formatmsgid "HQL: The Hibernate Query Language"msgstr "HQL: A linguagem de Queries do Hibernate"#. Tag: para#: query_hql.xml:7#, no-c-formatmsgid """Hibernate is equipped with an extremely powerful query language that (quite ""intentionally) looks very much like SQL. But don't be fooled by the syntax; ""HQL is fully object-oriented, understanding notions like inheritence, ""polymorphism and association."msgstr """O Hibernate vem com uma poderosa linguagem que é (intencionalmente) muito ""parecida com o SQL. Mas não seja enganado pela sintaxe; a HQL é totalmente ""orientada à objetos, requer conhecimentos de herança, polimorfismo e ""associações."#. Tag: title#: query_hql.xml:14#, no-c-formatmsgid "Case Sensitivity"msgstr "Case Sensitíve"#. Tag: para#: query_hql.xml:16#, no-c-formatmsgid """Queries are case-insensitive, except for names of Java classes and ""properties. So <literal>SeLeCT</literal> is the same as <literal>sELEct</""literal> is the same as <literal>SELECT</literal> but <literal>org.hibernate.""eg.FOO</literal> is not <literal>org.hibernate.eg.Foo</literal> and ""<literal>foo.barSet</literal> is not <literal>foo.BARSET</literal>."msgstr """As Queries não são case-sensitive, exceto pelo nomes das classes e ""propriedades Java. <literal>sELEct</literal> e o mesmo que <literal>SELECT</""literal> mas <literal>org.hibernate.eg.FOO</literal> não é <literal>org.""hibernate.eg.Foo</literal> e <literal>foo.barSet</literal> não é ""<literal>foo.BARSET</literal>."#. Tag: para#: query_hql.xml:27#, no-c-formatmsgid """This manual uses lowercase HQL keywords. Some users find queries with ""uppercase keywords more readable, but we find this convention ugly when ""embedded in Java code."msgstr """Esse manual usa as palavras chave HQL em letras minúsculas. Alguns usuários ""acham que com letras maiúsculas as queries ficam mais legíveis, mas nós ""achamos essa convenção feia dentro do código Java."#. Tag: title#: query_hql.xml:35#, no-c-formatmsgid "The from clause"msgstr "A clausula from"#. Tag: para#: query_hql.xml:37#, no-c-formatmsgid "The simplest possible Hibernate query is of the form:"msgstr "A mais simples query possível do Hibernate é a assim:"#. Tag: programlisting#: query_hql.xml:41#, no-c-formatmsgid "<![CDATA[from eg.Cat]]>"msgstr ""#. Tag: para#: query_hql.xml:43#, no-c-formatmsgid """which simply returns all instances of the class <literal>eg.Cat</literal>. ""We don't usually need to qualify the class name, since <literal>auto-import</""literal> is the default. So we almost always just write:"msgstr """Ela irá retornar todas as instancias da classe <literal>eg.Cat</literal>. ""Necessariamente não precisamos qualificar o nome da classe, pois é realizado ""<literal>auto-import</literal> por padrão. Por isso na maior parte do tempos ""nós simplesmente escrevemos:"#. Tag: programlisting#: query_hql.xml:49#, no-c-formatmsgid "<![CDATA[from Cat]]>"msgstr ""#. Tag: para#: query_hql.xml:51#, no-c-formatmsgid """Most of the time, you will need to assign an <emphasis>alias</emphasis>, ""since you will want to refer to the <literal>Cat</literal> in other parts of ""the query."msgstr """Na maior parte do tempo, você precisará atribuir um <emphasis>alias</""emphasis>, desde que você queira se referia ao <literal>Cat</literal> em ""outras partes da query."#. Tag: programlisting#: query_hql.xml:57 query_hql.xml:372#, no-c-formatmsgid "<![CDATA[from Cat as cat]]>"msgstr ""#. Tag: para#: query_hql.xml:59#, no-c-formatmsgid """This query assigns the alias <literal>cat</literal> to <literal>Cat</""literal> instances, so we could use that alias later in the query. The ""<literal>as</literal> keyword is optional; we could also write:"msgstr """Essa query atribui um alias a <literal>cat</literal> para as instancias de ""<literal>Cat</literal>, então nós podemos usar esse alias depois na query. A ""palavra chave as é opcional; poderíamos escrever assim:"#. Tag: programlisting#: query_hql.xml:65#, no-c-formatmsgid "<![CDATA[from Cat cat]]>"msgstr ""#. Tag: para#: query_hql.xml:67#, no-c-formatmsgid """Multiple classes may appear, resulting in a cartesian product or \"cross\" ""join."msgstr """Múltiplas classes pode ser envolvidas, resultando em um produto cartesiano ""ou \"cross\" join."#. Tag: programlisting#: query_hql.xml:71#, no-c-formatmsgid "<![CDATA[from Formula, Parameter]]>"msgstr ""#. Tag: programlisting#: query_hql.xml:72#, no-c-formatmsgid "<![CDATA[from Formula as form, Parameter as param]]>"msgstr ""#. Tag: para#: query_hql.xml:74#, no-c-formatmsgid """It is considered good practice to name query aliases using an initial ""lowercase, consistent with Java naming standards for local variables (eg. ""<literal>domesticCat</literal>)."msgstr """É considerada uma boa prática os nomes dos aliases começarem com letra ""minúscula, aderente com os padrões Java para variáveis locais (ex: ""<literal>domesticCat</literal>)."#. Tag: title#: query_hql.xml:83#, no-c-formatmsgid "Associations and joins"msgstr "Associações e joins"#. Tag: para#: query_hql.xml:85#, no-c-formatmsgid """We may also assign aliases to associated entities, or even to elements of a ""collection of values, using a <literal>join</literal>."msgstr """Nós também podemos querer atribuir aliases em uma entidade associada, ou ""mesmo em elementos de uma coleção de valores, usando um <literal>join</""literal>."#. Tag: programlisting#: query_hql.xml:90#, no-c-formatmsgid """<![CDATA[from Cat as cat\n"" inner join cat.mate as mate\n"" left outer join cat.kittens as kitten]]>"msgstr ""#. Tag: programlisting#: query_hql.xml:92#, no-c-formatmsgid "<![CDATA[from Cat as cat left join cat.mate.kittens as kittens]]>"msgstr ""#. Tag: programlisting#: query_hql.xml:94#, no-c-formatmsgid "<![CDATA[from Formula form full join form.parameter param]]>"msgstr ""#. Tag: para#: query_hql.xml:96#, no-c-formatmsgid "The supported join types are borrowed from ANSI SQL"msgstr "Os tipos de joins suportados foram inspirados no SQL ANSI:"#. Tag: literal#: query_hql.xml:103#, no-c-formatmsgid "inner join"msgstr "inner join"#. Tag: literal#: query_hql.xml:108#, no-c-formatmsgid "left outer join"msgstr "left outer join"#. Tag: literal#: query_hql.xml:113#, no-c-formatmsgid "right outer join"msgstr "right outer join"#. Tag: para#: query_hql.xml:117#, no-c-formatmsgid "<literal>full join</literal> (not usually useful)"msgstr "<literal>full join</literal> (geralmente não é útil)"#. Tag: para#: query_hql.xml:123#, no-c-formatmsgid """The <literal>inner join</literal>, <literal>left outer join</literal> and ""<literal>right outer join</literal> constructs may be abbreviated."msgstr """The <literal>inner join</literal>, <literal>left outer join</literal> and ""<literal>right outer join</literal> constructs may be abbreviated. As ""construções <literal>inner join</literal>, <literal>left outer join</""literal> e <literal>right outer join</literal> podem ser abreviadas."#. Tag: programlisting#: query_hql.xml:128#, no-c-formatmsgid """<![CDATA[from Cat as cat\n"" join cat.mate as mate\n"" left join cat.kittens as kitten]]>"msgstr ""#. Tag: para#: query_hql.xml:130#, no-c-formatmsgid """You may supply extra join conditions using the HQL <literal>with</literal> ""keyword."msgstr """Você pode fornecer condições extras de join usando a palavra chave do HQL ""<literal>with</literal>."#. Tag: programlisting#: query_hql.xml:135#, no-c-formatmsgid """<![CDATA[from Cat as cat\n"" left join cat.kittens as kitten\n"" with kitten.bodyWeight > 10.0]]>"msgstr ""#. Tag: para#: query_hql.xml:137#, no-c-formatmsgid """In addition, a \"fetch\" join allows associations or collections of values ""to be initialized along with their parent objects, using a single select. ""This is particularly useful in the case of a collection. It effectively ""overrides the outer join and lazy declarations of the mapping file for ""associations and collections. See <xref linkend=\"performance-fetching\"/> ""for more information."msgstr """Adicionalmente, um \"fetch\" join permite que associações ou coleções de ""valores sejam inicializadas junto com o objeto pai, usando apenas um select. ""Isso é muito útil no caso das coleções. Isso efetivamente sobre escreve as ""declarações outer join e lazy do arquivo mapeamento para associações e ""coleções. Veja a seção <xref linkend=\"performance-fetching\"/> para mais ""informações."#. Tag: programlisting#: query_hql.xml:145#, no-c-formatmsgid """<![CDATA[from Cat as cat\n"" inner join fetch cat.mate\n"" left join fetch cat.kittens]]>"msgstr ""#. Tag: para#: query_hql.xml:147#, no-c-formatmsgid """A fetch join does not usually need to assign an alias, because the ""associated objects should not be used in the <literal>where</literal> clause ""(or any other clause). Also, the associated objects are not returned ""directly in the query results. Instead, they may be accessed via the parent ""object. The only reason we might need an alias is if we are recursively join ""fetching a further collection:"msgstr """Usualmente, um <literal>fetch</literal>join não precisa atribuir um alias, ""pois o objeto associado não deve ser usado na clausula <literal>where</""literal> (ou em qualquer outra clausula). Também, os objetos associados não ""são retornados diretamente nos resultados da query. Ao invés disso, eles ""devem ser acessados usando o objeto pai. A única razão que nós podemos ""necessitar de um alias é quando fazemos um fech join recursivamente em uma ""coleção adicional:"#. Tag: programlisting#: query_hql.xml:155#, no-c-formatmsgid """<![CDATA[from Cat as cat\n"" inner join fetch cat.mate\n"" left join fetch cat.kittens child\n"" left join fetch child.kittens]]>"msgstr ""#. Tag: para#: query_hql.xml:157#, no-c-formatmsgid """Note that the <literal>fetch</literal> construct may not be used in queries ""called using <literal>iterate()</literal> (though <literal>scroll()</""literal> can be used). Nor should <literal>fetch</literal> be used together ""with <literal>setMaxResults()</literal> or <literal>setFirstResult()</""literal> as these operations are based on the result rows, which usually ""contain duplicates for eager collection fetching, hence, the number of rows ""is not what you'd expect. Nor may <literal>fetch</literal> be used together ""with an ad hoc <literal>with</literal> condition. It is possible to create a ""cartesian product by join fetching more than one collection in a query, so ""take care in this case. Join fetching multiple collection roles also ""sometimes gives unexpected results for bag mappings, so be careful about how ""you formulate your queries in this case. Finally, note that <literal>full ""join fetch</literal> and <literal>right join fetch</literal> are not ""meaningful."msgstr """Observe que a construção <literal>fetch</literal> não deve ser usada em ""queries invocadas usando <literal>iterate()</literal> (embora possa ser ""usado com <literal>scroll()</literal>). O <literal>fetch</literal> também ""não deve ser usado junto com o <literal>setMaxResults()</literal> ou ""<literal>setFirstResult()</literal> pois essas operações são baseadas nas ""linhas retornadas, que normalmente contem duplicidade devido ao fetching das ""coleções, então o número de linhas pode não ser o que você espera. O ""<literal>fetch</literal> não deve ser usado junto com uma condição ""<literal>with</literal> em uma condição <literal>with</literal> ad hoc. É ""possível que seja criado um produto cartesiano pelo join fetching em mais do ""que uma coleção em uma query, então tome cuidado nesses casos. Um join ""fetching em varias coleções pode trazer resultados inesperados para ""mapeamentos do tipo bag, tome cuidado na hora de formular queries como ""essas. Finalmente, observe o seguinte, o <literal>full join fetch</literal> ""e <literal>right join fetch</literal> não são significativos."#. Tag: para#: query_hql.xml:172#, no-c-formatmsgid """If you are using property-level lazy fetching (with bytecode ""instrumentation), it is possible to force Hibernate to fetch the lazy ""properties immediately (in the first query) using <literal>fetch all ""properties</literal>."msgstr """Se está usando o nível de propriedade lazy (<literal>com</literal> ""instrumentação de bytecode), é possível forçar o Hibernate a ""<literal>buscar</literal> as propriedades lazy imediatamente (na primeira ""query), usando <literal>fetch all properties </literal>."#. Tag: programlisting#: query_hql.xml:178#, no-c-formatmsgid "<![CDATA[from Document fetch all properties order by name]]>"msgstr ""#. Tag: programlisting#: query_hql.xml:179#, no-c-formatmsgid """<![CDATA[from Document doc fetch all properties where lower(doc.name) like '%""cats%']]>"msgstr ""#. Tag: title#: query_hql.xml:184#, no-c-formatmsgid "Forms of join syntax"msgstr "Formas e sintaxe de joins"#. Tag: para#: query_hql.xml:186#, no-c-formatmsgid """HQL supports two forms of association joining: <literal>implicit</literal> ""and <literal>explicit</literal>."msgstr """O HQL suporta duas formas de associação para união: <literal>implícita</""literal> e <literal>explicita</literal>."
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -