📄 session_api.po
字号:
msgstr """識別子<literal>catId</literal> を持つ <literal>Cat</literal> が、既に ""<literal>secondSession</literal> でロードされていた場合は、再追加しようとした""ときに、例外が投げられます。"#. Tag: para#: session_api.xml:544#, no-c-formatmsgid """Use <literal>update()</literal> if you are sure that the session does not ""contain an already persistent instance with the same identifier, and ""<literal>merge()</literal> if you want to merge your modifications at any ""time without consideration of the state of the session. In other words, ""<literal>update()</literal> is usually the first method you would call in a ""fresh session, ensuring that reattachment of your detached instances is the ""first operation that is executed."msgstr """同じ識別子を持つ永続インスタンスをセッションが既に保持していないことを 確信で""きるなら <literal>update()</literal> を使いましょう。 そして、セッションの状""態を考えずに、どんな場合でも変更をマージしたい場合は、 <literal>merge()</""literal> を使いましょう。 すなわち、分離オブジェクトの再追加操作が、最初に実""行されることを確実にするために、 通常は <literal>update()</literal> が新しい""セッションのなかで最初に呼ばれるメソッドになります。"#. Tag: para#: session_api.xml:553#, no-c-formatmsgid """The application should individually <literal>update()</literal> detached ""instances reachable from the given detached instance if and <emphasis>only</""emphasis> if it wants their state also updated. This can be automated of ""course, using <emphasis>transitive persistence</emphasis>, see <xref linkend=""\"objectstate-transitive\"/>."msgstr """分離インスタンスから到達可能な、分離インスタンスをアプリケーションは個別に ""<literal>update()</literal> すべきです。それは、その状態を更新したい場合に ""<emphasis>限り</emphasis> ます。 <emphasis>遷移的な永続化</emphasis> を使え""ば、もちろん自動化できます。 <xref linkend=\"objectstate-transitive\"/> を参""照してください。"#. Tag: para#: session_api.xml:560#, no-c-formatmsgid """The <literal>lock()</literal> method also allows an application to ""reassociate an object with a new session. However, the detached instance has ""to be unmodified!"msgstr """メソッドでもまた、新しいセッションにオブジェクトを再関連付けできます。 しか""し、分離インスタンスは無修正でなければなりません。"#. Tag: programlisting#: session_api.xml:565#, no-c-formatmsgid """<![CDATA[//just reassociate:\n""sess.lock(fritz, LockMode.NONE);\n""//do a version check, then reassociate:\n""sess.lock(izi, LockMode.READ);\n""//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n""sess.lock(pk, LockMode.UPGRADE);]]>"msgstr ""#. Tag: para#: session_api.xml:567#, no-c-formatmsgid """Note that <literal>lock()</literal> can be used with various ""<literal>LockMode</literal>s, see the API documentation and the chapter on ""transaction handling for more information. Reattachment is not the only ""usecase for <literal>lock()</literal>."msgstr """<literal>lock()</literal> は、さまざまな <literal>LockMode</literal> とともに""使うことができます。 詳細は、APIドキュメントとトランザクション処理の章を参照""してください。 再追加のときにだけ、 <literal>lock()</literal> が使われるわけ""ではありません。"#. Tag: para#: session_api.xml:574#, no-c-formatmsgid """Other models for long units of work are discussed in <xref linkend=""\"transactions-optimistic\"/>."msgstr """期間の長い作業単位の、その他のモデルは、<xref linked=\"transactions-""optimistic\"/> で述べています。"#. Tag: title#: session_api.xml:581#, no-c-formatmsgid "Automatic state detection"msgstr "自動的な状態検出"#. Tag: para#: session_api.xml:583#, no-c-formatmsgid """Hibernate users have requested a general purpose method that either saves a ""transient instance by generating a new identifier or updates/reattaches the ""detached instances associated with its current identifier. The ""<literal>saveOrUpdate()</literal> method implements this functionality."msgstr """Hibernateのユーザは次の2つのケースのどちらにも使える汎用的なメソッドを要求し""ていました。 それは、新しい識別子を生成して一時的なインスタンスをセーブするこ""とと、 その時点の識別子と関連づいている分離インスタンスを更新/再追加すること""のできるメソッドです。 <literal>saveOrUpdate()</literal> はこのような機能を実""現したメソッドです。"#. Tag: programlisting#: session_api.xml:590#, no-c-formatmsgid """<![CDATA[// in the first session\n""Cat cat = (Cat) firstSession.load(Cat.class, catID);\n""\n""// in a higher tier of the application\n""Cat mate = new Cat();\n""cat.setMate(mate);\n""\n""// later, in a new session\n""secondSession.saveOrUpdate(cat); // update existing state (cat has a non-""null id)\n""secondSession.saveOrUpdate(mate); // save the new instance (mate has a null ""id)]]>"msgstr ""#. Tag: para#: session_api.xml:592#, no-c-formatmsgid """The usage and semantics of <literal>saveOrUpdate()</literal> seems to be ""confusing for new users. Firstly, so long as you are not trying to use ""instances from one session in another new session, you should not need to ""use <literal>update()</literal>, <literal>saveOrUpdate()</literal>, or ""<literal>merge()</literal>. Some whole applications will never use either of ""these methods."msgstr """<literal>saveOrUpdate()</literal> の使用方法と意味は、 新しいユーザにとって混""乱を招くかもしれません。 まず第一に、あるセッションで使用したインスタンスを別""の新しいセッションで使おうとしない限り、 <literal>update()</literal> や ""<literal>saveOrUpdate()</literal> や <literal>merge()</literal> を使う必要は""ありません。 アプリケーション全体を通じて、これらのメソッドを全く使わないこと""もあります。"#. Tag: para#: session_api.xml:600#, no-c-formatmsgid """Usually <literal>update()</literal> or <literal>saveOrUpdate()</literal> are ""used in the following scenario:"msgstr """通常、 <literal>update()</literal> や <literal>saveOrUpdate()</literal> は次""のシナリオで 使われます。"#. Tag: para#: session_api.xml:607#, no-c-formatmsgid "the application loads an object in the first session"msgstr "アプリケーションが最初のセッションでオブジェクトをロードします。"#. Tag: para#: session_api.xml:612#, no-c-formatmsgid "the object is passed up to the UI tier"msgstr "オブジェクトがUI層に送られます。"#. Tag: para#: session_api.xml:617#, no-c-formatmsgid "some modifications are made to the object"msgstr "オブジェクトに対して変更が加えられます。"#. Tag: para#: session_api.xml:622#, no-c-formatmsgid "the object is passed back down to the business logic tier"msgstr "オブジェクトがビジネスロジック層に送られます。"#. Tag: para#: session_api.xml:627#, no-c-formatmsgid """the application persists these modifications by calling <literal>update()</""literal> in a second session"msgstr """アプリケーションは、2番目のセッションで <literal>update()</literal> を呼ぶこ""とで、これらの変更を永続化します。"#. Tag: para#: session_api.xml:634#, no-c-formatmsgid "<literal>saveOrUpdate()</literal> does the following:"msgstr "<literal>saveOrUpdate()</literal> は以下のことを行います。"#. Tag: para#: session_api.xml:640#, no-c-formatmsgid "if the object is already persistent in this session, do nothing"msgstr """オブジェクトがこのセッションで、すでに永続化されていれば、何もしません。"#. Tag: para#: session_api.xml:645#, no-c-formatmsgid """if another object associated with the session has the same identifier, throw ""an exception"msgstr """そのセッションに関連づいている別のオブジェクトが同じ識別子を持っているなら、 ""例外を投げます。"#. Tag: para#: session_api.xml:651#, no-c-formatmsgid "if the object has no identifier property, <literal>save()</literal> it"msgstr """オブジェクトの識別子が値を持たないならば、 <literal>save()</literal> します。"#. Tag: para#: session_api.xml:656#, no-c-formatmsgid """if the object's identifier has the value assigned to a newly instantiated ""object, <literal>save()</literal> it"msgstr """オブジェクトの識別子が値を持ち、その値が新たにインスタンス化されたオブジェク""トのための値である場合、 そのオブジェクトを <literal>save()</literal> しま""す。"#. Tag: para#: session_api.xml:662#, no-c-formatmsgid """if the object is versioned (by a <literal><version></literal> or ""<literal><timestamp></literal>), and the version property value is the ""same value assigned to a newly instantiated object, <literal>save()</""literal> it"msgstr """オブジェクトが( <literal><version></literal> や <literal><""timestamp></literal> によって) バージョンづけされていて、バージョンのプロ""パティが値を持ち、 その値が新しくインスタンス化されたオブジェクトのための値で""ある場合、 そのオブジェクトを <literal>save()</literal> します。"#. Tag: para#: session_api.xml:670#, no-c-formatmsgid "otherwise <literal>update()</literal> the object"msgstr """そうでない場合は、そのオブジェクトを <literal>update()</literal> します。"#. Tag: para#: session_api.xml:676#, no-c-formatmsgid "and <literal>merge()</literal> is very different:"msgstr "そして、 <literal>merge()</literal> は以下のようにとても異なります。"#. Tag: para#: session_api.xml:682#, no-c-formatmsgid """if there is a persistent instance with the same identifier currently ""associated with the session, copy the state of the given object onto the ""persistent instance"msgstr """同じ識別子を持つ永続化インスタンスがその時点でセッションと関連付いているなら""ば、 引数で受け取ったオブジェクトの状態を永続化インスタンスにコピーします。"#. Tag: para#: session_api.xml:689#, no-c-formatmsgid """if there is no persistent instance currently associated with the session, ""try to load it from the database, or create a new persistent instance"msgstr """永続化インスタンスがその時点でセッションに関連付いていないなら、 データベース""からそれをロードするか、あるいは、新しい永続化インスタンスを作成します。"#. Tag: para#: session_api.xml:695#, no-c-formatmsgid "the persistent instance is returned"msgstr "永続化インスタンスが返されます。"#. Tag: para#: session_api.xml:700#, no-c-formatmsgid """the given instance does not become associated with the session, it remains ""detached"msgstr """引数として与えたインスタンスはセッションと関連を持ちません。 それは、分離状態""のままです。"#. Tag: title#: session_api.xml:710#, no-c-formatmsgid "Deleting persistent objects"msgstr "永続オブジェクトの削除"#. Tag: para#: session_api.xml:712#, no-c-formatmsgid """<literal>Session.delete()</literal> will remove an object's state from the ""database. Of course, your application might still hold a reference to a ""deleted object. It's best to think of <literal>delete()</literal> as making ""a persistent instance transient."msgstr ""
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -