📄 session_api.po
字号:
#. Tag: para#: session_api.xml:607#, no-c-formatmsgid "the application loads an object in the first session"msgstr "the application loads an object in the first session"#. Tag: para#: session_api.xml:612#, no-c-formatmsgid "the object is passed up to the UI tier"msgstr "the object is passed up to the UI tier"#. Tag: para#: session_api.xml:617#, no-c-formatmsgid "some modifications are made to the object"msgstr "some modifications are made to the object"#. Tag: para#: session_api.xml:622#, no-c-formatmsgid "the object is passed back down to the business logic tier"msgstr "the object is passed back down to the business logic tier"#. Tag: para#: session_api.xml:627#, no-c-formatmsgid """the application persists these modifications by calling <literal>update()</""literal> in a second session"msgstr """the application persists these modifications by calling <literal>update()</""literal> in a second session"#. Tag: para#: session_api.xml:634#, no-c-formatmsgid "<literal>saveOrUpdate()</literal> does the following:"msgstr "<literal>saveOrUpdate()</literal> does the following:"#. Tag: para#: session_api.xml:640#, no-c-formatmsgid "if the object is already persistent in this session, do nothing"msgstr "if the object is already persistent in this session, do nothing"#. Tag: para#: session_api.xml:645#, no-c-formatmsgid """if another object associated with the session has the same identifier, throw ""an exception"msgstr """if another object associated with the session has the same identifier, throw ""an exception"#. Tag: para#: session_api.xml:651#, no-c-formatmsgid "if the object has no identifier property, <literal>save()</literal> it"msgstr "if the object has no identifier property, <literal>save()</literal> it"#. 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 """if the object's identifier has the value assigned to a newly instantiated ""object, <literal>save()</literal> it"#. 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 """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"#. Tag: para#: session_api.xml:670#, no-c-formatmsgid "otherwise <literal>update()</literal> the object"msgstr "otherwise <literal>update()</literal> the object"#. Tag: para#: session_api.xml:676#, no-c-formatmsgid "and <literal>merge()</literal> is very different:"msgstr "and <literal>merge()</literal> is very different:"#. 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 """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"#. 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 """if there is no persistent instance currently associated with the session, ""try to load it from the database, or create a new persistent instance"#. Tag: para#: session_api.xml:695#, no-c-formatmsgid "the persistent instance is returned"msgstr "the persistent instance is returned"#. Tag: para#: session_api.xml:700#, no-c-formatmsgid """the given instance does not become associated with the session, it remains ""detached"msgstr """the given instance does not become associated with the session, it remains ""detached"#. Tag: title#: session_api.xml:710#, no-c-formatmsgid "Deleting persistent objects"msgstr "Deleting persistent objects"#. 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 """<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."#. Tag: programlisting#: session_api.xml:719#, no-c-formatmsgid "<![CDATA[sess.delete(cat);]]>"msgstr ""#. Tag: para#: session_api.xml:721#, no-c-formatmsgid """You may delete objects in any order you like, without risk of foreign key ""constraint violations. It is still possible to violate a <literal>NOT NULL</""literal> constraint on a foreign key column by deleting objects in the wrong ""order, e.g. if you delete the parent, but forget to delete the children."msgstr """You may delete objects in any order you like, without risk of foreign key ""constraint violations. It is still possible to violate a <literal>NOT NULL</""literal> constraint on a foreign key column by deleting objects in the wrong ""order, e.g. if you delete the parent, but forget to delete the children."#. Tag: title#: session_api.xml:732#, no-c-formatmsgid "Replicating object between two different datastores"msgstr "Replicating object between two different datastores"#. Tag: para#: session_api.xml:734#, no-c-formatmsgid """It is occasionally useful to be able to take a graph of persistent instances ""and make them persistent in a different datastore, without regenerating ""identifier values."msgstr """It is occasionally useful to be able to take a graph of persistent instances ""and make them persistent in a different datastore, without regenerating ""identifier values."#. Tag: programlisting#: session_api.xml:740#, no-c-formatmsgid """<![CDATA[//retrieve a cat from one database\n""Session session1 = factory1.openSession();\n""Transaction tx1 = session1.beginTransaction();\n""Cat cat = session1.get(Cat.class, catId);\n""tx1.commit();\n""session1.close();\n""\n""//reconcile with a second database\n""Session session2 = factory2.openSession();\n""Transaction tx2 = session2.beginTransaction();\n""session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n""tx2.commit();\n""session2.close();]]>"msgstr ""#. Tag: para#: session_api.xml:742#, no-c-formatmsgid """The <literal>ReplicationMode</literal> determines how <literal>replicate()</""literal> will deal with conflicts with existing rows in the database."msgstr """The <literal>ReplicationMode</literal> determines how <literal>replicate()</""literal> will deal with conflicts with existing rows in the database."#. Tag: para#: session_api.xml:749#, no-c-formatmsgid """<literal>ReplicationMode.IGNORE</literal> - ignore the object when there is ""an existing database row with the same identifier"msgstr """<literal>ReplicationMode.IGNORE</literal> - ignore the object when there is ""an existing database row with the same identifier"#. Tag: para#: session_api.xml:755#, no-c-formatmsgid """<literal>ReplicationMode.OVERWRITE</literal> - overwrite any existing ""database row with the same identifier"msgstr """<literal>ReplicationMode.OVERWRITE</literal> - overwrite any existing ""database row with the same identifier"#. Tag: para#: session_api.xml:761#, no-c-formatmsgid """<literal>ReplicationMode.EXCEPTION</literal> - throw an exception if there ""is an existing database row with the same identifier"msgstr """<literal>ReplicationMode.EXCEPTION</literal> - throw an exception if there ""is an existing database row with the same identifier"#. Tag: para#: session_api.xml:767#, no-c-formatmsgid """<literal>ReplicationMode.LATEST_VERSION</literal> - overwrite the row if its ""version number is earlier than the version number of the object, or ignore ""the object otherwise"msgstr """<literal>ReplicationMode.LATEST_VERSION</literal> - overwrite the row if its ""version number is earlier than the version number of the object, or ignore ""the object otherwise"#. Tag: para#: session_api.xml:775#, no-c-formatmsgid """Usecases for this feature include reconciling data entered into different ""database instances, upgrading system configuration information during ""product upgrades, rolling back changes made during non-ACID transactions and ""more."msgstr """Usecases for this feature include reconciling data entered into different ""database instances, upgrading system configuration information during ""product upgrades, rolling back changes made during non-ACID transactions and ""more."#. Tag: title#: session_api.xml:784#, no-c-formatmsgid "Flushing the Session"msgstr "Flushing the Session"#. Tag: para#: session_api.xml:786#, no-c-formatmsgid """From time to time the <literal>Session</literal> will execute the SQL ""statements needed to synchronize the JDBC connection's state with the state ""of objects held in memory. This process, <emphasis>flush</emphasis>, occurs ""by default at the following points"msgstr """From time to time the <literal>Session</literal> will execute the SQL ""statements needed to synchronize the JDBC connection's state with the state ""of objects held in memory. This process, <emphasis>flush</emphasis>, occurs ""by default at the following points"#. Tag: para#: session_api.xml:795#, no-c-formatmsgid "before some query executions"msgstr "before some query executions"#. Tag: para#: session_api.xml:800#, no-c-formatmsgid "from <literal>org.hibernate.Transaction.commit()</literal>"msgstr "from <literal>org.hibernate.Transaction.commit()</literal>"#. Tag: para#: session_api.xml:805#, no-c-formatmsgid "from <literal>Session.flush()</literal>"msgstr "from <literal>Session.flush()</literal>"#. Tag: para#: session_api.xml:811#, no-c-formatmsgid "The SQL statements are issued in the following order"msgstr "The SQL statements are issued in the following order"#. Tag: para#: session_api.xml:817#, no-c-formatmsgid """all entity insertions, in the same order the corresponding objects were ""saved using <literal>Session.save()</literal>"msgstr """all entity insertions, in the same order the corresponding objects were ""saved using <literal>Session.save()</literal>"#. Tag: para#: session_api.xml:823#, no-c-formatmsgid "all entity updates"msgstr "all entity updates"#. Tag: para#: session_api.xml:828#, no-c-formatmsgid "all collection deletions"msgstr "all collection deletions"#. Tag: para#: session_api.xml:833#, no-c-formatmsgid "all collection element deletions, updates and insertions"msgstr "all collection element deletions, updates and insertions"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -