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

📄 session_api.po

📁 hibernate-distribution-3.3.1.GA-dist.zip源码
💻 PO
📖 第 1 页 / 共 5 页
字号:
#. Tag: para#: session_api.xml:651#, no-c-formatmsgid """the application persists these modifications by calling <literal>update()</""literal> in a second session"msgstr "程序调用第二个session的<literal>update()</literal>方法持久这些改动"#. Tag: para#: session_api.xml:658#, no-c-formatmsgid "<literal>saveOrUpdate()</literal> does the following:"msgstr "<literal>saveOrUpdate()</literal>做下面的事:"#. Tag: para#: session_api.xml:664#, no-c-formatmsgid "if the object is already persistent in this session, do nothing"msgstr "如果对象已经在本session中持久化了,不做任何事"#. Tag: para#: session_api.xml:669#, no-c-formatmsgid """if another object associated with the session has the same identifier, throw ""an exception"msgstr """如果另一个与本session关联的对象拥有相同的持久化标识(identifier),抛出一个异常"#. Tag: para#: session_api.xml:675#, no-c-formatmsgid "if the object has no identifier property, <literal>save()</literal> it"msgstr """如果对象没有持久化标识(identifier)属性,对其调用<literal>save()</literal>"#. Tag: para#: session_api.xml:680#, no-c-formatmsgid """if the object's identifier has the value assigned to a newly instantiated ""object, <literal>save()</literal> it"msgstr """如果对象的持久标识(identifier)表明其是一个新实例化的对象,对其调用""<literal>save()</literal>"#. Tag: para#: session_api.xml:686#, no-c-formatmsgid """if the object is versioned (by a <literal>&lt;version&gt;</literal> or ""<literal>&lt;timestamp&gt;</literal>), and the version property value is the ""same value assigned to a newly instantiated object, <literal>save()</""literal> it"msgstr """如果对象是附带版本信息的(通过<literal>&lt;version&gt;</literal>或""<literal>&lt;timestamp&gt;</literal>) 并且版本属性的值表明其是一个新实例化的""对象,<literal>save()</literal>它。"#. Tag: para#: session_api.xml:694#, no-c-formatmsgid "otherwise <literal>update()</literal> the object"msgstr "否则<literal>update()</literal> 这个对象"#. Tag: para#: session_api.xml:700#, no-c-formatmsgid "and <literal>merge()</literal> is very different:"msgstr "<literal>merge()</literal>可非常不同:"#. Tag: para#: session_api.xml:706#, 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 """如果session中存在相同持久化标识(identifier)的实例,用用户给出的对象的状态覆盖""旧有的持久实例"#. Tag: para#: session_api.xml:713#, 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 """如果session没有相应的持久实例,则尝试从数据库中加载,或创建新的持久化实例"#. Tag: para#: session_api.xml:719#, no-c-formatmsgid "the persistent instance is returned"msgstr "最后返回该持久实例"#. Tag: para#: session_api.xml:724#, no-c-formatmsgid """the given instance does not become associated with the session, it remains ""detached"msgstr "用户给出的这个对象没有被关联到session上,它依旧是脱管的"#. Tag: title#: session_api.xml:734#, no-c-formatmsgid "Deleting persistent objects"msgstr "删除持久对象"#. Tag: para#: session_api.xml:736#, 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>会把对象的状态从数据库中移除。 当然,""你的应用程序可能仍然持有一个指向已删除对象的引用。所以,最好这样理解:""<literal>delete()</literal>的用途是把一个持久实例变成瞬时(transient)实例。"#. Tag: programlisting#: session_api.xml:743#, no-c-formatmsgid "<![CDATA[sess.delete(cat);]]>"msgstr ""#. Tag: para#: session_api.xml:745#, 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 """你可以用你喜欢的任何顺序删除对象,不用担心外键约束冲突。当然,如果你搞错了顺""序,还是有可能引发在外键字段定义的<literal>NOT NULL</literal>约束冲突。 例如""你删除了父对象,但是忘记删除孩子们。"#. Tag: title#: session_api.xml:756#, no-c-formatmsgid "Replicating object between two different datastores"msgstr "在两个不同数据库间复制对象"#. Tag: para#: session_api.xml:758#, 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 """偶尔会用到不重新生成持久化标识(identifier),将持久实例以及其关联的实例持久到""不同的数据库中的操作。"#. Tag: programlisting#: session_api.xml:764#, 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:766#, no-c-formatmsgid """The <literal>ReplicationMode</literal> determines how <literal>replicate()</""literal> will deal with conflicts with existing rows in the database."msgstr """<literal>ReplicationMode</literal>决定在和数据库中已存在记录由冲突时,""<literal>replicate()</literal>如何处理。"#. Tag: para#: session_api.xml:773#, 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> - 忽略它"#. Tag: para#: session_api.xml:779#, no-c-formatmsgid """<literal>ReplicationMode.OVERWRITE</literal> - overwrite any existing ""database row with the same identifier"msgstr "<literal>ReplicationMode.OVERWRITE</literal> - 覆盖相同的行"#. Tag: para#: session_api.xml:785#, 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> - 抛出异常"#. Tag: para#: session_api.xml:791#, 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> - 如果当前的版本较新,则覆""盖,否则忽略"#. Tag: para#: session_api.xml:799#, 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 """这个功能的用途包括使录入的数据在不同数据库中一致,产品升级时升级系统配置信""息,回滚non-ACID事务中的修改等等。 (译注,non-ACID,非ACID;ACID,Atomic,""Consistent,Isolated and Durable的缩写)"#. Tag: title#: session_api.xml:808#, no-c-formatmsgid "Flushing the Session"msgstr "Session刷出(flush)"#. Tag: para#: session_api.xml:810#, 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 """每间隔一段时间,<literal>Session</literal>会执行一些必需的SQL语句来把内存中的""对象的状态同步到JDBC连接中。这个过程被称为<emphasis>刷出(flush)</emphasis>,""默认会在下面的时间点执行:"#. Tag: para#: session_api.xml:819#, no-c-formatmsgid "before some query executions"msgstr "在某些查询执行之前"#. Tag: para#: session_api.xml:824#, no-c-formatmsgid "from <literal>org.hibernate.Transaction.commit()</literal>"msgstr "在调用<literal>org.hibernate.Transaction.commit()</literal>的时候"#. Tag: para#: session_api.xml:829#, no-c-formatmsgid "from <literal>Session.flush()</literal>"msgstr "在调用<literal>Session.flush()</literal>的时候"#. Tag: para#: session_api.xml:835#, no-c-formatmsgid "The SQL statements are issued in the following order"msgstr "涉及的SQL语句会按照下面的顺序发出执行:"#. Tag: para#: session_api.xml:841#, no-c-formatmsgid """all entity insertions, in the same order the corresponding objects were ""saved using <literal>Session.save()</literal>"msgstr """所有对实体进行插入的语句,其顺序按照对象执行<literal>Session.save()</literal>""的时间顺序"#. Tag: para#: session_api.xml:847#, no-c-formatmsgid "all entity updates"msgstr "所有对实体进行更新的语句"#. Tag: para#: session_api.xml:852#, no-c-formatmsgid "all collection deletions"msgstr "所有进行集合删除的语句"#. Tag: para#: session_api.xml:857#, no-c-formatmsgid "all collection element deletions, updates and insertions"msgstr "所有对集合元素进行删除,更新或者插入的语句"#. Tag: para#: session_api.xml:862#, no-c-formatmsgid "all collection insertions"msgstr "所有进行集合插入的语句"#. Tag: para#: session_api.xml:867#, no-c-formatmsgid """all entity deletions, in the same order the corresponding objects were ""deleted using <literal>Session.delete()</literal>"msgstr """所有对实体进行删除的语句,其顺序按照对象执行<literal>Session.delete()</""literal>的时间顺序"#. Tag: para#: session_api.xml:874#, no-c-formatmsgid """(An exception is that objects using <literal>native</literal> ID generation ""are inserted when they are saved.)"msgstr """(有一个例外是,如果对象使用<literal>native</literal>方式来生成ID(持久化标""识)的话,它们一执行save就会被插入。)"#. Tag: para#: session_api.xml:879#, no-c-formatmsgid """Except when you explicity <literal>flush()</literal>, there are absolutely ""no guarantees about <emphasis>when</emphasis> the <literal>Session</literal> ""executes the JDBC calls, only the <emphasis>order</emphasis> in which they ""are executed. However, Hibernate does guarantee that the <literal>Query.list

⌨️ 快捷键说明

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