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

📄 query_hql.po

📁 hibernate-distribution-3.3.1.GA-dist.zip源码
💻 PO
📖 第 1 页 / 共 5 页
字号:
#. Tag: para#: query_hql.xml:748#, no-c-formatmsgid "Scalar SQL functions supported by the underlying database may be used"msgstr """ベースとなるデータベースがサポートしているスカラーSQL関数が使用できます"#. Tag: programlisting#: query_hql.xml:752#, no-c-formatmsgid "<![CDATA[from DomesticCat cat where upper(cat.name) like 'FRI%']]>"msgstr ""#. Tag: para#: query_hql.xml:754#, no-c-formatmsgid """If you are not yet convinced by all this, think how much longer and less ""readable the following query would be in SQL:"msgstr """もしまだ全てを理解していないなら、下のクエリをSQLでどれだけ長く、読みづらく出""来るか考えてください。:"#. Tag: programlisting#: query_hql.xml:759#, no-c-formatmsgid """<![CDATA[select cust\n""from Product prod,\n""    Store store\n""    inner join store.customers cust\n""where prod.name = 'widget'\n""    and store.location.name in ( 'Melbourne', 'Sydney' )\n""    and prod = all elements(cust.currentOrder.lineItems)]]>"msgstr ""#. Tag: para#: query_hql.xml:761#, no-c-formatmsgid "<emphasis>Hint:</emphasis> something like"msgstr "<emphasis>ヒント:</emphasis> 例えばこのように出来ます。"#. Tag: programlisting#: query_hql.xml:765#, no-c-formatmsgid """<![CDATA[SELECT cust.name, cust.address, cust.phone, cust.id, cust.""current_order\n""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""    )]]>"msgstr ""#. Tag: title#: query_hql.xml:770#, no-c-formatmsgid "The order by clause"msgstr "order by節"#. Tag: para#: query_hql.xml:772#, no-c-formatmsgid """The list returned by a query may be ordered by any property of a returned ""class or components:"msgstr """クエリが返すlistは、返されるクラスやコンポーネントの任意の属性によって並べ替""えられます。:"#. Tag: programlisting#: query_hql.xml:776#, no-c-formatmsgid """<![CDATA[from DomesticCat cat\n""order by cat.name asc, cat.weight desc, cat.birthdate]]>"msgstr ""#. Tag: para#: query_hql.xml:778#, no-c-formatmsgid """The optional <literal>asc</literal> or <literal>desc</literal> indicate ""ascending or descending order respectively."msgstr """オプションの <literal>asc</literal> と <literal>desc</literal> はそれぞれ昇順""か降順の整列を示します。"#. Tag: title#: query_hql.xml:785#, no-c-formatmsgid "The group by clause"msgstr "group by節"#. Tag: para#: query_hql.xml:787#, no-c-formatmsgid """A query that returns aggregate values may be grouped by any property of a ""returned class or components:"msgstr """集約値を返すクエリは、返されるクラスやコンポーネントの任意のプロパティによっ""てグループ化できます。:"#. Tag: programlisting#: query_hql.xml:791#, no-c-formatmsgid """<![CDATA[select cat.color, sum(cat.weight), count(cat)\n""from Cat cat\n""group by cat.color]]>"msgstr ""#. Tag: programlisting#: query_hql.xml:793#, no-c-formatmsgid """<![CDATA[select foo.id, avg(name), max(name)\n""from Foo foo join foo.names name\n""group by foo.id]]>"msgstr ""#. Tag: para#: query_hql.xml:795#, no-c-formatmsgid "A <literal>having</literal> clause is also allowed."msgstr "<literal>having</literal> 節も使えます。"#. Tag: programlisting#: query_hql.xml:799#, no-c-formatmsgid """<![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 ""#. Tag: para#: query_hql.xml:801#, no-c-formatmsgid """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 """もし使用するデータベースがサポートしているなら、 <literal>having</literal> ""と <literal>order by</literal> 節でSQL関数と集約関数が使えます (例えばMySQL""にはありません)。"#. Tag: programlisting#: query_hql.xml:807#, no-c-formatmsgid """<![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 ""#. Tag: para#: query_hql.xml:809#, no-c-formatmsgid """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 """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."#. Tag: title#: query_hql.xml:821#, no-c-formatmsgid "Subqueries"msgstr "副問い合わせ"#. Tag: para#: query_hql.xml:823#, no-c-formatmsgid """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 """サブセレクトをサポートするデータベースのため、Hibernateは副問い合わせをサポー""トしています。 副問い合わせは括弧で囲まなければなりません(SQLの集約関数呼び""出しによる事が多いです)。 関連副問い合わせ(外部クエリ中の別名を参照する副問""い合わせのこと)さえ許可されます。"#. Tag: programlisting#: query_hql.xml:829#, no-c-formatmsgid """<![CDATA[from Cat as fatcat\n""where fatcat.weight > (\n""    select avg(cat.weight) from DomesticCat cat\n"")]]>"msgstr ""#. Tag: programlisting#: query_hql.xml:831#, no-c-formatmsgid """<![CDATA[from DomesticCat as cat\n""where cat.name = some (\n""    select name.nickName from Name as name\n"")]]>"msgstr ""#. Tag: programlisting#: query_hql.xml:833#, no-c-formatmsgid """<![CDATA[from Cat as cat\n""where not exists (\n""    from Cat as mate where mate.mate = cat\n"")]]>"msgstr ""#. Tag: programlisting#: query_hql.xml:835#, no-c-formatmsgid """<![CDATA[from DomesticCat as cat\n""where cat.name not in (\n""    select name.nickName from Name as name\n"")]]>"msgstr ""#. Tag: programlisting#: query_hql.xml:837#, no-c-formatmsgid """<![CDATA[select cat.id, (select max(kit.weight) from cat.kitten kit)\n""from Cat as cat]]>"msgstr ""#. Tag: para#: query_hql.xml:839#, no-c-formatmsgid "Note that HQL subqueries may occur only in the select or where clauses."msgstr """HQL副問い合わせは、selectまたはwhere節だけで使われることに注意してください。"#. Tag: para#: query_hql.xml:843#, no-c-formatmsgid """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."#. Tag: title#: query_hql.xml:851#, no-c-formatmsgid "HQL examples"msgstr "HQLの例"#. Tag: para#: query_hql.xml:853#, no-c-formatmsgid """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 """Hibernateクエリは非常に強力で複雑にできます。実際、クエリ言語の威力は""Hibernateの主要なセールスポイントの一つです。 ここに最近のプロジェクトで使用""したクエリと非常によく似た例があります。 ほとんどのクエリはこれらの例より簡単""に記述できることに注意してください!"#. Tag: para#: query_hql.xml:859#, no-c-formatmsgid """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 """以下のクエリは特定の顧客と与えられた最小の合計値に対する未払い注文の注文ID、 ""商品の数、注文の合計を合計値で整列して返します。 価格を決定する際、現在のカタ""ログを使います。結果として返されるSQLクエリは <literal>ORDER</literal>, ""<literal>ORDER_LINE</literal>, <literal>PRODUCT</literal>, <literal>CATALOG</""literal> および <literal>PRICE</literal> テーブルに対し4つの内部結合と (関連""しない)副問い合わせを持ちます。"#. Tag: programlisting#: query_hql.xml:868#, no-c-formatmsgid """<![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 ""#. Tag: para#: query_hql.xml:870#, no-c-formatmsgid """What a monster! Actually, in real life, I'm not very keen on subqueries, so ""my query was really more like this:"msgstr """何て巨大なクエリなのでしょう! 普段私は副問い合わせをあまり使いません。した""がって私のクエリは実際には以下のようになります。:"#. Tag: programlisting#: query_hql.xml:875#, no-c-formatmsgid """<![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 ""#. Tag: para#: query_hql.xml:877#, no-c-formatmsgid """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 """次のクエリは各ステータスの支払い数を数えます。ただしすべての支払いが現在の利""用者による 最新のステータス変更である <literal>AWAITING_APPROVAL</literal> で""ある場合を除きます。 このクエリは2つの内部結合と <literal>PAYMENT</literal>, ""<literal>PAYMENT_STATUS</literal> および <literal>PAYMENT_STATUS_CHANGE</""literal> テーブルに対する関連副問い合わせを備えたSQLクエリに変換されます。"#. Tag: programlisting#: query_hql.xml:885#, no-c-formatmsgid """<![CDATA[select count(payment), status.name\n""from Payment as payment\n""    join payment.currentStatus as status\n""    join payment.statusChanges as stat

⌨️ 快捷键说明

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