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

📄 query_hql.po

📁 hibernate-distribution-3.3.1.GA-dist.zip源码
💻 PO
📖 第 1 页 / 共 5 页
字号:
#, no-c-formatmsgid "The where clause"msgstr "where子句"#. Tag: para#: query_hql.xml:426#, no-c-formatmsgid """The <literal>where</literal> clause allows you to narrow the list of ""instances returned. If no alias exists, you may refer to properties by name:"msgstr """<literal>where</literal>子句允许你将返回的实例列表的范围缩小. 如果没有指定别""名,你可以使用属性名来直接引用属性:"#. Tag: programlisting#: query_hql.xml:431#, no-c-formatmsgid "<![CDATA[from Cat where name='Fritz']]>"msgstr ""#. Tag: para#: query_hql.xml:433#, no-c-formatmsgid "If there is an alias, use a qualified property name:"msgstr "如果指派了别名,需要使用完整的属性名:"#. Tag: programlisting#: query_hql.xml:437#, no-c-formatmsgid "<![CDATA[from Cat as cat where cat.name='Fritz']]>"msgstr ""#. Tag: para#: query_hql.xml:439#, no-c-formatmsgid "returns instances of <literal>Cat</literal> named 'Fritz'."msgstr "返回名为(属性name等于)'Fritz'的<literal>Cat</literal>类的实例。"#. Tag: programlisting#: query_hql.xml:443#, no-c-formatmsgid """<![CDATA[select foo\n""from Foo foo, Bar bar\n""where foo.startDate = bar.date]]>"msgstr ""#. Tag: para#: query_hql.xml:445#, no-c-formatmsgid """will return all instances of <literal>Foo</literal> for which there exists ""an instance of <literal>bar</literal> with a <literal>date</literal> ""property equal to the <literal>startDate</literal> property of the ""<literal>Foo</literal>. Compound path expressions make the <literal>where</""literal> clause extremely powerful. Consider:"msgstr """将返回所有满足下面条件的<literal>Foo</literal>类的实例: 存在如下的""<literal>bar</literal>的一个实例,其<literal>date</literal>属性等于 ""<literal>Foo</literal>的<literal>startDate</literal>属性。 复合路径表达式使得""<literal>where</literal>子句非常的强大,考虑如下情况:"#. Tag: programlisting#: query_hql.xml:454#, no-c-formatmsgid "<![CDATA[from Cat cat where cat.mate.name is not null]]>"msgstr ""#. Tag: para#: query_hql.xml:456#, no-c-formatmsgid """This query translates to an SQL query with a table (inner) join. If you were ""to write something like"msgstr """该查询将被翻译成为一个含有表连接(内连接)的SQL查询。如果你打算写像这样的查询""语句"#. Tag: programlisting#: query_hql.xml:461#, no-c-formatmsgid """<![CDATA[from Foo foo\n""where foo.bar.baz.customer.address.city is not null]]>"msgstr ""#. Tag: para#: query_hql.xml:463#, no-c-formatmsgid """you would end up with a query that would require four table joins in SQL."msgstr "在SQL中,你为达此目的将需要进行一个四表连接的查询。"#. Tag: para#: query_hql.xml:467#, no-c-formatmsgid """The <literal>=</literal> operator may be used to compare not only ""properties, but also instances:"msgstr """<literal>=</literal>运算符不仅可以被用来比较属性的值,也可以用来比较实例:"#. Tag: programlisting#: query_hql.xml:472#, no-c-formatmsgid "<![CDATA[from Cat cat, Cat rival where cat.mate = rival.mate]]>"msgstr ""#. Tag: programlisting#: query_hql.xml:474#, no-c-formatmsgid """<![CDATA[select cat, mate\n""from Cat cat, Cat mate\n""where cat.mate = mate]]>"msgstr ""#. Tag: para#: query_hql.xml:476#, no-c-formatmsgid """The special property (lowercase) <literal>id</literal> may be used to ""reference the unique identifier of an object. See <xref linkend=\"queryhql-""identifier-property\"/> for more information."msgstr """特殊属性(小写)<literal>id</literal>可以用来表示一个对象的唯一的标识符。(你""也可以使用该对象的属性名。)"#. Tag: programlisting#: query_hql.xml:482#, no-c-formatmsgid """<![CDATA[from Cat as cat where cat.id = 123\n""\n""from Cat as cat where cat.mate.id = 69]]>"msgstr ""#. Tag: para#: query_hql.xml:484#, no-c-formatmsgid "The second query is efficient. No table join is required!"msgstr "第二个查询是有效的。此时不需要进行表连接!"#. Tag: para#: query_hql.xml:488#, no-c-formatmsgid """Properties of composite identifiers may also be used. Suppose ""<literal>Person</literal> has a composite identifier consisting of ""<literal>country</literal> and <literal>medicareNumber</literal>. Again, see ""<xref linkend=\"queryhql-identifier-property\"/> for more information ""regarding referencing identifier properties."msgstr """同样也可以使用复合标识符。比如<literal>Person</literal>类有一个复合标识符,它""由<literal>country</literal>属性 与<literal>medicareNumber</literal>属性组""成。"#. Tag: programlisting#: query_hql.xml:495#, no-c-formatmsgid """<![CDATA[from bank.Person person\n""where person.id.country = 'AU'\n""    and person.id.medicareNumber = 123456]]>"msgstr ""#. Tag: programlisting#: query_hql.xml:497#, no-c-formatmsgid """<![CDATA[from bank.Account account\n""where account.owner.id.country = 'AU'\n""    and account.owner.id.medicareNumber = 123456]]>"msgstr ""#. Tag: para#: query_hql.xml:499#, no-c-formatmsgid "Once again, the second query requires no table join."msgstr "第二个查询也不需要进行表连接。"#. Tag: para#: query_hql.xml:503#, no-c-formatmsgid """Likewise, the special property <literal>class</literal> accesses the ""discriminator value of an instance in the case of polymorphic persistence. A ""Java class name embedded in the where clause will be translated to its ""discriminator value."msgstr """同样的,特殊属性<literal>class</literal>在进行多态持久化的情况下被用来存取一""个实例的鉴别值(discriminator value)。 一个嵌入到where子句中的Java类的名字将""被转换为该类的鉴别值。"#. Tag: programlisting#: query_hql.xml:509#, no-c-formatmsgid "<![CDATA[from Cat cat where cat.class = DomesticCat]]>"msgstr ""#. Tag: para#: query_hql.xml:511#, fuzzy, no-c-formatmsgid """You may also use components or composite user types, or properties of said ""component types. See <xref linkend=\"queryhql-components\"/> for more ""details."msgstr """你也可以声明一个属性的类型是组件或者复合用户类型(以及由组件构成的组件等""等)。永远不要尝试使用以组件类型来结尾的路径表达式(path-expression) (与此""相反,你应当使用组件的一个属性来结尾)。 举例来说,如果<literal>store.owner</""literal>含有一个包含了组件的实体<literal>address</literal>"#. Tag: para#: query_hql.xml:516#, no-c-formatmsgid """An \"any\" type has the special properties <literal>id</literal> and ""<literal>class</literal>, allowing us to express a join in the following way ""(where <literal>AuditLog.item</literal> is a property mapped with ""<literal>&lt;any&gt;</literal>)."msgstr """一个“任意”类型有两个特殊的属性<literal>id</literal>和<literal>class</""literal>, 来允许我们按照下面的方式表达一个连接(<literal>AuditLog.item</""literal> 是一个属性,该属性被映射为<literal>&lt;any&gt;</literal>)。"#. Tag: programlisting#: query_hql.xml:522#, no-c-formatmsgid """<![CDATA[from AuditLog log, Payment payment\n""where log.item.class = 'Payment' and log.item.id = payment.id]]>"msgstr ""#. Tag: para#: query_hql.xml:524#, no-c-formatmsgid """Notice that <literal>log.item.class</literal> and <literal>payment.class</""literal> would refer to the values of completely different database columns ""in the above query."msgstr """注意,在上面的查询与句中,<literal>log.item.class</literal> 和 ""<literal>payment.class</literal> 将涉及到完全不同的数据库中的列。"#. Tag: title#: query_hql.xml:532#, no-c-formatmsgid "Expressions"msgstr "表达式"#. Tag: para#: query_hql.xml:534#, no-c-formatmsgid """Expressions allowed in the <literal>where</literal> clause include most of ""the kind of things you could write in SQL:"msgstr """在<literal>where</literal>子句中允许使用的表达式包括 大多数你可以在SQL使用的""表达式种类:"#. Tag: para#: query_hql.xml:541#, no-c-formatmsgid "mathematical operators <literal>+, -, *, /</literal>"msgstr "数学运算符<literal>+, -, *, /</literal>"#. Tag: para#: query_hql.xml:546#, no-c-formatmsgid """binary comparison operators <literal>=, &gt;=, &lt;=, &lt;&gt;, !=, like</""literal>"msgstr "二进制比较运算符<literal>=, &gt;=, &lt;=, &lt;&gt;, !=, like</literal>"#. Tag: para#: query_hql.xml:551#, no-c-formatmsgid "logical operations <literal>and, or, not</literal>"msgstr "逻辑运算符<literal>and, or, not</literal>"#. Tag: para#: query_hql.xml:556#, no-c-formatmsgid "Parentheses <literal>( )</literal>, indicating grouping"msgstr "Parentheses <literal>( )</literal>, indicating grouping"#. Tag: para#: query_hql.xml:561#, no-c-formatmsgid """<literal>in</literal>, <literal>not in</literal>, <literal>between</""literal>, <literal>is null</literal>, <literal>is not null</literal>, ""<literal>is empty</literal>, <literal>is not empty</literal>, ""<literal>member of</literal> and <literal>not member of</literal>"msgstr """<literal>in</literal>, <literal>not in</literal>, <literal>between</""literal>, <literal>is null</literal>, <literal>is not null</literal>, ""<literal>is empty</literal>, <literal>is not empty</literal>, ""<literal>member of</literal> and <literal>not member of</literal>"#. Tag: para#: query_hql.xml:574#, no-c-formatmsgid """\"Simple\" case, <literal>case ... when ... then ... else ... end</literal>, ""and \"searched\" case, <literal>case when ... then ... else ... end</literal>"msgstr """\"简单的\" case, <literal>case ... when ... then ... else ... end</literal>,""和 \"搜索\" case, <literal>case when ... then ... else ... end</literal>"#. Tag: para#: query_hql.xml:580#, no-c-formatmsgid """string concatenation <literal>...||...</literal> or <literal>concat(...,...)""</literal>"msgstr """字符串连接符<literal>...||...</literal> or <literal>concat(...,...)</literal>"#. Tag: para#: query_hql.xml:585#, no-c-formatmsgid """<literal>current_date()</literal>, <literal>current_time()</literal>, ""<literal>current_timestamp()</literal>"msgstr """<literal>current_date()</literal>, <literal>current_time()</literal>, ""<literal>current_timestamp()</literal>"#. Tag: para#: query_hql.xml:591#, no-c-formatmsgid """<literal>second(...)</literal>, <literal>minute(...)</literal>, <literal>hour""(...)</literal>, <literal>day(...)</literal>, <literal>month(...)</literal>, ""<literal>year(...)</literal>,"msgstr """<literal>second(...)</literal>, <literal>minute(...)</literal>, <literal>hour""(...)</literal>, <literal>day(...)</literal>, <literal>month(...)</literal>, ""<literal>year(...)</literal>,"#. Tag: para#: query_hql.xml:598#, no-c-formatmsgid """Any function or operator defined by EJB-QL 3.0: <literal>substring(), trim""(), lower(), upper(), length(), locate(), abs(), sqrt(), bit_length(), mod()""</literal>"msgstr """EJB-QL 3.0定义的任何函数或操作:<literal>substring(), trim(), lower(), upper""(), length(), locate(), abs(), sqrt(), bit_length(), mod()</literal>"#. Tag: para#: query_hql.xml:604#, no-c-formatmsgid "<literal>coalesce()</literal> and <literal>nullif()</literal>"msgstr "<literal>coalesce()</literal> 和 <literal>nullif()</literal>"#. Tag: para#: query_hql.xml:609#, no-c-formatmsgid """<literal>str()</literal> for converting numeric or temporal values to a ""readable string"msgstr "<literal>str()</literal> 把数字或者时间值转换为可读的字符串"#. Tag: para#: query_hql.xml:615#, no-c-formatmsgid """<literal>cast(... as ...)</literal>, where the second argument is the name ""of a Hibernate type, and <literal>extract(... from ...)</literal> if ANSI ""<literal>cast()</literal> and <literal>extract()</literal> is supported by ""the underlying database"msgstr """<literal>cast(... as ...)</literal>, 其第二个参数是某Hibernate类型的名字,以""及<literal>extract(... from ...)</literal>,只要ANSI <literal>cast()</""literal> 和 <literal>extract()</literal> 被底层数据库支持"#. Tag: para#: query_hql.xml:623#, no-c-formatmsgid """the HQL <literal>index()</literal> function, that applies to aliases of a ""joined indexed collection"msgstr "HQL <literal>index()</literal> 函数,作用于join的有序集合的别名。"#. Tag: para#: query_hql.xml:629#, no-c-formatmsgid """HQL functions that take collection-valued path expressions: <literal>size(), ""minelement(), maxelement(), minindex(), maxindex()</literal>, along with the ""special <literal>elements()</literal> and <literal>indices</literal> ""functions which may be quantified using <literal>some, all, exists, any, in</""literal>."msgstr """HQL函数,把集合作为参数:<literal>size(), minelement(), maxelement(), minindex""(), maxindex()</literal>,还有特别的<literal>elements()</literal> 和""<literal>indices</literal>函数,可以与数量词加以限定:<literal>some, all, ""exists, any, in</literal>。"#. Tag: para#: query_hql.xml:637#, no-c-formatmsgid ""

⌨️ 快捷键说明

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