⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 query_hql.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 5 页
字号:
"FROM customers cust,\n""    stores store,\n""    locations loc,\n""    store_customers sc,\n""    product prod\n""WHERE prod.name = 'widget'\n""    AND store.loc_id = loc.id\n""    AND loc.name IN ( 'Melbourne', 'Sydney' )\n""    AND sc.store_id = store.id\n""    AND sc.cust_id = cust.id\n""    AND prod.id = ALL(\n""        SELECT item.prod_id\n""        FROM line_items item, orders o\n""        WHERE item.order_id = o.id\n""            AND cust.current_order = o.id\n""    )]]>"#: index.docbook:770msgid "The order by clause"msgstr "La cl&#x00e1;usula order by"#: index.docbook:772msgid """The list returned by a query may be ordered by any property of a returned ""class or components:"msgstr """La lista devuelta por una consulta puede ser ordenada por cualquier ""propiedad de una clase devuelta o componentes:"#: index.docbook:776msgid """<![CDATA[from DomesticCat cat\n""order by cat.name asc, cat.weight desc, cat.birthdate]]>"msgstr """<![CDATA[from DomesticCat cat\n""order by cat.name asc, cat.weight desc, cat.birthdate]]>"#: index.docbook:778msgid """The optional <literal>asc</literal> or <literal>desc</literal> indicate ""ascending or descending order respectively."msgstr """Los <literal>asc</literal> o <literal>desc</literal> opcionales indican ""ordenamiento ascendente o descendente respectivamente."#: index.docbook:785msgid "The group by clause"msgstr "La cl&#x00e1;usula group by"#: index.docbook:787msgid """A query that returns aggregate values may be grouped by any property of a ""returned class or components:"msgstr """Una consulta que devuelve valores agregados puede ser agrupada por cualquier ""propiedad de una clase devuelta o componentes:"#: index.docbook:791msgid """<![CDATA[select cat.color, sum(cat.weight), count(cat)\n""from Cat cat\n""group by cat.color]]>"msgstr """<![CDATA[select cat.color, sum(cat.weight), count(cat) \n""from Cat cat\n""group by cat.color]]>"#: index.docbook:793msgid """<![CDATA[select foo.id, avg(name), max(name)\n""from Foo foo join foo.names name\n""group by foo.id]]>"msgstr """<![CDATA[select foo.id, avg(name), max(name) \n""from Foo foo join foo.names name\n""group by foo.id]]>"#: index.docbook:795msgid "A <literal>having</literal> clause is also allowed."msgstr """Se permite tambi&#x00e9;n una cl&#x00e1;usula <literal>having</literal>."#: index.docbook:799msgid """<![CDATA[select cat.color, sum(cat.weight), count(cat)\n""from Cat cat\n""group by cat.color\n""having cat.color in (eg.Color.TABBY, eg.Color.BLACK)]]>"msgstr """<![CDATA[select cat.color, sum(cat.weight), count(cat) \n""from Cat cat\n""group by cat.color \n""having cat.color in (eg.Color.TABBY, eg.Color.BLACK)]]>"#: index.docbook:801msgid """SQL functions and aggregate functions are allowed in the <literal>having</""literal> and <literal>order by</literal> clauses, if supported by the ""underlying database (eg. not in MySQL)."msgstr """Las funciones y funciones de agregaci&#x00f3;n SQL est&#x00e1;n permitidas ""en las cl&#x00e1;usulas <literal>having</literal> y <literal>order by</""literal>, si est&#x00e1;n soportadas por la base de datos subyacente (por ""ejemplo, no en MySQL)."#: index.docbook:807msgid """<![CDATA[select cat\n""from Cat cat\n""    join cat.kittens kitten\n""group by cat.id, cat.name, cat.other, cat.properties\n""having avg(kitten.weight) > 100\n""order by count(kitten) asc, sum(kitten.weight) desc]]>"msgstr """<![CDATA[select cat\n""from Cat cat\n""    join cat.kittens kitten\n""group by cat\n""having avg(kitten.weight) > 100\n""order by count(kitten) asc, sum(kitten.weight) desc]]>"#: index.docbook:809msgid """Note that neither the <literal>group by</literal> clause nor the ""<literal>order by</literal> clause may contain arithmetic expressions. Also ""note that Hibernate currently does not expand a grouped entity, so you can't ""write <literal>group by cat</literal> if all properties of <literal>cat</""literal> are non-aggregated. You have to list all non-aggregated properties ""explicitly."msgstr """Nota que ni la cl&#x00e1;usula <literal>group by</literal> ni la cl&#x00e1;""usula <literal>order by</literal> pueden contener expresiones aritm&#x00e9;""ticas."#: index.docbook:821msgid "Subqueries"msgstr "Subconsultas"#: index.docbook:823msgid """For databases that support subselects, Hibernate supports subqueries within ""queries. A subquery must be surrounded by parentheses (often by an SQL ""aggregate function call). Even correlated subqueries (subqueries that refer ""to an alias in the outer query) are allowed."msgstr """Para bases de datos que soportan subconsultas, Hibernate soporta ""subconsultas dentro de consultas. Una subconsulta debe ser encerrada entre ""par&#x00e9;ntesis (frecuentemente por una llamada a una funci&#x00f3;n de ""agregaci&#x00f3;n SQL). Incluso se permiten subconsultas correlacionadas ""(subconsultas que hacen referencia a un alias en la consulta exterior)."#: index.docbook:829msgid """<![CDATA[from Cat as fatcat\n""where fatcat.weight > (\n""    select avg(cat.weight) from DomesticCat cat\n"")]]>"msgstr """<![CDATA[from Cat as fatcat\n""                                      where fatcat.weight > (\n""                select avg(cat.weight) from DomesticCat cat\n""                )]]>"#: index.docbook:831msgid """<![CDATA[from DomesticCat as cat\n""where cat.name = some (\n""    select name.nickName from Name as name\n"")]]>"msgstr """<![CDATA[from DomesticCat as cat\n""                                      where cat.name = some (\n""                                      select name.nickName from Name as ""name\n""                                      )]]>"#: index.docbook:833msgid """<![CDATA[from Cat as cat\n""where not exists (\n""    from Cat as mate where mate.mate = cat\n"")]]>"msgstr """<![CDATA[from Cat as cat\n""                                      where not exists (\n""                                      from Cat as mate where mate.mate = ""cat\n""                                      )]]>"#: index.docbook:835msgid """<![CDATA[from DomesticCat as cat\n""where cat.name not in (\n""    select name.nickName from Name as name\n"")]]>"msgstr """<![CDATA[from DomesticCat as cat\n""                                      where cat.name not in (\n""                                      select name.nickName from Name as ""name\n""                                      )]]>"#: index.docbook:837msgid """<![CDATA[select cat.id, (select max(kit.weight) from cat.kitten kit)\n""from Cat as cat]]>"msgstr """<![CDATA[select cat.id, (select max(kit.weight) from cat.kitten kit)\n""                                        from Cat as cat]]>"#: index.docbook:839msgid "Note that HQL subqueries may occur only in the select or where clauses."msgstr """Note that HQL subqueries may occur only in the select or where clauses."#: index.docbook:843msgid """Note that subqueries can also utilize <literal>row value constructor</""literal> syntax. See <xref linkend=\"queryhql-tuple\"/> for more details."msgstr """Note that subqueries can also utilize <literal>row value constructor</""literal> syntax. See <xref linkend=\"queryhql-tuple\"/> for more details."#: index.docbook:851msgid "HQL examples"msgstr "Ejemplos de HQL"#: index.docbook:853msgid """Hibernate queries can be quite powerful and complex. In fact, the power of ""the query language is one of Hibernate's main selling points. Here are some ""example queries very similar to queries that I used on a recent project. ""Note that most queries you will write are much simpler than these!"msgstr """Las consultas de Hibernate pueden ser abolutamente potentes y complejas, De ""hecho, el poder del lenguaje de consulta es uno de los puntos principales de ""venta de Hibernate. He aqu&#x00ed; algunos consultas de ejemplo muy ""similares a consultas que he usado en un proyecto reciente. &#x00a1;Nota que ""la mayor&#x00ed;a de las consultas que escribir&#x00e1;s som mucho m&#x00e1;""s simples que estas!"#: index.docbook:859msgid """The following query returns the order id, number of items and total value of ""the order for all unpaid orders for a particular customer and given minimum ""total value, ordering the results by total value. In determining the prices, ""it uses the current catalog. The resulting SQL query, against the ""<literal>ORDER</literal>, <literal>ORDER_LINE</literal>, <literal>PRODUCT</""literal>, <literal>CATALOG</literal> and <literal>PRICE</literal> tables has ""four inner joins and an (uncorrelated) subselect."msgstr """La siguiente consulta devuelve el order id, n&#x00fa;mero de items y valor ""total de la orden para todas las ordenes inpagas de un cliente en particular ""y valor total m&#x00ed;nimo dados, ordenando los resultados por valor total. ""Al determinar los precios, usa el cat&#x00e1;logo actual. La consulta SQL ""resultante, contra las tablas <literal>ORDER</literal>, <literal>ORDER_LINE</""literal>, <literal>PRODUCT</literal>, <literal>CATALOG</literal> and ""<literal>PRICE</literal> tiene cuatro joins interiores y una subselect (no ""correlacionada)."#: index.docbook:868msgid """<![CDATA[select order.id, sum(price.amount), count(item)\n""from Order as order\n""    join order.lineItems as item\n""    join item.product as product,\n""    Catalog as catalog\n""    join catalog.prices as price\n""where order.paid = false\n""    and order.customer = :customer\n""    and price.product = product\n""    and catalog.effectiveDate < sysdate\n""    and catalog.effectiveDate >= all (\n""        select cat.effectiveDate\n""        from Catalog as cat\n""        where cat.effectiveDate < sysdate\n""    )\n""group by order\n""having sum(price.amount) > :minAmount\n""order by sum(price.amount) desc]]>"msgstr """<![CDATA[select order.id, sum(price.amount), count(item)\n""from Order as order\n""    join order.lineItems as item\n""    join item.product as product,\n""    Catalog as catalog\n""    join catalog.prices as price\n""where order.paid = false\n""    and order.customer = :customer\n""    and price.product = product\n""    and catalog.effectiveDate < sysdate\n""    and catalog.effectiveDate >= all (\n""        select cat.effectiveDate \n""        from Catalog as cat\n""        where cat.effectiveDate < sysdate\n""    )\n""group by order\n""having sum(price.amount) > :minAmount\n""order by sum(price.amount) desc]]>"#: index.docbook:870msgid """What a monster! Actually, in real life, I'm not very keen on subqueries, so ""my query was really more like this:"msgstr """&#x00a1;Qu&#x00e9; monstruo! Realmente, en la vida real, no estoy muy ""afilado en subconsultas, de modo que mi consulta fue realmente algo como ""esto:"#: index.docbook:875msgid """<![CDATA[select order.id, sum(price.amount), count(item)\n""from Order as order\n""    join order.lineItems as item\n""    join item.product as product,\n""    Catalog as catalog\n""    join catalog.prices as price\n""where order.paid = false\n""    and order.customer = :customer\n""    and price.product = product\n""    and catalog = :currentCatalog\n""group by order\n""having sum(price.amount) > :minAmount\n""order by sum(price.amount) desc]]>"msgstr """<![CDATA[select order.id, sum(price.amount), count(item)\n""from Order as order\n""    join order.lineItems as item\n""    join item.product as product,\n""    Catalog as catalog\n""    join catalog.prices as price\n""where order.paid = false\n""    and order.customer = :customer\n""    and price.product = product\n""    and catalog = :currentCatalog\n""group by order\n""having sum(price.amount) > :minAmount\n""order by sum(price.amount) desc]]>"#: index.docbook:877msgid """The next query counts the number of payments in each status, excluding all ""payments in the <literal>AWAITING_APPROVAL</literal> status where the most ""recent status change was made by the current user. It translates to an SQL ""query with two inner joins and a correlated subselect against the ""<literal>PAYMENT</literal>, <literal>PAYMENT_STATUS</literal> and ""<literal>PAYMENT_STATUS_CHANGE</literal> tables."msgstr """La pr&#x00f3;xima consulta cuenta el n&#x00fa;mero de pagos en cada estado, ""excluyendo todos los pagos en el estado <literal>AWAITING_APPROVAL</literal> ""donde el estado m&#x00e1;s reciente fue hecho por el usuario actual. Se ""traduce en una consulta SQL con dos joins interiores y una subselect ""correlacionada contra las tablas <literal>PAYMENT</literal>, ""<literal>PAYMENT_STATUS

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -