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

📄 query_sql.pot

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 POT
📖 第 1 页 / 共 2 页
字号:
#: query_sql.xml:304(literal) msgid "{[aliasname].id}"msgstr ""#: query_sql.xml:306(literal) msgid "EMPID as {coll.id}"msgstr ""#: query_sql.xml:310(entry) msgid "The element of an collection"msgstr ""#: query_sql.xml:312(literal) msgid "{[aliasname].element}"msgstr ""#: query_sql.xml:314(literal) msgid "XID as {coll.element}"msgstr ""#: query_sql.xml:318(entry) msgid "roperty of the element in the collection"msgstr ""#: query_sql.xml:320(literal) msgid "{[aliasname].element.[propertyname]}"msgstr ""#: query_sql.xml:322(literal) msgid "NAME as {coll.element.name}"msgstr ""#: query_sql.xml:326(entry) msgid "All properties of the element in the collection"msgstr ""#: query_sql.xml:328(literal) msgid "{[aliasname].element.*}"msgstr ""#: query_sql.xml:330(literal) msgid "{coll.element.*}"msgstr ""#: query_sql.xml:334(entry) msgid "All properties of the the collection"msgstr ""#: query_sql.xml:338(literal) msgid "{coll.*}"msgstr ""#: query_sql.xml:347(title) msgid "Returning non-managed entities"msgstr ""#: query_sql.xml:349(para) msgid "It is possible to apply a ResultTransformer to native sql queries. Allowing it to e.g. return non-managed entities."msgstr ""#: query_sql.xml:362(para) msgid "a result transformer"msgstr ""#: query_sql.xml:366(para) msgid "The above query will return a list of <literal>CatDTO</literal> which has been instantiated and injected the values of NAME and BIRTHNAME into its corresponding properties or fields."msgstr ""#: query_sql.xml:373(title) msgid "Handling inheritance"msgstr ""#: query_sql.xml:375(para) msgid "Native sql queries which query for entities that is mapped as part of an inheritance must include all properties for the baseclass and all it subclasses."msgstr ""#: query_sql.xml:381(title) msgid "Parameters"msgstr ""#: query_sql.xml:383(para) msgid "Native sql queries support positional as well as named parameters:"msgstr ""#: query_sql.xml:398(title) msgid "Named SQL queries"msgstr ""#: query_sql.xml:400(para) msgid "Named SQL queries may be defined in the mapping document and called in exactly the same way as a named HQL query. In this case, we do <emphasis>not</emphasis> need to call <literal>addEntity()</literal>."msgstr ""#: query_sql.xml:419(para) msgid "The <literal>&lt;return-join&gt;</literal> and <literal>&lt;load-collection&gt;</literal> elements are used to join associations and define queries which initialize collections, respectively."msgstr ""#: query_sql.xml:440(para) msgid "A named SQL query may return a scalar value. You must declare the column alias and Hibernate type using the <literal>&lt;return-scalar&gt;</literal> element:"msgstr ""#: query_sql.xml:452(para) msgid "You can externalize the resultset mapping informations in a <literal>&lt;resultset&gt;</literal> element to either reuse them accross several named queries or through the <literal>setResultSetMapping()</literal> API."msgstr ""#: query_sql.xml:476(para) msgid "You can alternatively use the resultset mapping information in your hbm files directly in java code."msgstr ""#: query_sql.xml:486(title) msgid "Using return-property to explicitly specify column/alias names"msgstr ""#: query_sql.xml:489(para) msgid "With <literal>&lt;return-property&gt;</literal> you can explicitly tell Hibernate what column aliases to use, instead of using the <literal>{}</literal>-syntax to let Hibernate inject its own aliases."msgstr ""#: query_sql.xml:507(para) msgid "<literal>&lt;return-property&gt;</literal> also works with multiple columns. This solves a limitation with the <literal>{}</literal>-syntax which can not allow fine grained control of multi-column properties."msgstr ""#: query_sql.xml:528(para) msgid "Notice that in this example we used <literal>&lt;return-property&gt;</literal> in combination with the <literal>{}</literal>-syntax for injection. Allowing users to choose how they want to refer column and properties."msgstr ""#: query_sql.xml:533(para) msgid "If your mapping has a discriminator you must use <literal>&lt;return-discriminator&gt;</literal> to specify the discriminator column."msgstr ""#: query_sql.xml:539(title) msgid "Using stored procedures for querying"msgstr ""#: query_sql.xml:541(para) msgid "Hibernate 3 introduces support for queries via stored procedures and functions. Most of the following documentation is equivalent for both. The stored procedure/function must return a resultset as the first out-parameter to be able to work with Hibernate. An example of such a stored function in Oracle 9 and higher is as follows:"msgstr ""#: query_sql.xml:560(para) msgid "To use this query in Hibernate you need to map it via a named query."msgstr ""#: query_sql.xml:579(para) msgid "Notice stored procedures currently only return scalars and entities. <literal>&lt;return-join&gt;</literal> and <literal>&lt;load-collection&gt;</literal> are not supported."msgstr ""#: query_sql.xml:584(title) msgid "Rules/limitations for using stored procedures"msgstr ""#: query_sql.xml:586(para) msgid "To use stored procedures with Hibernate the procedures/functions have to follow some rules. If they do not follow those rules they are not usable with Hibernate. If you still want to use these procedures you have to execute them via <literal>session.connection()</literal>. The rules are different for each database, since database vendors have different stored procedure semantics/syntax."msgstr ""#: query_sql.xml:593(para) msgid "Stored procedure queries can't be paged with <literal>setFirstResult()/setMaxResults()</literal>."msgstr ""#: query_sql.xml:596(para) msgid "Recommended call form is standard SQL92: <literal>{ ? = call functionName(&lt;parameters&gt;) }</literal> or <literal>{ ? = call procedureName(&lt;parameters&gt;}</literal>. Native call syntax is not supported."msgstr ""#: query_sql.xml:601(para) msgid "For Oracle the following rules apply:"msgstr ""#: query_sql.xml:605(para) msgid "A function must return a result set. The first parameter of a procedure must be an <literal>OUT</literal> that returns a result set. This is done by using a <literal>SYS_REFCURSOR</literal> type in Oracle 9 or 10. In Oracle you need to define a <literal>REF CURSOR</literal> type, see Oracle literature."msgstr ""#: query_sql.xml:614(para) msgid "For Sybase or MS SQL server the following rules apply:"msgstr ""#: query_sql.xml:618(para) msgid "The procedure must return a result set. Note that since these servers can/will return multiple result sets and update counts, Hibernate will iterate the results and take the first result that is a result set as its return value. Everything else will be discarded."msgstr ""#: query_sql.xml:626(para) msgid "If you can enable <literal>SET NOCOUNT ON</literal> in your procedure it will probably be more efficient, but this is not a requirement."msgstr ""#: query_sql.xml:636(title) msgid "Custom SQL for create, update and delete"msgstr ""#: query_sql.xml:638(para) msgid "Hibernate3 can use custom SQL statements for create, update, and delete operations. The class and collection persisters in Hibernate already contain a set of configuration time generated strings (insertsql, deletesql, updatesql etc.). The mapping tags <literal>&lt;sql-insert&gt;</literal>, <literal>&lt;sql-delete&gt;</literal>, and <literal>&lt;sql-update&gt;</literal> override these strings:"msgstr ""#: query_sql.xml:656(para) msgid "The SQL is directly executed in your database, so you are free to use any dialect you like. This will of course reduce the portability of your mapping if you use database specific SQL."msgstr ""#: query_sql.xml:660(para) msgid "Stored procedures are supported if the <literal>callable</literal> attribute is set:"msgstr ""#: query_sql.xml:673(para) msgid "The order of the positional parameters are currently vital, as they must be in the same sequence as Hibernate expects them."msgstr ""#: query_sql.xml:676(para) msgid "You can see the expected order by enabling debug logging for the <literal>org.hibernate.persister.entity</literal> level. With this level enabled Hibernate will print out the static SQL that is used to create, update, delete etc. entities. (To see the expected sequence, remember to not include your custom SQL in the mapping files as that will override the Hibernate generated static sql.)"msgstr ""#: query_sql.xml:683(para) msgid "The stored procedures are in most cases (read: better do it than not) required to return the number of rows inserted/updated/deleted, as Hibernate has some runtime checks for the success of the statement. Hibernate always registers the first statement parameter as a numeric output parameter for the CUD operations:"msgstr ""#: query_sql.xml:705(title) msgid "Custom SQL for loading"msgstr ""#: query_sql.xml:707(para) msgid "You may also declare your own SQL (or HQL) queries for entity loading:"msgstr ""#: query_sql.xml:718(para) msgid "This is just a named query declaration, as discussed earlier. You may reference this named query in a class mapping:"msgstr ""#: query_sql.xml:729(para) msgid "This even works with stored procedures."msgstr ""#: query_sql.xml:731(para) msgid "You may even define a query for collection loading:"msgstr ""#: query_sql.xml:747(para) msgid "You could even define an entity loader that loads a collection by join fetching:"msgstr ""#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2.#: query_sql.xml:0(None) msgid "translator-credits"msgstr ""

⌨️ 快捷键说明

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