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

📄 session_api.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 5 页
字号:
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#: session_api.xml:5#, no-c-formatmsgid "Working with objects"msgstr "オブジェクトを扱う"#. Tag: para#: session_api.xml:7#, no-c-formatmsgid """Hibernate is a full object/relational mapping solution that not only shields ""the developer from the details of the underlying database management system, ""but also offers <emphasis>state management</emphasis> of objects. This is, ""contrary to the management of SQL <literal>statements</literal> in common ""JDBC/SQL persistence layers, a very natural object-oriented view of ""persistence in Java applications."msgstr """Hibernate は完全なオブジェクト/リレーショナルマッピングソリューションであ""り、 データベース管理システムの詳細を開発者から隠蔽するだけでなく、 オブジェ""クトの <emphasis>状態管理</emphasis> も行います。 これは、JDBC/SQL永続層と同""じようなSQL <literal>文</literal> の管理とは異なり、 Javaアプリケーションにお""ける永続化に対する、とても自然なオブジェクト指向の考え方を提供します。"#. Tag: para#: session_api.xml:16#, no-c-formatmsgid """In other words, Hibernate application developers should always think about ""the <emphasis>state</emphasis> of their objects, and not necessarily about ""the execution of SQL statements. This part is taken care of by Hibernate and ""is only relevant for the application developer when tuning the performance ""of the system."msgstr """言いかえれば、Hibernateを用いるアプリケーション開発者は、オブジェクトの ""<emphasis>状態</emphasis> については 常に意識すべきであり、SQL文の実行につい""ては必ずしもそうではありません。 この部分は、通常、Hibernateが処理し、システ""ムのパフォーマンスをチューニングするときにだけ、 問題になってきます。"#. Tag: title#: session_api.xml:24#, no-c-formatmsgid "Hibernate object states"msgstr "Hibernateにおけるオブジェクトの状態"#. Tag: para#: session_api.xml:26#, no-c-formatmsgid "Hibernate defines and supports the following object states:"msgstr "Hibernateは次のようなオブジェクトの状態を定義し、サポートしています。"#. Tag: para#: session_api.xml:32#, no-c-formatmsgid """<emphasis>Transient</emphasis> - an object is transient if it has just been ""instantiated using the <literal>new</literal> operator, and it is not ""associated with a Hibernate <literal>Session</literal>. It has no persistent ""representation in the database and no identifier value has been assigned. ""Transient instances will be destroyed by the garbage collector if the ""application doesn't hold a reference anymore. Use the Hibernate ""<literal>Session</literal> to make an object persistent (and let Hibernate ""take care of the SQL statements that need to be executed for this ""transition)."msgstr """<emphasis> 一時的(Transient) </emphasis> - <literal>new</literal> 演算子を""使って インスタンス化されただけで、 Hibernateの <literal>Session</literal> に""関連付けられていないオブジェクトは、 一時的(transient)です。 それは、データ""ベースに永続的な表現を持たず、識別子となる値は割り当てられていません。 一時的""なインスタンスは、アプリケーションがその参照をどこにも保持しない場合に、 ガ""ベージコレクタによって破棄されます。 オブジェクトを永続的(persistent)な状態に""するためには、Hibernateの <literal>Session</literal> を使いましょう。 (この""状態遷移に必要となるSQL文の発行は、Hibernateに任せましょう。)"#. Tag: para#: session_api.xml:44#, no-c-formatmsgid """<emphasis>Persistent</emphasis> - a persistent instance has a representation ""in the database and an identifier value. It might just have been saved or ""loaded, however, it is by definition in the scope of a <literal>Session</""literal>. Hibernate will detect any changes made to an object in persistent ""state and synchronize the state with the database when the unit of work ""completes. Developers don't execute manual <literal>UPDATE</literal> ""statements, or <literal>DELETE</literal> statements when an object should be ""made transient."msgstr """<emphasis>永続的(Persistent)</emphasis> - 永続的なインスタンスはデータベース""に 永続的な表現を持ち、識別子となる値を持っています。 それは、セーブされた""り、ロードされたりするかもしれませんが、 定義上は、 <literal>Session</""literal> のスコープの中に存在しています。 Hibernateは、作業単位(Unit of ""work)が完了したときに、 永続状態のオブジェクトに加えられた変更を検出し、 オ""ブジェクトの状態とデータベースを同期します。 オブジェクトを一時的(transient)""にするときは、開発者は、手作業で <literal>UPDATE</literal> 文や ""<literal>DELETE</literal> 文を実行しません。"#. Tag: para#: session_api.xml:55#, no-c-formatmsgid """<emphasis>Detached</emphasis> - a detached instance is an object that has ""been persistent, but its <literal>Session</literal> has been closed. The ""reference to the object is still valid, of course, and the detached instance ""might even be modified in this state. A detached instance can be reattached ""to a new <literal>Session</literal> at a later point in time, making it (and ""all the modifications) persistent again. This feature enables a programming ""model for long running units of work that require user think-time. We call ""them <emphasis>application transactions</emphasis>, i.e. a unit of work from ""the point of view of the user."msgstr """<emphasis>分離(Detached)</emphasis> - 分離されたインスタンスとは、永続化され""ているが、 それと関連付いていた <literal>Session</literal> がクローズされてい""るオブジェクトのことです。 そのオブジェクトへの参照は、依然として有効です。 ""そして、もちろん、分離された状態にあるオブジェクトは、修正することさえできま""す。 分離されたインスタンスは、もう一度永続化したい(そして、すべての変更を永""続化したい)ときに、 新しい <literal>Session</literal> に再追加できます。 こ""の機能は、ユーザが考える時間を必要とするような、長期間に及ぶ作業単位に対する ""プログラミングモデルを可能にします。 我々は、これを <emphasis>アプリケーショ""ンのトランザクション(application transactions)</emphasis> と呼んでいます。 ""すなわち、ユーザから見た作業単位だということです。"#. Tag: para#: session_api.xml:69#, no-c-formatmsgid """We'll now discuss the states and state transitions (and the Hibernate ""methods that trigger a transition) in more detail."msgstr """これから、状態と状態遷移(そして、遷移のきっかけとなるHibernateのメソッド)に""ついて 、詳細に述べます。"#. Tag: title#: session_api.xml:77#, no-c-formatmsgid "Making objects persistent"msgstr "オブジェクトを永続状態にする"#. Tag: para#: session_api.xml:79#, no-c-formatmsgid """Newly instantiated instances of a a persistent class are considered ""<emphasis>transient</emphasis> by Hibernate. We can make a transient ""instance <emphasis>persistent</emphasis> by associating it with a session:"msgstr """新しくインスタンス化された永続クラスのインスタンスは、 Hibernateでは ""<emphasis>一時的(transient)</emphasis> と見なされます。 以下のように、セッ""ションと関連づけることで、一時的なインスタンスを <emphasis>永続状態""(persistent)</emphasis> にできます。"#. Tag: programlisting#: session_api.xml:86#, no-c-formatmsgid """<![CDATA[DomesticCat fritz = new DomesticCat();\n""fritz.setColor(Color.GINGER);\n""fritz.setSex('M');\n""fritz.setName(\"Fritz\");\n""Long generatedId = (Long) sess.save(fritz);]]>"msgstr ""#. Tag: para#: session_api.xml:88#, no-c-formatmsgid """If <literal>Cat</literal> has a generated identifier, the identifier is ""generated and assigned to the <literal>cat</literal> when <literal>save()</""literal> is called. If <literal>Cat</literal> has an <literal>assigned</""literal> identifier, or a composite key, the identifier should be assigned ""to the <literal>cat</literal> instance before calling <literal>save()</""literal>. You may also use <literal>persist()</literal> instead of ""<literal>save()</literal>, with the semantics defined in the EJB3 early ""draft."msgstr """<literal>Cat</literal> クラスの識別子が自動生成されるのであれば、 ""<literal>save()</literal> が呼ばれるときに、 識別子が生成され、 ""<literal>cat</literal> インスタンスに割り当てられます。 <literal>Cat</""literal> の識別子が他から割り当てられる( <literal>assigned</literal> 識別子""を持つ)か、複合キーであるなら、 <literal>save()</literal> を呼び出す前に、識""別子を割り当てなければなりません。 <literal>save()</literal> の代わりに、""EJB3 の初期ドラフトで定義された <literal>persist()</literal> を使うことも可能""です。"#. Tag: para#: session_api.xml:100#, no-c-formatmsgid """<literal>persist()</literal> makes a transient instance persistent. However, ""it doesn't guarantee that the identifier value will be assigned to the ""persistent instance immediately, the assignment might happen at flush time. ""<literal>persist()</literal> also guarantees that it will not execute an ""<literal>INSERT</literal> statement if it is called outside of transaction ""boundaries. This is useful in long-running conversations with an extended ""Session/persistence context."msgstr """<literal>persist()</literal> makes a transient instance persistent. However, ""it doesn't guarantee that the identifier value will be assigned to the ""persistent instance immediately, the assignment might happen at flush time. ""<literal>persist()</literal> also guarantees that it will not execute an ""<literal>INSERT</literal> statement if it is called outside of transaction ""boundaries. This is useful in long-running conversations with an extended ""Session/persistence context."#. Tag: para#: session_api.xml:111#, no-c-formatmsgid """<literal>save()</literal> does guarantee to return an identifier. If an ""INSERT has to be executed to get the identifier ( e.g. \"identity\" ""generator, not \"sequence\"), this INSERT happens immediately, no matter if ""you are inside or outside of a transaction. This is problematic in a long-""running conversation with an extended Session/persistence context."msgstr """<literal>save()</literal> does guarantee to return an identifier. If an ""INSERT has to be executed to get the identifier ( e.g. \"identity\" ""generator, not \"sequence\"), this INSERT happens immediately, no matter if ""you are inside or outside of a transaction. This is problematic in a long-""running conversation with an extended Session/persistence context."#. Tag: para#: session_api.xml:121#, no-c-formatmsgid """Alternatively, you may assign the identifier using an overloaded version of ""<literal>save()</literal>."msgstr """代わりに、識別子を引数にとる <literal>save()</literal> メソッドを使って、 識""別子を割り当てることもできます。"#. Tag: programlisting#: session_api.xml:126#, no-c-formatmsgid """<![CDATA[DomesticCat pk = new DomesticCat();\n""pk.setColor(Color.TABBY);\n""pk.setSex('F');\n""pk.setName(\"PK\");\n""pk.setKittens( new HashSet() );\n""pk.addKitten(fritz);\n""sess.save( pk, new Long(1234) );]]>"msgstr ""#. Tag: para#: session_api.xml:128#, no-c-formatmsgid """If the object you make persistent has associated objects (e.g. the ""<literal>kittens</literal> collection in the previous example), these ""objects may be made persistent in any order you like unless you have a ""<literal>NOT NULL</literal> constraint upon a foreign key column. There is ""never a risk of violating foreign key constraints. However, you might ""violate a <literal>NOT NULL</literal> constraint if you <literal>save()</""literal> the objects in the wrong order."msgstr """永続化するオブジェクトが関連オブジェクトを持っている場合 (例えば、前の例にお""ける <literal>kittens</literal> コレクションのように)、 外部キーカラムに、 ""<literal>NOT NULL</literal> 制約をつけない限りは、 これらの一連のオブジェクト""をどんな順番で永続化してもかまいません。 外部キー制約を違反する恐れはありませ""ん。 しかし、 <literal>NOT NULL</literal> 制約がある場合、間違った順番でオブ""ジェクトを <literal>save()</literal> してしまうと、 制約に違反するかもしれま""せん。"#. Tag: para#: session_api.xml:138#, no-c-formatmsgid """Usually you don't bother with this detail, as you'll very likely use ""Hibernate's <emphasis>transitive persistence</emphasis> feature to save the ""associated objects automatically. Then, even <literal>NOT NULL</literal> ""constraint violations don't occur - Hibernate will take care of everything. ""Transitive persistence is discussed later in this chapter."msgstr """関連するオブジェクトを自動的に保存する、 Hibernateの <emphasis>遷移的な永続化""(transitive persistence)</emphasis> 機能を 使うつもりならば、そのような詳細を""気にする必要はありません。 そして、 <literal>NOT NULL</literal> 制約の違反す""ら起こりません。 Hibernateがすべて面倒をみてくれます。遷移的な永続化は、この""章の後半に書かれています。"#. Tag: title#: session_api.xml:149#, no-c-formatmsgid "Loading an object"msgstr "オブジェクトのロード"#. Tag: para#: session_api.xml:151#, no-c-formatmsgid """The <literal>load()</literal> methods of <literal>Session</literal> gives ""you a way to retrieve a persistent instance if you already know its ""identifier. <literal>load()</literal> takes a class object and will load the ""state into a newly instantiated instance of that class, in persistent state."msgstr """永続化されたインスタンスの識別子があらかじめ分かっているなら、 ""<literal>Session</literal> の <literal>load()</literal> メソッドを使って、復""元できます。 <literal>load()</literal> は、Class オブジェクトを引数にとり、 ""そのクラスのインスタンスを新たに生成し、状態をロードします。 そのインスタンス""の状態は、永続(persistent)状態です。"#. Tag: programlisting#: session_api.xml:158

⌨️ 快捷键说明

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