Hibernate SVN: r19120 - search/trunk/hibernate-search/src/main/java/org/hibernate/search/engine.
by hibernate-commits@lists.jboss.org
Author: sannegrinovero
Date: 2010-03-28 10:33:37 -0400 (Sun, 28 Mar 2010)
New Revision: 19120
Modified:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/engine/FilterDef.java
Log:
HSEARCH-475 Improve error message on wrong type as filter parameter
Modified: search/trunk/hibernate-search/src/main/java/org/hibernate/search/engine/FilterDef.java
===================================================================
--- search/trunk/hibernate-search/src/main/java/org/hibernate/search/engine/FilterDef.java 2010-03-28 14:31:38 UTC (rev 19119)
+++ search/trunk/hibernate-search/src/main/java/org/hibernate/search/engine/FilterDef.java 2010-03-28 14:33:37 UTC (rev 19120)
@@ -98,5 +98,9 @@
catch (InvocationTargetException e) {
throw new SearchException( "Unable to set Filter parameter: " + parameterName + " on filter class: " + this.impl, e );
}
+ catch (IllegalArgumentException e) {
+ throw new SearchException( "Unable to set Filter parameter: " + parameterName + " on filter class: "
+ + this.impl + " : " + e.getMessage(), e );
+ }
}
}
14 years, 8 months
Hibernate SVN: r19119 - search/trunk/hibernate-search/src/test/java/org/hibernate/search/test.
by hibernate-commits@lists.jboss.org
Author: sannegrinovero
Date: 2010-03-28 10:31:38 -0400 (Sun, 28 Mar 2010)
New Revision: 19119
Modified:
search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/SearchTestCase.java
Log:
Make test instances of analyzer "static final"
Modified: search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/SearchTestCase.java
===================================================================
--- search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/SearchTestCase.java 2010-03-26 23:01:38 UTC (rev 19118)
+++ search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/SearchTestCase.java 2010-03-28 14:31:38 UTC (rev 19119)
@@ -62,10 +62,10 @@
private static final Logger log = org.hibernate.search.util.LoggerFactory.make();
- public static Analyzer standardAnalyzer = new StandardAnalyzer( getTargetLuceneVersion() );
- public static Analyzer stopAnalyzer = new StopAnalyzer( getTargetLuceneVersion() );
- public static Analyzer simpleAnalyzer = new SimpleAnalyzer();
- public static Analyzer keywordAnalyzer = new KeywordAnalyzer();
+ public static final Analyzer standardAnalyzer = new StandardAnalyzer( getTargetLuceneVersion() );
+ public static final Analyzer stopAnalyzer = new StopAnalyzer( getTargetLuceneVersion() );
+ public static final Analyzer simpleAnalyzer = new SimpleAnalyzer();
+ public static final Analyzer keywordAnalyzer = new KeywordAnalyzer();
private static File indexDir;
14 years, 8 months
Hibernate SVN: r19118 - in core/branches/Branch_3_3: testsuite/src/test/java/org/hibernate/test/interceptor and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-03-26 19:01:38 -0400 (Fri, 26 Mar 2010)
New Revision: 19118
Added:
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interceptor/InstantiateInterceptor.java
Modified:
core/branches/Branch_3_3/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interceptor/InterceptorTest.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interceptor/User.java
Log:
HHH-4919 : DefaultMergeEventListener does not call Interceptor.instantiate() for a new persistent entity (Francesco Degrassi)
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java 2010-03-26 22:53:04 UTC (rev 19117)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java 2010-03-26 23:01:38 UTC (rev 19118)
@@ -295,8 +295,7 @@
persister.setIdentifier( copyCache.get( entity ), id, source.getEntityMode() );
}
else {
- ( ( EventCache ) copyCache ).put( entity, persister.instantiate( id, source.getEntityMode() ), true ); //before cascade!
- //TODO: should this be Session.instantiate(Persister, ...)?
+ ( ( EventCache ) copyCache ).put( entity, source.instantiate( persister, id ), true ); //before cascade!
}
final Object copy = copyCache.get( entity );
Added: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interceptor/InstantiateInterceptor.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interceptor/InstantiateInterceptor.java (rev 0)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interceptor/InstantiateInterceptor.java 2010-03-26 23:01:38 UTC (rev 19118)
@@ -0,0 +1,54 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ *
+ */
+
+/**
+ * @author Gail Badner
+ */
+package org.hibernate.test.interceptor;
+
+import java.io.Serializable;
+
+import org.hibernate.CallbackException;
+import org.hibernate.EmptyInterceptor;
+import org.hibernate.EntityMode;
+
+public class InstantiateInterceptor extends EmptyInterceptor {
+ private String injectedString;
+
+ public InstantiateInterceptor(String injectedString) {
+ this.injectedString = injectedString;
+ }
+
+ public Object instantiate(String entityName, EntityMode entityMode, Serializable id) throws CallbackException {
+ if ( ! "org.hibernate.test.interceptor.User".equals( entityName ) ) {
+ return null;
+ }
+ // Simply inject a sample string into new instances
+ User instance = new User();
+ instance.setName( ( String ) id );
+ instance.setInjectedString( injectedString );
+ return instance;
+ }
+}
\ No newline at end of file
Modified: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interceptor/InterceptorTest.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interceptor/InterceptorTest.java 2010-03-26 22:53:04 UTC (rev 19117)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interceptor/InterceptorTest.java 2010-03-26 23:01:38 UTC (rev 19118)
@@ -164,5 +164,48 @@
s.close();
}
+ public void testInitiateIntercept() {
+ final String injectedString = "******";
+ final InstantiateInterceptor initiateInterceptor = new InstantiateInterceptor( injectedString );
+ Session s = openSession( initiateInterceptor );
+
+ Transaction t = s.beginTransaction();
+ User u = new User( "Gavin", "nivag" );
+ s.persist( u );
+ t.commit();
+ s.close();
+
+ assertNull( u.getInjectedString() );
+ u.setPassword( "blah" );
+
+ s = openSession( initiateInterceptor );
+ t = s.beginTransaction();
+
+ User merged = ( User ) s.merge( u );
+ assertEquals( injectedString, merged.getInjectedString() );
+ assertEquals( u.getName(), merged.getName() );
+ assertEquals( u.getPassword(), merged.getPassword() );
+
+ merged.setInjectedString( null );
+
+ User loaded = ( User ) s.load(User.class, merged.getName());
+ // the session-bound instance was not instantiated by the interceptor, load simply returns it
+ assertSame( merged, loaded );
+ assertNull( merged.getInjectedString() );
+
+ // flush the session and evict the merged instance from session to force an actual load
+ s.flush();
+ s.evict( merged );
+
+ User reloaded = ( User ) s.load( User.class, merged.getName() );
+ // Interceptor IS called for instantiating the persistent instance associated to the session when using load
+ assertEquals( injectedString, reloaded.getInjectedString() );
+ assertEquals( u.getName(), reloaded.getName() );
+ assertEquals( u.getPassword(), reloaded.getPassword() );
+
+ s.delete( reloaded );
+ t.commit();
+ s.close();
+ }
}
Modified: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interceptor/User.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interceptor/User.java 2010-03-26 22:53:04 UTC (rev 19117)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/interceptor/User.java 2010-03-26 23:01:38 UTC (rev 19118)
@@ -11,6 +11,7 @@
private Set actions = new HashSet();
private Calendar lastUpdated;
private Calendar created;
+ private String injectedString;
public User(String name, String password) {
super();
@@ -50,4 +51,10 @@
public void setCreated(Calendar created) {
this.created = created;
}
+ public String getInjectedString() {
+ return injectedString;
+ }
+ public void setInjectedString(String injectedString) {
+ this.injectedString = injectedString;
+ }
}
14 years, 8 months
Hibernate SVN: r19117 - in core/trunk: testsuite/src/test/java/org/hibernate/test/interceptor and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-03-26 18:53:04 -0400 (Fri, 26 Mar 2010)
New Revision: 19117
Added:
core/trunk/testsuite/src/test/java/org/hibernate/test/interceptor/InstantiateInterceptor.java
Modified:
core/trunk/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java
core/trunk/testsuite/src/test/java/org/hibernate/test/interceptor/InterceptorTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/interceptor/User.java
Log:
DefaultMergeEventListener does not call Interceptor.instantiate() for a new persistent entity (Francesco Degrassi)
Modified: core/trunk/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java 2010-03-25 20:32:31 UTC (rev 19116)
+++ core/trunk/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java 2010-03-26 22:53:04 UTC (rev 19117)
@@ -295,8 +295,7 @@
persister.setIdentifier( copyCache.get( entity ), id, source );
}
else {
- ( ( EventCache ) copyCache ).put( entity, persister.instantiate( id, source ), true ); //before cascade!
- //TODO: should this be Session.instantiate(Persister, ...)?
+ ( ( EventCache ) copyCache ).put( entity, source.instantiate( persister, id ), true ); //before cascade!
}
final Object copy = copyCache.get( entity );
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/interceptor/InstantiateInterceptor.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/interceptor/InstantiateInterceptor.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/interceptor/InstantiateInterceptor.java 2010-03-26 22:53:04 UTC (rev 19117)
@@ -0,0 +1,54 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ *
+ */
+
+/**
+ * @author Gail Badner
+ */
+package org.hibernate.test.interceptor;
+
+import java.io.Serializable;
+
+import org.hibernate.CallbackException;
+import org.hibernate.EmptyInterceptor;
+import org.hibernate.EntityMode;
+
+public class InstantiateInterceptor extends EmptyInterceptor {
+ private String injectedString;
+
+ public InstantiateInterceptor(String injectedString) {
+ this.injectedString = injectedString;
+ }
+
+ public Object instantiate(String entityName, EntityMode entityMode, Serializable id) throws CallbackException {
+ if ( ! "org.hibernate.test.interceptor.User".equals( entityName ) ) {
+ return null;
+ }
+ // Simply inject a sample string into new instances
+ User instance = new User();
+ instance.setName( ( String ) id );
+ instance.setInjectedString( injectedString );
+ return instance;
+ }
+}
\ No newline at end of file
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/interceptor/InterceptorTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/interceptor/InterceptorTest.java 2010-03-25 20:32:31 UTC (rev 19116)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/interceptor/InterceptorTest.java 2010-03-26 22:53:04 UTC (rev 19117)
@@ -164,5 +164,48 @@
s.close();
}
+ public void testInitiateIntercept() {
+ final String injectedString = "******";
+ final InstantiateInterceptor initiateInterceptor = new InstantiateInterceptor( injectedString );
+ Session s = openSession( initiateInterceptor );
+
+ Transaction t = s.beginTransaction();
+ User u = new User( "Gavin", "nivag" );
+ s.persist( u );
+ t.commit();
+ s.close();
+
+ assertNull( u.getInjectedString() );
+ u.setPassword( "blah" );
+
+ s = openSession( initiateInterceptor );
+ t = s.beginTransaction();
+
+ User merged = ( User ) s.merge( u );
+ assertEquals( injectedString, merged.getInjectedString() );
+ assertEquals( u.getName(), merged.getName() );
+ assertEquals( u.getPassword(), merged.getPassword() );
+
+ merged.setInjectedString( null );
+
+ User loaded = ( User ) s.load(User.class, merged.getName());
+ // the session-bound instance was not instantiated by the interceptor, load simply returns it
+ assertSame( merged, loaded );
+ assertNull( merged.getInjectedString() );
+
+ // flush the session and evict the merged instance from session to force an actual load
+ s.flush();
+ s.evict( merged );
+
+ User reloaded = ( User ) s.load( User.class, merged.getName() );
+ // Interceptor IS called for instantiating the persistent instance associated to the session when using load
+ assertEquals( injectedString, reloaded.getInjectedString() );
+ assertEquals( u.getName(), reloaded.getName() );
+ assertEquals( u.getPassword(), reloaded.getPassword() );
+
+ s.delete( reloaded );
+ t.commit();
+ s.close();
+ }
}
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/interceptor/User.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/interceptor/User.java 2010-03-25 20:32:31 UTC (rev 19116)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/interceptor/User.java 2010-03-26 22:53:04 UTC (rev 19117)
@@ -11,6 +11,7 @@
private Set actions = new HashSet();
private Calendar lastUpdated;
private Calendar created;
+ private String injectedString;
public User(String name, String password) {
super();
@@ -50,4 +51,10 @@
public void setCreated(Calendar created) {
this.created = created;
}
+ public String getInjectedString() {
+ return injectedString;
+ }
+ public void setInjectedString(String injectedString) {
+ this.injectedString = injectedString;
+ }
}
14 years, 8 months
Hibernate SVN: r19116 - entitymanager/branches/v3_4_0_GA_CP/src/test/resources.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-03-25 16:32:31 -0400 (Thu, 25 Mar 2010)
New Revision: 19116
Modified:
entitymanager/branches/v3_4_0_GA_CP/src/test/resources/log4j.properties
Log:
enable log sql peramerers
Modified: entitymanager/branches/v3_4_0_GA_CP/src/test/resources/log4j.properties
===================================================================
--- entitymanager/branches/v3_4_0_GA_CP/src/test/resources/log4j.properties 2010-03-25 15:12:43 UTC (rev 19115)
+++ entitymanager/branches/v3_4_0_GA_CP/src/test/resources/log4j.properties 2010-03-25 20:32:31 UTC (rev 19116)
@@ -28,7 +28,7 @@
log4j.logger.org.hibernate.hql.ast.HqlSqlWalker=trace
log4j.logger.org.hibernate.hql.ast.SqlGenerator=trace
log4j.logger.org.hibernate.hql.ast.AST=trace
-
+log4j.logger.org.hibernate.type=trace
log4j.logger.org.hibernate.ejb=debug
log4j.logger.org.hibernate.ejb.packaging=debug
log4j.logger.org.hibernate.reflection=debug
14 years, 8 months
Hibernate SVN: r19115 - core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/util.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-03-25 11:12:43 -0400 (Thu, 25 Mar 2010)
New Revision: 19115
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/util/PropertiesHelper.java
Log:
correct javadoc typo
Modified: core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/util/PropertiesHelper.java
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/util/PropertiesHelper.java 2010-03-25 13:12:28 UTC (rev 19114)
+++ core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/util/PropertiesHelper.java 2010-03-25 15:12:43 UTC (rev 19115)
@@ -152,7 +152,7 @@
/**
* Constructs a map from a property value.
* <p/>
- * The exact behavior here is largely dependant upon what is passed in as
+ * The exact behavior here is largely dependent upon what is passed in as
* the delimiter.
*
* @see #extractPropertyValue(String, java.util.Properties)
@@ -212,7 +212,7 @@
* replace a property by a starred version
*
* @param props properties to check
- * @param key proeprty to mask
+ * @param key property to mask
* @return cloned and masked properties
*/
public static Properties maskOut(Properties props, String key) {
14 years, 8 months
Hibernate SVN: r19113 - core/trunk/documentation/manual/src/main/docbook/en-US/content.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-03-25 03:46:55 -0400 (Thu, 25 Mar 2010)
New Revision: 19113
Modified:
core/trunk/documentation/manual/src/main/docbook/en-US/content/batch.xml
Log:
change the encoding to utf-8
Modified: core/trunk/documentation/manual/src/main/docbook/en-US/content/batch.xml
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/en-US/content/batch.xml 2010-03-25 06:51:01 UTC (rev 19112)
+++ core/trunk/documentation/manual/src/main/docbook/en-US/content/batch.xml 2010-03-25 07:46:55 UTC (rev 19113)
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding="iso-8859-1"?>
+<?xml version='1.0' encoding="UTF-8"?>
<!--
~ Hibernate, Relational Persistence for Idiomatic Java
~
14 years, 8 months
Hibernate SVN: r19112 - in core/trunk/documentation/manual/src/main/docbook: en-US/content and 6 other directories.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-03-25 02:51:01 -0400 (Thu, 25 Mar 2010)
New Revision: 19112
Added:
core/trunk/documentation/manual/src/main/docbook/de-DE/content/readonly.po
core/trunk/documentation/manual/src/main/docbook/es-ES/content/readonly.po
core/trunk/documentation/manual/src/main/docbook/fr-FR/content/readonly.po
core/trunk/documentation/manual/src/main/docbook/ja-JP/content/readonly.po
core/trunk/documentation/manual/src/main/docbook/pot/content/readonly.pot
core/trunk/documentation/manual/src/main/docbook/pt-BR/content/readonly.po
core/trunk/documentation/manual/src/main/docbook/zh-CN/content/readonly.po
Modified:
core/trunk/documentation/manual/src/main/docbook/de-DE/content/portability.po
core/trunk/documentation/manual/src/main/docbook/en-US/content/readonly.xml
core/trunk/documentation/manual/src/main/docbook/es-ES/content/portability.po
core/trunk/documentation/manual/src/main/docbook/fr-FR/content/portability.po
core/trunk/documentation/manual/src/main/docbook/ja-JP/content/portability.po
core/trunk/documentation/manual/src/main/docbook/pot/content/portability.pot
core/trunk/documentation/manual/src/main/docbook/pt-BR/content/best_practices.po
core/trunk/documentation/manual/src/main/docbook/pt-BR/content/portability.po
core/trunk/documentation/manual/src/main/docbook/zh-CN/content/portability.po
Log:
HHH-4940 added po and pot files and a minor correct
Modified: core/trunk/documentation/manual/src/main/docbook/de-DE/content/portability.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/portability.po 2010-03-24 22:47:51 UTC (rev 19111)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/portability.po 2010-03-25 06:51:01 UTC (rev 19112)
@@ -275,7 +275,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:47\n"
+"POT-Creation-Date: 2010-03-25 06:26+0000\n"
"PO-Revision-Date: 2007-02-26 10:27+1000\n"
"Last-Translator: \n"
"Language-Team: <de(a)li.org>\n"
@@ -285,16 +285,19 @@
"X-Generator: KBabel 1.9.1\n"
#. Tag: title
+#: portability.xml:31
#, fuzzy, no-c-format
msgid "Database Portability Considerations"
msgstr "Abgrenzung von Datenbanktransaktionen"
#. Tag: title
+#: portability.xml:34
#, no-c-format
msgid "Portability Basics"
msgstr ""
#. Tag: para
+#: portability.xml:36
#, no-c-format
msgid ""
"One of the selling points of Hibernate (and really Object/Relational Mapping "
@@ -308,11 +311,13 @@
msgstr ""
#. Tag: title
+#: portability.xml:47
#, no-c-format
msgid "Dialect"
msgstr "Dialekt"
#. Tag: para
+#: portability.xml:49
#, no-c-format
msgid ""
"The first line of portability for Hibernate is the dialect, which is a "
@@ -326,11 +331,13 @@
msgstr ""
#. Tag: title
+#: portability.xml:60
#, no-c-format
msgid "Dialect resolution"
msgstr ""
#. Tag: para
+#: portability.xml:62
#, no-c-format
msgid ""
"Originally, Hibernate would always require that users specify which dialect "
@@ -341,6 +348,7 @@
msgstr ""
#. Tag: para
+#: portability.xml:69
#, no-c-format
msgid ""
"Starting with version 3.2, Hibernate introduced the notion of automatically "
@@ -352,26 +360,28 @@
msgstr ""
#. Tag: para
+#: portability.xml:77
#, no-c-format
msgid ""
"Starting with version 3.3, Hibernate has a fare more powerful way to "
"automatically determine which dialect to should be used by relying on a "
"series of delegates which implement the <interfacename>org.hibernate.dialect."
"resolver.DialectResolver</interfacename> which defines only a single method:"
-"<programlisting role=\"JAVA\">public Dialect resolveDialect(DatabaseMetaData "
-"metaData) throws JDBCConnectionException</programlisting>. The basic "
-"contract here is that if the resolver 'understands' the given database "
-"metadata then it returns the corresponding Dialect; if not it returns null "
-"and the process continues to the next resolver. The signature also "
-"identifies <exceptionname>org.hibernate.exception.JDBCConnectionException</"
-"exceptionname> as possibly being thrown. A JDBCConnectionException here is "
-"interpreted to imply a \"non transient\" (aka non-recoverable) connection "
-"problem and is used to indicate an immediate stop to resolution attempts. "
-"All other exceptions result in a warning and continuing on to the next "
-"resolver."
+"<programlisting role=\"JAVA\"><![CDATA[public Dialect resolveDialect"
+"(DatabaseMetaData metaData) throws JDBCConnectionException]]></"
+"programlisting>. The basic contract here is that if the resolver "
+"'understands' the given database metadata then it returns the corresponding "
+"Dialect; if not it returns null and the process continues to the next "
+"resolver. The signature also identifies <exceptionname>org.hibernate."
+"exception.JDBCConnectionException</exceptionname> as possibly being thrown. "
+"A JDBCConnectionException here is interpreted to imply a \"non transient"
+"\" (aka non-recoverable) connection problem and is used to indicate an "
+"immediate stop to resolution attempts. All other exceptions result in a "
+"warning and continuing on to the next resolver."
msgstr ""
#. Tag: para
+#: portability.xml:90
#, no-c-format
msgid ""
"The cool part about these resolvers is that users can also register their "
@@ -387,11 +397,13 @@
msgstr ""
#. Tag: title
+#: portability.xml:103
#, fuzzy, no-c-format
msgid "Identifier generation"
msgstr "Die \"Getter\"-Methode des Bezeichners"
#. Tag: para
+#: portability.xml:105
#, no-c-format
msgid ""
"When considering portability between databases, another important decision "
@@ -410,63 +422,38 @@
"reference entities within a persistence context it must then issue the "
"insert immediately when the users requests the entitiy be associated with "
"the session (like via save() e.g.) regardless of current transactional "
-"semantics."
+"semantics. <note> <para> Hibernate was changed slightly once the implication "
+"of this was better understood so that the insert is delayed in cases where "
+"that is feasible. </para> </note> The underlying issue is that the actual "
+"semanctics of the application itself changes in these cases."
msgstr ""
#. Tag: para
+#: portability.xml:130
#, no-c-format
msgid ""
-"Hibernate was changed slightly once the implication of this was better "
-"understood so that the insert is delayed in cases where that is feasible."
-msgstr ""
-
-#. Tag: note
-#, no-c-format
-msgid ""
-"The underlying issue is that the actual semanctics of the application itself "
-"changes in these cases."
-msgstr ""
-
-#. Tag: para
-#, no-c-format
-msgid ""
"Starting with version 3.2.3, Hibernate comes with a set of <ulink url="
"\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier generators "
-"targetting portability in a much different way."
+"targetting portability in a much different way. <note> <para> There are "
+"specifically 2 bundled <emphasis>enhanced</emphasis>generators: "
+"<itemizedlist> <listitem> <para> <classname>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</classname> </para> </listitem> <listitem> <para> "
+"<classname>org.hibernate.id.enhanced.TableGenerator</classname> </para> </"
+"listitem> </itemizedlist> </para> </note> The idea behind these generators "
+"is to port the actual semantics of the identifer value generation to the "
+"different databases. For example, the <classname>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</classname> mimics the behavior of a sequence on "
+"databases which do not support sequences by using a table."
msgstr ""
-#. Tag: para
-#, no-c-format
-msgid ""
-"There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
-msgstr ""
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
-msgstr "org.hibernate.cache.TreeCacheProvider"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
-msgstr "org.hibernate.cache.TreeCacheProvider"
-
-#. Tag: note
-#, no-c-format
-msgid ""
-"The idea behind these generators is to port the actual semantics of the "
-"identifer value generation to the different databases. For example, the "
-"<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> "
-"mimics the behavior of a sequence on databases which do not support "
-"sequences by using a table."
-msgstr ""
-
#. Tag: title
+#: portability.xml:159
#, fuzzy, no-c-format
msgid "Database functions"
msgstr "Aggregierte Funktionen"
#. Tag: para
+#: portability.xml:162
#, no-c-format
msgid ""
"This is an area in Hibernate in need of improvement. In terms of portability "
@@ -475,6 +462,7 @@
msgstr ""
#. Tag: para
+#: portability.xml:169
#, no-c-format
msgid ""
"SQL functions can be referenced in many ways by users. However, not all "
@@ -485,6 +473,7 @@
msgstr ""
#. Tag: para
+#: portability.xml:175
#, no-c-format
msgid ""
"Technically this function registration is handled through the <classname>org."
@@ -495,6 +484,7 @@
msgstr ""
#. Tag: para
+#: portability.xml:182
#, no-c-format
msgid ""
"It is sort of implemented such that users can programatically register "
@@ -503,11 +493,22 @@
msgstr ""
#. Tag: title
+#: portability.xml:192
#, no-c-format
msgid "Type mappings"
msgstr ""
#. Tag: para
+#: portability.xml:194
#, no-c-format
msgid "This section scheduled for completion at a later date..."
msgstr ""
+
+#, fuzzy
+#~ msgid ""
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
+#~ msgstr "org.hibernate.cache.TreeCacheProvider"
+
+#, fuzzy
+#~ msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
+#~ msgstr "org.hibernate.cache.TreeCacheProvider"
Added: core/trunk/documentation/manual/src/main/docbook/de-DE/content/readonly.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/readonly.po (rev 0)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/readonly.po 2010-03-25 06:51:01 UTC (rev 19112)
@@ -0,0 +1,1124 @@
+# Language de-DE translations for PACKAGE package.
+# Automatically generated, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-03-25 06:26+0000\n"
+"PO-Revision-Date: 2010-03-25 06:26+0000\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Tag: title
+#: readonly.xml:33
+#, no-c-format
+msgid "Read-only entities"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:36
+#, no-c-format
+msgid ""
+"Hibernate's treatment of <emphasis>read-only</emphasis> entities may differ "
+"from what you may have encountered elsewhere. Incorrect usage may cause "
+"unexpected results."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:43
+#, no-c-format
+msgid "When an entity is read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:48
+#, no-c-format
+msgid ""
+"Hibernate does not dirty-check the entity's simple properties or single-"
+"ended associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:54
+#, no-c-format
+msgid ""
+"Hibernate will not update simple properties or updatable single-ended "
+"associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:60
+#, no-c-format
+msgid ""
+"Hibernate will not update the version of the read-only entity if only simple "
+"properties or single-ended updatable associations are changed;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:69
+#, no-c-format
+msgid ""
+"In some ways, Hibernate treats read-only entities the same as entities that "
+"are not read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:75
+#, no-c-format
+msgid ""
+"Hibernate cascades operations to associations as defined in the entity "
+"mapping."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:81
+#, no-c-format
+msgid ""
+"Hibernate updates the version if the entity has a collection with changes "
+"that dirties the entity;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:87
+#, no-c-format
+msgid "A read-only entity can be deleted."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:94
+#, no-c-format
+msgid ""
+"Even if an entity is not read-only, its collection association can be "
+"affected if it contains a read-only entity."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:99
+#, no-c-format
+msgid ""
+"For details about the affect of read-only entities on different property and "
+"association types, see <xref linkend=\"readonly-proptypes\"/>."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:105
+#, no-c-format
+msgid "For details about how to make entities read-only, see"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:110
+#, no-c-format
+msgid "Hibernate does some optimizing for read-only entities:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:115
+#, no-c-format
+msgid ""
+"It saves execution time by not dirty-checking simple properties or single-"
+"ended associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:121
+#, no-c-format
+msgid "It saves memory by deleting database snapshots."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:128
+#, no-c-format
+msgid "Making persistent entities read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:130
+#, no-c-format
+msgid ""
+"Only persistent entities can be made read-only. Transient and detached "
+"entities must be put in persistent state before they can be made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:136
+#, no-c-format
+msgid ""
+"Hibernate provides the following ways to make persistent entities read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:142
+#, no-c-format
+msgid ""
+"you can map an entity class as <emphasis>immutable</emphasis>; when an "
+"entity of an immutable class is made persistent, Hibernate automatically "
+"makes it read-only. see <xref linkend=\"readonly-api-immutable\"/> for "
+"details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:150
+#, no-c-format
+msgid ""
+"you can change a default so that entities loaded into the session by "
+"Hibernate are automatically made read-only; see <xref linkend=\"readonly-api-"
+"loaddefault\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:157
+#, no-c-format
+msgid ""
+"you can make an HQL query or criteria read-only so that entities loaded when "
+"the query or criteria executes, scrolls, or iterates, are automatically made "
+"read-only; see <xref linkend=\"readonly-api-querycriteria\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:165
+#, no-c-format
+msgid ""
+"you can make a persistent entity that is already in the in the session read-"
+"only; see <xref linkend=\"readonly-api-entity\"/> for details"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:174
+#, no-c-format
+msgid "Entities of immutable classes"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:176
+#, no-c-format
+msgid ""
+"When an entity instance of an immutable class is made persistent, Hibernate "
+"automatically makes it read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:180
+#, no-c-format
+msgid ""
+"An entity of an immutable class can created and deleted the same as an "
+"entity of a mutable class."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:185
+#, no-c-format
+msgid ""
+"Hibernate treats a persistent entity of an immutable class the same way as a "
+"read-only persistent entity of a mutable class. The only exception is that "
+"Hibernate will not allow an entity of an immutable class to be changed so it "
+"is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:196
+#, no-c-format
+msgid "Loading persistent entities as read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:199 readonly.xml:286
+#, no-c-format
+msgid "Entities of immutable classes are automatically loaded as read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:205
+#, no-c-format
+msgid ""
+"To change the default behavior so Hibernate loads entity instances of "
+"mutable classes into the session and automatically makes them read-only, "
+"call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:210
+#, no-c-format
+msgid "Session.setDefaultReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:212
+#, no-c-format
+msgid ""
+"To change the default back so entities loaded by Hibernate are not made read-"
+"only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:216
+#, no-c-format
+msgid "Session.setDefaultReadOnly( false );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:218
+#, no-c-format
+msgid "You can determine the current setting by calling:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:221
+#, no-c-format
+msgid "Session.isDefaultReadOnly();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:223
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns true, entities loaded by the "
+"following are automatically made read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:229
+#, no-c-format
+msgid "Session.load()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:234
+#, no-c-format
+msgid "Session.get()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:239
+#, no-c-format
+msgid "Session.merge()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:244
+#, no-c-format
+msgid ""
+"executing, scrolling, or iterating HQL queries and criteria; to override "
+"this setting for a particular HQL query or criteria see"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:253
+#, no-c-format
+msgid "Changing this default has no effect on:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:258
+#, no-c-format
+msgid "persistent entities already in the session when the default was changed"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:264
+#, no-c-format
+msgid ""
+"persistent entities that are refreshed via Session.refresh(); a refreshed "
+"persistent entity will only be read-only if it was read-only before "
+"refreshing"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:272
+#, no-c-format
+msgid ""
+"persistent entities added by the application via Session.persist(), Session."
+"save(), and Session.update() Session.saveOrUpdate()"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:283
+#, no-c-format
+msgid "Loading read-only entities from an HQL query/criteria"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:292
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns false (the default) when an HQL query "
+"or criteria executes, then entities and proxies of mutable classes loaded by "
+"the query will not be read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:299
+#, no-c-format
+msgid ""
+"You can override this behavior so that entities and proxies loaded by an HQL "
+"query or criteria are automatically made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:304
+#, no-c-format
+msgid "For an HQL query, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:307
+#, no-c-format
+msgid "Query.setReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:309
+#, no-c-format
+msgid ""
+"<literal>Query.setReadOnly( true )</literal> must be called before "
+"<literal>Query.list()</literal>, <literal>Query.uniqueResult()</literal>, "
+"<literal>Query.scroll()</literal>, or <literal>Query.iterate()</literal>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:315
+#, no-c-format
+msgid "For an HQL criteria, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:318
+#, no-c-format
+msgid "Criteria.setReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:320
+#, no-c-format
+msgid ""
+"<literal>Criteria.setReadOnly( true )</literal> must be called before "
+"<literal>Criteria.list()</literal>, <literal>Criteria.uniqueResult()</"
+"literal>, or <literal>Criteria.scroll()</literal>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:326
+#, no-c-format
+msgid ""
+"Entities and proxies that exist in the session before being returned by an "
+"HQL query or criteria are not affected."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:331
+#, no-c-format
+msgid ""
+"Uninitialized persistent collections returned by the query are not affected. "
+"Later, when the collection is initialized, entities loaded into the session "
+"will be read-only if Session.isDefaultReadOnly() returns true."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:338
+#, no-c-format
+msgid ""
+"Using <literal>Query.setReadOnly( true )</literal> or <literal>Criteria."
+"setReadOnly( true )</literal> works well when a single HQL query or criteria "
+"loads all the entities and intializes all the proxies and collections that "
+"the application needs to be read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:346
+#, no-c-format
+msgid ""
+"When it is not possible to load and initialize all necessary entities in a "
+"single query or criteria, you can temporarily change the session default to "
+"load entities as read-only before the query is executed. Then you can "
+"explicitly initialize proxies and collections before restoring the session "
+"default."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:355
+#, no-c-format
+msgid ""
+"Session session = factory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+" \n"
+"setDefaultReadOnly( true );\n"
+"Contract contract = \n"
+" ( Contract ) session.createQuery(\n"
+" \"from Contract where customerName = 'Sherman'\" )\n"
+" .uniqueResult();\n"
+"Hibernate.initialize( contract.getPlan() );\n"
+"Hibernate.initialize( contract.getVariations() );\n"
+"Hibernate.initialize( contract.getNotes() );\n"
+"setDefaultReadOnly( false );\n"
+"...\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:357
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns true, then you can use Query."
+"setReadOnly( false ) and Criteria.setReadOnly( false ) to override this "
+"session setting and load entities that are not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:367
+#, no-c-format
+msgid "Making a persistent entity read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:369
+#, no-c-format
+msgid ""
+"Persistent entities of immutable classes are automatically made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:375
+#, no-c-format
+msgid "To make a persistent entity or proxy read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:378
+#, no-c-format
+msgid "Session.setReadOnly(entityOrProxy, true)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:380
+#, no-c-format
+msgid ""
+"To change a read-only entity or proxy of a mutable class so it is no longer "
+"read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:384
+#, no-c-format
+msgid "Session.setReadOnly(entityOrProxy, false)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:387
+#, no-c-format
+msgid ""
+"When a read-only entity or proxy is changed so it is no longer read-only, "
+"Hibernate assumes that the current state of the read-only entity is "
+"consistent with its database representation. If this is not true, then any "
+"non-flushed changes made before or while the entity was read-only, will be "
+"ignored."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:396
+#, no-c-format
+msgid ""
+"To throw away non-flushed changes and make the persistent entity consistent "
+"with its database representation, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:400
+#, no-c-format
+msgid "session.refresh( entity );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:402
+#, no-c-format
+msgid ""
+"To flush changes made before or while the entity was read-only and make the "
+"database representation consistent with the current state of the persistent "
+"entity:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:408
+#, no-c-format
+msgid ""
+"// evict the read-only entity so it is detached\n"
+"session.evict( entity );\n"
+"\n"
+"// make the detached entity (with the non-flushed changes) persistent\n"
+"session.update( entity );\n"
+"\n"
+"// now entity is no longer read-only and its changes can be flushed\n"
+"s.flush();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:413
+#, no-c-format
+msgid "Read-only affect on property type"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:415
+#, no-c-format
+msgid ""
+"The following table summarizes how different property types are affected by "
+"making an entity read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:421
+#, no-c-format
+msgid "Affect of read-only entity on property types"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:427
+#, no-c-format
+msgid "Property/Association Type"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:428
+#, no-c-format
+msgid "Changes flushed to DB?"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:433
+#, no-c-format
+msgid "Simple"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:435
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-simple\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:439
+#, no-c-format
+msgid "<entry>no*</entry>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:443
+#, no-c-format
+msgid "Unidirectional one-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:444
+#, no-c-format
+msgid "Unidirectional many-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:445
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-singleended-unidir\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:451 readonly.xml:452
+#, no-c-format
+msgid "<para>no*</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:457
+#, no-c-format
+msgid "Unidirectional one-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:458
+#, no-c-format
+msgid "Unidirectional many-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:459
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-manyended-unidir\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:464 readonly.xml:465 readonly.xml:489
+#, no-c-format
+msgid "<para>yes</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:470
+#, no-c-format
+msgid "<para>Bidirectional one-to-one</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:471
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-onetoone-bidir\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:475
+#, no-c-format
+msgid "only if the owning entity is not read-only*"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:479
+#, no-c-format
+msgid "<para>Bidirectional one-to-many/many-to-one</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:480
+#, no-c-format
+msgid "inverse collection"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:481
+#, no-c-format
+msgid "non-inverse collection"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:482
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-onetomany-manytoone\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:488
+#, no-c-format
+msgid "only added/removed entities that are not read-only*"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:494
+#, no-c-format
+msgid "<para>Bidirectional many-to-many</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:495
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-manytomany-bidir\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:499
+#, no-c-format
+msgid "<entry>yes</entry>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:505
+#, no-c-format
+msgid ""
+"* Behavior is different when the entity having the property/association is "
+"read-only, compared to when it is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:511
+#, no-c-format
+msgid "Simple properties"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:513
+#, no-c-format
+msgid ""
+"When a persistent object is read-only, Hibernate does not dirty-check simple "
+"properties."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:518
+#, no-c-format
+msgid ""
+"Hibernate will not synchronize simple property state changes to the "
+"database. If you have automatic versioning, Hibernate will not increment the "
+"version if any simple properties change."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:524
+#, no-c-format
+msgid ""
+"Session session = factory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+"\n"
+"// get a contract and make it read-only\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"\n"
+"// contract.getCustomerName() is \"Sherman\"\n"
+"contract.setCustomerName( \"Yogi\" );\n"
+"tx.commit();\n"
+"\n"
+"tx = session.beginTransaction();\n"
+"\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"// contract.getCustomerName() is still \"Sherman\"\n"
+"...\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:529
+#, no-c-format
+msgid "Unidirectional associations"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:532
+#, no-c-format
+msgid "Unidirectional one-to-one and many-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:534
+#, no-c-format
+msgid ""
+"Hibernate treats unidirectional one-to-one and many-to-one associations in "
+"the same way when the owning entity is read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:540
+#, no-c-format
+msgid ""
+"We use the term <emphasis>unidirectional single-ended association</emphasis> "
+"when referring to functionality that is common to unidirectional one-to-one "
+"and many-to-one associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:547
+#, no-c-format
+msgid ""
+"Hibernate does not dirty-check unidirectional single-ended associations when "
+"the owning entity is read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:552
+#, no-c-format
+msgid ""
+"If you change a read-only entity's reference to a unidirectional single-"
+"ended association to null, or to refer to a different entity, that change "
+"will not be flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:560
+#, no-c-format
+msgid ""
+"If an entity is of an immutable class, then its references to unidirectional "
+"single-ended associations must be assigned when that entity is first "
+"created. Because the entity is automatically made read-only, these "
+"references can not be updated."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:570
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will not increment the version "
+"due to local changes to unidirectional single-ended associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:576
+#, no-c-format
+msgid ""
+"In the following examples, Contract has a unidirectional many-to-one "
+"association with Plan. Contract cascades save and update operations to the "
+"association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:582
+#, no-c-format
+msgid ""
+"The following shows that changing a read-only entity's many-to-one "
+"association reference to null has no effect on the entity's database "
+"representation."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:588
+#, no-c-format
+msgid ""
+"// get a contract with an existing plan;\n"
+"// make the contract read-only and set its plan to null \n"
+"tx = session.beginTransaction();\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"contract.setPlan( null );\n"
+"tx.commit();\n"
+"\n"
+"// get the same contract\n"
+"tx = session.beginTransaction();\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"\n"
+"// contract.getPlan() still refers to the original plan;\n"
+"\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:590
+#, no-c-format
+msgid ""
+"The following shows that, even though an update to a read-only entity's many-"
+"to-one association has no affect on the entity's database representation, "
+"flush still cascades the save-update operation to the locally changed "
+"association."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:599
+#, no-c-format
+msgid ""
+"// get a contract with an existing plan;\n"
+"// make the contract read-only and change to a new plan\n"
+"tx = session.beginTransaction();\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"Plan newPlan = new Plan( \"new plan\"\n"
+"contract.setPlan( newPlan);\n"
+"tx.commit();\n"
+"\n"
+"// get the same contract\n"
+"tx = session.beginTransaction();\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"newPlan = ( Contract ) session.get( Plan.class, newPlan.getId() ); \n"
+"\n"
+"// contract.getPlan() still refers to the original plan;\n"
+"// newPlan is non-null because it was persisted when \n"
+"// the previous transaction was committed; \n"
+"\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:604
+#, no-c-format
+msgid "Unidirectional one-to-many and many-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:606
+#, no-c-format
+msgid ""
+"Hibernate treats unidirectional one-to-many and many-to-many associations "
+"owned by a read-only entity the same as when owned by an entity that is not "
+"read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:613
+#, no-c-format
+msgid ""
+"Hibernate dirty-checks unidirectional one-to-many and many-to-many "
+"associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:618
+#, no-c-format
+msgid ""
+"The collection can contain entities that are read-only, as well as entities "
+"that are not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:624
+#, no-c-format
+msgid ""
+"Entities can be added and removed from the collection; changes are flushed "
+"to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:629
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will update the version due to "
+"changes in the collection if they dirty the owning entity."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:640
+#, no-c-format
+msgid "Bidirectional associations"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:643
+#, no-c-format
+msgid "<title>Bidirectional one-to-one</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:645
+#, no-c-format
+msgid "If a read-only entity owns a bidirectional one-to-one association:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:652
+#, no-c-format
+msgid "Hibernate does not dirty-check the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:657
+#, no-c-format
+msgid ""
+"updates that change the association reference to null or to refer to a "
+"different entity will not be flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:664
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will not increment the version "
+"due to local changes to the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:673
+#, no-c-format
+msgid ""
+"If an entity is of an immutable class, and it owns a bidirectional one-to-"
+"one association, then its reference must be assigned when that entity is "
+"first created. Because the entity is automatically made read-only, these "
+"references cannot be updated."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:683
+#, no-c-format
+msgid ""
+"When the owner is not read-only, Hibernate treats an association with a read-"
+"only entity the same as when the association is with an entity that is not "
+"read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:693
+#, no-c-format
+msgid "<title>Bidirectional one-to-many/many-to-one</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:695
+#, no-c-format
+msgid ""
+"A read-only entity has no impact on a bidirectional one-to-many/many-to-one "
+"association if:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:702
+#, no-c-format
+msgid ""
+"the read-only entity is on the one-to-many side using an inverse collection;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:708
+#, no-c-format
+msgid ""
+"the read-only entity is on the one-to-many side using a non-inverse "
+"collection;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:714
+#, no-c-format
+msgid ""
+"the one-to-many side uses a non-inverse collection that contains the read-"
+"only entity"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:721
+#, no-c-format
+msgid "When the one-to-many side uses an inverse collection:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:727
+#, no-c-format
+msgid ""
+"a read-only entity can only be added to the collection when it is created;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:733
+#, no-c-format
+msgid ""
+"a read-only entity can only be removed from the collection by an orphan "
+"delete or by explicitly deleting the entity."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:744
+#, no-c-format
+msgid "<title>Bidirectional many-to-many</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:745
+#, no-c-format
+msgid ""
+"Hibernate treats bidirectional many-to-many associations owned by a read-"
+"only entity the same as when owned by an entity that is not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:752
+#, no-c-format
+msgid "Hibernate dirty-checks bidirectional many-to-many associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:757
+#, no-c-format
+msgid ""
+"The collection on either side of the association can contain entities that "
+"are read-only, as well as entities that are not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:763
+#, no-c-format
+msgid ""
+"Entities are added and removed from both sides of the collection; changes "
+"are flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:769
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will update the version due to "
+"changes in both sides of the collection if they dirty the entity owning the "
+"respective collections."
+msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/en-US/content/readonly.xml
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/en-US/content/readonly.xml 2010-03-24 22:47:51 UTC (rev 19111)
+++ core/trunk/documentation/manual/src/main/docbook/en-US/content/readonly.xml 2010-03-25 06:51:01 UTC (rev 19112)
@@ -36,7 +36,7 @@
<para>
Hibernate's treatment of <emphasis>read-only</emphasis> entities may
differ from what you may have encountered elsewhere. Incorrect usage
- may cause unexpected results.
+ may cause unexpected results.
</para>
</important>
@@ -109,7 +109,7 @@
<para>
Hibernate does some optimizing for read-only entities:
- </para>
+ </para>
<itemizedlist>
<listitem>
<para>
@@ -118,7 +118,7 @@
</para>
</listitem>
<listitem>
- <para>
+ <para>
It saves memory by deleting database snapshots.
</para>
</listitem>
@@ -176,7 +176,7 @@
<para>
When an entity instance of an immutable class is made
persistent, Hibernate automatically makes it read-only.
- </para>
+ </para>
<para>
An entity of an immutable class can created
and deleted the same as an entity of a mutable class.
@@ -236,12 +236,12 @@
</para>
</listitem>
<listitem>
- <para>
+ <para>
Session.merge()
</para>
</listitem>
<listitem>
- <para>
+ <para>
executing, scrolling, or iterating HQL queries and
criteria; to override this setting for a particular
HQL query or criteria see
@@ -269,7 +269,7 @@
</para>
</listitem>
<listitem>
- <para>
+ <para>
persistent entities added by the application via
Session.persist(), Session.save(), and Session.update()
Session.saveOrUpdate()
@@ -393,7 +393,7 @@
To make a persistent entity or proxy read-only, call:
</para>
<programlisting>Session.setReadOnly(entityOrProxy, true)</programlisting>
-
+
<para>
To change a read-only entity or proxy of a mutable class so
it is no longer read-only, call:
@@ -413,8 +413,8 @@
<para>
To throw away non-flushed changes and make the persistent entity
consistent with its database representation, call:
- </para>
- <programlisting role="Java">session.refresh( entity );</programlisting>
+ </para>
+ <programlisting role="Java">session.refresh( entity );</programlisting>
<para>
To flush changes made before or while the entity
@@ -422,15 +422,15 @@
consistent with the current state of the persistent
entity:
</para>
-<programlisting role="Java">
-// evict the read-only entity so it is detached
-session.evict( entity );
-
-// make the detached entity (with the non-flushed changes) persistent
-session.update( entity );
-
-// now entity is no longer read-only and its changes can be flushed
-s.flush();
+<programlisting role="Java">
+// evict the read-only entity so it is detached
+session.evict( entity );
+
+// make the detached entity (with the non-flushed changes) persistent
+session.update( entity );
+
+// now entity is no longer read-only and its changes can be flushed
+s.flush();
</programlisting>
</section>
</section>
@@ -536,15 +536,15 @@
<section id="readonly-proptypes-simple">
<title>Simple properties</title>
- <para>
+ <para>
When a persistent object is read-only, Hibernate does not
- dirty-check simple properties.
- </para>
+ dirty-check simple properties.
+ </para>
<para>
Hibernate will not synchronize simple property state changes
to the database. If you have automatic versioning, Hibernate
- will not increment the version if any simple properties change.
+ will not increment the version if any simple properties change.
</para>
<programlisting role="Java">
@@ -572,9 +572,9 @@
<section id="readonly-prop-types-unidir">
<title>Unidirectional associations</title>
-
+
<section id="readonly-proptypes-singleended-unidir">
- <title>Unidirectional one-to-one and many-to-one</title>
+ <title>Unidirectional one-to-one and many-to-one</title>
<para>
Hibernate treats unidirectional one-to-one and many-to-one
@@ -591,8 +591,8 @@
<para>
Hibernate does not dirty-check unidirectional single-ended
- associations when the owning entity is read-only.
- </para>
+ associations when the owning entity is read-only.
+ </para>
<para>
If you change a read-only entity's reference to a
@@ -615,7 +615,7 @@
<para>
If automatic versioning is used, Hibernate will not
increment the version due to local changes to
- unidirectional single-ended associations.
+ unidirectional single-ended associations.
</para>
<para>
@@ -708,7 +708,7 @@
<para>
If automatic versioning is used, Hibernate will
update the version due to changes in the collection
- if they dirty the owning entity.
+ if they dirty the owning entity.
</para>
</section>
@@ -729,7 +729,7 @@
<itemizedlist>
<listitem>
<para>
- Hibernate does not dirty-check the association.
+ Hibernate does not dirty-check the association.
</para>
</listitem>
<listitem>
@@ -740,16 +740,16 @@
</para>
</listitem>
<listitem>
- <para>
+ <para>
If automatic versioning is used, Hibernate will not
increment the version due to local changes to
- the association.
+ the association.
</para>
</listitem>
</itemizedlist>
<note>
- <para>
+ <para>
If an entity is of an immutable class,
and it owns a bidirectional one-to-one
association, then its reference must be
@@ -790,7 +790,7 @@
</para>
</listitem>
<listitem>
- <para>
+ <para>
the one-to-many side uses a non-inverse collection
that contains the read-only entity
</para>
@@ -849,7 +849,7 @@
If automatic versioning is used, Hibernate will
update the version due to changes in both sides of
the collection if they dirty the entity owning the
- respective collections.
+ respective collections.
</para>
</section>
Modified: core/trunk/documentation/manual/src/main/docbook/es-ES/content/portability.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/es-ES/content/portability.po 2010-03-24 22:47:51 UTC (rev 19111)
+++ core/trunk/documentation/manual/src/main/docbook/es-ES/content/portability.po 2010-03-25 06:51:01 UTC (rev 19112)
@@ -14,7 +14,7 @@
msgstr ""
"Project-Id-Version: portability\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:47\n"
+"POT-Creation-Date: 2010-03-25 06:26+0000\n"
"PO-Revision-Date: 2010-03-17 12:19+1000\n"
"Last-Translator: Angela Garcia <agarcia(a)redhat.com>\n"
"Language-Team: <en(a)li.org>\n"
@@ -24,16 +24,19 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: portability.xml:31
#, no-c-format
msgid "Database Portability Considerations"
msgstr "Consideraciones de la portabilidad de la base de datos"
#. Tag: title
+#: portability.xml:34
#, no-c-format
msgid "Portability Basics"
msgstr "Aspectos básicos de la portabilidad"
#. Tag: para
+#: portability.xml:36
#, no-c-format
msgid ""
"One of the selling points of Hibernate (and really Object/Relational Mapping "
@@ -56,11 +59,13 @@
"cambiar los metadatos de mapeo. "
#. Tag: title
+#: portability.xml:47
#, no-c-format
msgid "Dialect"
msgstr "Dialecto"
#. Tag: para
+#: portability.xml:49
#, no-c-format
msgid ""
"The first line of portability for Hibernate is the dialect, which is a "
@@ -83,11 +88,13 @@
"el propio."
#. Tag: title
+#: portability.xml:60
#, no-c-format
msgid "Dialect resolution"
msgstr "Resolución del dialecto"
#. Tag: para
+#: portability.xml:62
#, no-c-format
msgid ""
"Originally, Hibernate would always require that users specify which dialect "
@@ -104,6 +111,7 @@
"establecer ese valor. "
#. Tag: para
+#: portability.xml:69
#, no-c-format
msgid ""
"Starting with version 3.2, Hibernate introduced the notion of automatically "
@@ -122,41 +130,43 @@
"se podía sobreescribir."
#. Tag: para
-#, no-c-format
+#: portability.xml:77
+#, fuzzy, no-c-format
msgid ""
"Starting with version 3.3, Hibernate has a fare more powerful way to "
"automatically determine which dialect to should be used by relying on a "
"series of delegates which implement the <interfacename>org.hibernate.dialect."
"resolver.DialectResolver</interfacename> which defines only a single method:"
-"<programlisting role=\"JAVA\">public Dialect resolveDialect(DatabaseMetaData "
-"metaData) throws JDBCConnectionException</programlisting>. The basic "
-"contract here is that if the resolver 'understands' the given database "
-"metadata then it returns the corresponding Dialect; if not it returns null "
-"and the process continues to the next resolver. The signature also "
-"identifies <exceptionname>org.hibernate.exception.JDBCConnectionException</"
-"exceptionname> as possibly being thrown. A JDBCConnectionException here is "
-"interpreted to imply a \"non transient\" (aka non-recoverable) connection "
-"problem and is used to indicate an immediate stop to resolution attempts. "
-"All other exceptions result in a warning and continuing on to the next "
-"resolver."
+"<programlisting role=\"JAVA\"><![CDATA[public Dialect resolveDialect"
+"(DatabaseMetaData metaData) throws JDBCConnectionException]]></"
+"programlisting>. The basic contract here is that if the resolver "
+"'understands' the given database metadata then it returns the corresponding "
+"Dialect; if not it returns null and the process continues to the next "
+"resolver. The signature also identifies <exceptionname>org.hibernate."
+"exception.JDBCConnectionException</exceptionname> as possibly being thrown. "
+"A JDBCConnectionException here is interpreted to imply a \"non transient"
+"\" (aka non-recoverable) connection problem and is used to indicate an "
+"immediate stop to resolution attempts. All other exceptions result in a "
+"warning and continuing on to the next resolver."
msgstr ""
"Empezando por la versión 3.3, Hibernate cuenta con una manera más poderosa "
"de determinar automáticamente cuál dialecto se debe utilizar dependiendo de "
"una serie de delegados, los cuales implementan el <interfacename>org."
-"hibernate.dialect.resolver.DialectResolver</interfacename>. Este define un método único:<programlisting>public Dialect resolveDialect"
-"(DatabaseMetaData metaData) throws JDBCConnectionException</programlisting>. "
-"El contrato básico aquí es que si el resolvedor 'entiende' los metadatos de "
-"la base de datos dada entonces retorna el dialecto correspondiente; si no "
-"entonces retorna nulo y el proceso continua al siguiente resolvedor. La "
-"firma también identifica <exceptionname>org.hibernate.exception."
-"JDBCConnectionException</exceptionname> ya que posiblemente se presenta. Una "
-"JDBCConnectionException aquí se interpreta como un problema de conexión \"no "
-"transitorio\" (también conocido como no-recuperable) y se utiliza para "
-"indicar que se deben detener inmediatamente los intentos de resolución. "
-"Todas las otras excepciones resultan en una advertencia y continua al "
-"siguiente resolvedor. "
+"hibernate.dialect.resolver.DialectResolver</interfacename>. Este define un "
+"método único:<programlisting>public Dialect resolveDialect(DatabaseMetaData "
+"metaData) throws JDBCConnectionException</programlisting>. El contrato "
+"básico aquí es que si el resolvedor 'entiende' los metadatos de la base de "
+"datos dada entonces retorna el dialecto correspondiente; si no entonces "
+"retorna nulo y el proceso continua al siguiente resolvedor. La firma también "
+"identifica <exceptionname>org.hibernate.exception.JDBCConnectionException</"
+"exceptionname> ya que posiblemente se presenta. Una JDBCConnectionException "
+"aquí se interpreta como un problema de conexión \"no transitorio\" (también "
+"conocido como no-recuperable) y se utiliza para indicar que se deben detener "
+"inmediatamente los intentos de resolución. Todas las otras excepciones "
+"resultan en una advertencia y continua al siguiente resolvedor. "
#. Tag: para
+#: portability.xml:90
#, no-c-format
msgid ""
"The cool part about these resolvers is that users can also register their "
@@ -183,12 +193,14 @@
"Environment</classname>)."
#. Tag: title
+#: portability.xml:103
#, no-c-format
msgid "Identifier generation"
msgstr "Generación del identificador"
#. Tag: para
-#, no-c-format
+#: portability.xml:105
+#, fuzzy, no-c-format
msgid ""
"When considering portability between databases, another important decision "
"is selecting the identifier generation stratagy you want to use. Originally "
@@ -206,7 +218,10 @@
"reference entities within a persistence context it must then issue the "
"insert immediately when the users requests the entitiy be associated with "
"the session (like via save() e.g.) regardless of current transactional "
-"semantics."
+"semantics. <note> <para> Hibernate was changed slightly once the implication "
+"of this was better understood so that the insert is delayed in cases where "
+"that is feasible. </para> </note> The underlying issue is that the actual "
+"semanctics of the application itself changes in these cases."
msgstr ""
"Al considerar la portabilidad entre bases de datos, otra decisión importante "
"es el seleccionar la estrategia de generación del identificador que quiere "
@@ -228,76 +243,43 @@
"medio de save()) sin importar la semántica transaccional actual."
#. Tag: para
+#: portability.xml:130
#, no-c-format
msgid ""
-"Hibernate was changed slightly once the implication of this was better "
-"understood so that the insert is delayed in cases where that is feasible."
-msgstr ""
-"Hibernate ha cambiado un poco ya que se comprendió un poco mejor las implicaciones de esto de manera que el insert se retrasa en los casos en "
-"donde esto posible. "
-
-#. Tag: note
-#, no-c-format
-msgid ""
-"The underlying issue is that the actual semanctics of the application itself "
-"changes in these cases."
-msgstr "El problema subyacente es que la semántica real de la aplicación misma cambia en estos casos."
-
-#. Tag: para
-#, no-c-format
-msgid ""
"Starting with version 3.2.3, Hibernate comes with a set of <ulink url="
"\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier generators "
-"targetting portability in a much different way."
+"targetting portability in a much different way. <note> <para> There are "
+"specifically 2 bundled <emphasis>enhanced</emphasis>generators: "
+"<itemizedlist> <listitem> <para> <classname>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</classname> </para> </listitem> <listitem> <para> "
+"<classname>org.hibernate.id.enhanced.TableGenerator</classname> </para> </"
+"listitem> </itemizedlist> </para> </note> The idea behind these generators "
+"is to port the actual semantics of the identifer value generation to the "
+"different databases. For example, the <classname>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</classname> mimics the behavior of a sequence on "
+"databases which do not support sequences by using a table."
msgstr ""
-"Desde la versión 3.2.3, Hibernate viene junto con un grupo de generadores "
-"identificadores <ulink url=\"http://in.relation.to/2082.lace\">mejorados</"
-"ulink> apuntando a la portabilidad de una manera muy diferente."
-#. Tag: para
-#, no-c-format
-msgid "There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
-msgstr "Hay especificamente 2 paquetes de generadores <emphasis>mejorados</emphasis>:"
-
-#. Tag: para
-#, no-c-format
-msgid "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
-msgstr "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
-
-#. Tag: para
-#, no-c-format
-msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
-msgstr "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
-
-#. Tag: note
-#, no-c-format
-msgid ""
-"The idea behind these generators is to port the actual semantics of the "
-"identifer value generation to the different databases. For example, the "
-"<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> "
-"mimics the behavior of a sequence on databases which do not support "
-"sequences by using a table."
-msgstr ""
-"La idea detrás de estos generadores es el llevar la semántica de la "
-"generación del valor identificador a las diferentes bases de datos. Por "
-"ejemplo, el <classname>org.hibernate.id.enhanced.SequenceStyleGenerator</"
-"classname> asemeja el comportamiento de una secuencia en las bases de datos "
-"que no soportan secuencias usando una tabla."
-
#. Tag: title
+#: portability.xml:159
#, no-c-format
msgid "Database functions"
msgstr "Funciones de la base de datos"
#. Tag: para
+#: portability.xml:162
#, no-c-format
msgid ""
"This is an area in Hibernate in need of improvement. In terms of portability "
"concerns, this function handling currently works pretty well from HQL; "
"however, it is quite lacking in all other aspects."
-msgstr "Esta es un área en la que Hibernate necesita mejorar. En términos de qué tan portatil puede ser, esta función que se maneja actualmente trabaja bastante bien desde HQL; sin embargo, en otros aspectos le falta mucho. "
+msgstr ""
+"Esta es un área en la que Hibernate necesita mejorar. En términos de qué tan "
+"portatil puede ser, esta función que se maneja actualmente trabaja bastante "
+"bien desde HQL; sin embargo, en otros aspectos le falta mucho. "
#. Tag: para
+#: portability.xml:169
#, no-c-format
msgid ""
"SQL functions can be referenced in many ways by users. However, not all "
@@ -314,6 +296,7 @@
"totalmente diferente."
#. Tag: para
+#: portability.xml:175
#, no-c-format
msgid ""
"Technically this function registration is handled through the <classname>org."
@@ -330,6 +313,7 @@
"completo."
#. Tag: para
+#: portability.xml:182
#, no-c-format
msgid ""
"It is sort of implemented such that users can programatically register "
@@ -341,12 +325,64 @@
"Configuration</classname> y aquellas funciones serán reconocidas por HQL."
#. Tag: title
+#: portability.xml:192
#, no-c-format
msgid "Type mappings"
msgstr "Mapeos de tipo"
#. Tag: para
+#: portability.xml:194
#, no-c-format
msgid "This section scheduled for completion at a later date..."
msgstr "Esta sección se completará en un futuro cercano..."
+#~ msgid ""
+#~ "Hibernate was changed slightly once the implication of this was better "
+#~ "understood so that the insert is delayed in cases where that is feasible."
+#~ msgstr ""
+#~ "Hibernate ha cambiado un poco ya que se comprendió un poco mejor las "
+#~ "implicaciones de esto de manera que el insert se retrasa en los casos en "
+#~ "donde esto posible. "
+
+#~ msgid ""
+#~ "The underlying issue is that the actual semanctics of the application "
+#~ "itself changes in these cases."
+#~ msgstr ""
+#~ "El problema subyacente es que la semántica real de la aplicación misma "
+#~ "cambia en estos casos."
+
+#~ msgid ""
+#~ "Starting with version 3.2.3, Hibernate comes with a set of <ulink url="
+#~ "\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier "
+#~ "generators targetting portability in a much different way."
+#~ msgstr ""
+#~ "Desde la versión 3.2.3, Hibernate viene junto con un grupo de generadores "
+#~ "identificadores <ulink url=\"http://in.relation.to/2082.lace\">mejorados</"
+#~ "ulink> apuntando a la portabilidad de una manera muy diferente."
+
+#~ msgid ""
+#~ "There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
+#~ msgstr ""
+#~ "Hay especificamente 2 paquetes de generadores <emphasis>mejorados</"
+#~ "emphasis>:"
+
+#~ msgid ""
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
+#~ msgstr ""
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
+
+#~ msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
+#~ msgstr "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
+
+#~ msgid ""
+#~ "The idea behind these generators is to port the actual semantics of the "
+#~ "identifer value generation to the different databases. For example, the "
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> "
+#~ "mimics the behavior of a sequence on databases which do not support "
+#~ "sequences by using a table."
+#~ msgstr ""
+#~ "La idea detrás de estos generadores es el llevar la semántica de la "
+#~ "generación del valor identificador a las diferentes bases de datos. Por "
+#~ "ejemplo, el <classname>org.hibernate.id.enhanced.SequenceStyleGenerator</"
+#~ "classname> asemeja el comportamiento de una secuencia en las bases de "
+#~ "datos que no soportan secuencias usando una tabla."
Added: core/trunk/documentation/manual/src/main/docbook/es-ES/content/readonly.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/es-ES/content/readonly.po (rev 0)
+++ core/trunk/documentation/manual/src/main/docbook/es-ES/content/readonly.po 2010-03-25 06:51:01 UTC (rev 19112)
@@ -0,0 +1,1124 @@
+# Language es-ES translations for PACKAGE package.
+# Automatically generated, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-03-25 06:26+0000\n"
+"PO-Revision-Date: 2010-03-25 06:26+0000\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Tag: title
+#: readonly.xml:33
+#, no-c-format
+msgid "Read-only entities"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:36
+#, no-c-format
+msgid ""
+"Hibernate's treatment of <emphasis>read-only</emphasis> entities may differ "
+"from what you may have encountered elsewhere. Incorrect usage may cause "
+"unexpected results."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:43
+#, no-c-format
+msgid "When an entity is read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:48
+#, no-c-format
+msgid ""
+"Hibernate does not dirty-check the entity's simple properties or single-"
+"ended associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:54
+#, no-c-format
+msgid ""
+"Hibernate will not update simple properties or updatable single-ended "
+"associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:60
+#, no-c-format
+msgid ""
+"Hibernate will not update the version of the read-only entity if only simple "
+"properties or single-ended updatable associations are changed;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:69
+#, no-c-format
+msgid ""
+"In some ways, Hibernate treats read-only entities the same as entities that "
+"are not read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:75
+#, no-c-format
+msgid ""
+"Hibernate cascades operations to associations as defined in the entity "
+"mapping."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:81
+#, no-c-format
+msgid ""
+"Hibernate updates the version if the entity has a collection with changes "
+"that dirties the entity;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:87
+#, no-c-format
+msgid "A read-only entity can be deleted."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:94
+#, no-c-format
+msgid ""
+"Even if an entity is not read-only, its collection association can be "
+"affected if it contains a read-only entity."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:99
+#, no-c-format
+msgid ""
+"For details about the affect of read-only entities on different property and "
+"association types, see <xref linkend=\"readonly-proptypes\"/>."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:105
+#, no-c-format
+msgid "For details about how to make entities read-only, see"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:110
+#, no-c-format
+msgid "Hibernate does some optimizing for read-only entities:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:115
+#, no-c-format
+msgid ""
+"It saves execution time by not dirty-checking simple properties or single-"
+"ended associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:121
+#, no-c-format
+msgid "It saves memory by deleting database snapshots."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:128
+#, no-c-format
+msgid "Making persistent entities read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:130
+#, no-c-format
+msgid ""
+"Only persistent entities can be made read-only. Transient and detached "
+"entities must be put in persistent state before they can be made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:136
+#, no-c-format
+msgid ""
+"Hibernate provides the following ways to make persistent entities read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:142
+#, no-c-format
+msgid ""
+"you can map an entity class as <emphasis>immutable</emphasis>; when an "
+"entity of an immutable class is made persistent, Hibernate automatically "
+"makes it read-only. see <xref linkend=\"readonly-api-immutable\"/> for "
+"details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:150
+#, no-c-format
+msgid ""
+"you can change a default so that entities loaded into the session by "
+"Hibernate are automatically made read-only; see <xref linkend=\"readonly-api-"
+"loaddefault\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:157
+#, no-c-format
+msgid ""
+"you can make an HQL query or criteria read-only so that entities loaded when "
+"the query or criteria executes, scrolls, or iterates, are automatically made "
+"read-only; see <xref linkend=\"readonly-api-querycriteria\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:165
+#, no-c-format
+msgid ""
+"you can make a persistent entity that is already in the in the session read-"
+"only; see <xref linkend=\"readonly-api-entity\"/> for details"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:174
+#, no-c-format
+msgid "Entities of immutable classes"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:176
+#, no-c-format
+msgid ""
+"When an entity instance of an immutable class is made persistent, Hibernate "
+"automatically makes it read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:180
+#, no-c-format
+msgid ""
+"An entity of an immutable class can created and deleted the same as an "
+"entity of a mutable class."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:185
+#, no-c-format
+msgid ""
+"Hibernate treats a persistent entity of an immutable class the same way as a "
+"read-only persistent entity of a mutable class. The only exception is that "
+"Hibernate will not allow an entity of an immutable class to be changed so it "
+"is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:196
+#, no-c-format
+msgid "Loading persistent entities as read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:199 readonly.xml:286
+#, no-c-format
+msgid "Entities of immutable classes are automatically loaded as read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:205
+#, no-c-format
+msgid ""
+"To change the default behavior so Hibernate loads entity instances of "
+"mutable classes into the session and automatically makes them read-only, "
+"call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:210
+#, no-c-format
+msgid "Session.setDefaultReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:212
+#, no-c-format
+msgid ""
+"To change the default back so entities loaded by Hibernate are not made read-"
+"only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:216
+#, no-c-format
+msgid "Session.setDefaultReadOnly( false );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:218
+#, no-c-format
+msgid "You can determine the current setting by calling:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:221
+#, no-c-format
+msgid "Session.isDefaultReadOnly();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:223
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns true, entities loaded by the "
+"following are automatically made read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:229
+#, no-c-format
+msgid "Session.load()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:234
+#, no-c-format
+msgid "Session.get()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:239
+#, no-c-format
+msgid "Session.merge()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:244
+#, no-c-format
+msgid ""
+"executing, scrolling, or iterating HQL queries and criteria; to override "
+"this setting for a particular HQL query or criteria see"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:253
+#, no-c-format
+msgid "Changing this default has no effect on:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:258
+#, no-c-format
+msgid "persistent entities already in the session when the default was changed"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:264
+#, no-c-format
+msgid ""
+"persistent entities that are refreshed via Session.refresh(); a refreshed "
+"persistent entity will only be read-only if it was read-only before "
+"refreshing"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:272
+#, no-c-format
+msgid ""
+"persistent entities added by the application via Session.persist(), Session."
+"save(), and Session.update() Session.saveOrUpdate()"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:283
+#, no-c-format
+msgid "Loading read-only entities from an HQL query/criteria"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:292
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns false (the default) when an HQL query "
+"or criteria executes, then entities and proxies of mutable classes loaded by "
+"the query will not be read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:299
+#, no-c-format
+msgid ""
+"You can override this behavior so that entities and proxies loaded by an HQL "
+"query or criteria are automatically made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:304
+#, no-c-format
+msgid "For an HQL query, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:307
+#, no-c-format
+msgid "Query.setReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:309
+#, no-c-format
+msgid ""
+"<literal>Query.setReadOnly( true )</literal> must be called before "
+"<literal>Query.list()</literal>, <literal>Query.uniqueResult()</literal>, "
+"<literal>Query.scroll()</literal>, or <literal>Query.iterate()</literal>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:315
+#, no-c-format
+msgid "For an HQL criteria, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:318
+#, no-c-format
+msgid "Criteria.setReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:320
+#, no-c-format
+msgid ""
+"<literal>Criteria.setReadOnly( true )</literal> must be called before "
+"<literal>Criteria.list()</literal>, <literal>Criteria.uniqueResult()</"
+"literal>, or <literal>Criteria.scroll()</literal>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:326
+#, no-c-format
+msgid ""
+"Entities and proxies that exist in the session before being returned by an "
+"HQL query or criteria are not affected."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:331
+#, no-c-format
+msgid ""
+"Uninitialized persistent collections returned by the query are not affected. "
+"Later, when the collection is initialized, entities loaded into the session "
+"will be read-only if Session.isDefaultReadOnly() returns true."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:338
+#, no-c-format
+msgid ""
+"Using <literal>Query.setReadOnly( true )</literal> or <literal>Criteria."
+"setReadOnly( true )</literal> works well when a single HQL query or criteria "
+"loads all the entities and intializes all the proxies and collections that "
+"the application needs to be read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:346
+#, no-c-format
+msgid ""
+"When it is not possible to load and initialize all necessary entities in a "
+"single query or criteria, you can temporarily change the session default to "
+"load entities as read-only before the query is executed. Then you can "
+"explicitly initialize proxies and collections before restoring the session "
+"default."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:355
+#, no-c-format
+msgid ""
+"Session session = factory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+" \n"
+"setDefaultReadOnly( true );\n"
+"Contract contract = \n"
+" ( Contract ) session.createQuery(\n"
+" \"from Contract where customerName = 'Sherman'\" )\n"
+" .uniqueResult();\n"
+"Hibernate.initialize( contract.getPlan() );\n"
+"Hibernate.initialize( contract.getVariations() );\n"
+"Hibernate.initialize( contract.getNotes() );\n"
+"setDefaultReadOnly( false );\n"
+"...\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:357
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns true, then you can use Query."
+"setReadOnly( false ) and Criteria.setReadOnly( false ) to override this "
+"session setting and load entities that are not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:367
+#, no-c-format
+msgid "Making a persistent entity read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:369
+#, no-c-format
+msgid ""
+"Persistent entities of immutable classes are automatically made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:375
+#, no-c-format
+msgid "To make a persistent entity or proxy read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:378
+#, no-c-format
+msgid "Session.setReadOnly(entityOrProxy, true)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:380
+#, no-c-format
+msgid ""
+"To change a read-only entity or proxy of a mutable class so it is no longer "
+"read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:384
+#, no-c-format
+msgid "Session.setReadOnly(entityOrProxy, false)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:387
+#, no-c-format
+msgid ""
+"When a read-only entity or proxy is changed so it is no longer read-only, "
+"Hibernate assumes that the current state of the read-only entity is "
+"consistent with its database representation. If this is not true, then any "
+"non-flushed changes made before or while the entity was read-only, will be "
+"ignored."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:396
+#, no-c-format
+msgid ""
+"To throw away non-flushed changes and make the persistent entity consistent "
+"with its database representation, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:400
+#, no-c-format
+msgid "session.refresh( entity );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:402
+#, no-c-format
+msgid ""
+"To flush changes made before or while the entity was read-only and make the "
+"database representation consistent with the current state of the persistent "
+"entity:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:408
+#, no-c-format
+msgid ""
+"// evict the read-only entity so it is detached\n"
+"session.evict( entity );\n"
+"\n"
+"// make the detached entity (with the non-flushed changes) persistent\n"
+"session.update( entity );\n"
+"\n"
+"// now entity is no longer read-only and its changes can be flushed\n"
+"s.flush();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:413
+#, no-c-format
+msgid "Read-only affect on property type"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:415
+#, no-c-format
+msgid ""
+"The following table summarizes how different property types are affected by "
+"making an entity read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:421
+#, no-c-format
+msgid "Affect of read-only entity on property types"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:427
+#, no-c-format
+msgid "Property/Association Type"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:428
+#, no-c-format
+msgid "Changes flushed to DB?"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:433
+#, no-c-format
+msgid "Simple"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:435
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-simple\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:439
+#, no-c-format
+msgid "<entry>no*</entry>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:443
+#, no-c-format
+msgid "Unidirectional one-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:444
+#, no-c-format
+msgid "Unidirectional many-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:445
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-singleended-unidir\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:451 readonly.xml:452
+#, no-c-format
+msgid "<para>no*</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:457
+#, no-c-format
+msgid "Unidirectional one-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:458
+#, no-c-format
+msgid "Unidirectional many-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:459
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-manyended-unidir\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:464 readonly.xml:465 readonly.xml:489
+#, no-c-format
+msgid "<para>yes</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:470
+#, no-c-format
+msgid "<para>Bidirectional one-to-one</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:471
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-onetoone-bidir\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:475
+#, no-c-format
+msgid "only if the owning entity is not read-only*"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:479
+#, no-c-format
+msgid "<para>Bidirectional one-to-many/many-to-one</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:480
+#, no-c-format
+msgid "inverse collection"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:481
+#, no-c-format
+msgid "non-inverse collection"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:482
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-onetomany-manytoone\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:488
+#, no-c-format
+msgid "only added/removed entities that are not read-only*"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:494
+#, no-c-format
+msgid "<para>Bidirectional many-to-many</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:495
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-manytomany-bidir\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:499
+#, no-c-format
+msgid "<entry>yes</entry>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:505
+#, no-c-format
+msgid ""
+"* Behavior is different when the entity having the property/association is "
+"read-only, compared to when it is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:511
+#, no-c-format
+msgid "Simple properties"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:513
+#, no-c-format
+msgid ""
+"When a persistent object is read-only, Hibernate does not dirty-check simple "
+"properties."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:518
+#, no-c-format
+msgid ""
+"Hibernate will not synchronize simple property state changes to the "
+"database. If you have automatic versioning, Hibernate will not increment the "
+"version if any simple properties change."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:524
+#, no-c-format
+msgid ""
+"Session session = factory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+"\n"
+"// get a contract and make it read-only\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"\n"
+"// contract.getCustomerName() is \"Sherman\"\n"
+"contract.setCustomerName( \"Yogi\" );\n"
+"tx.commit();\n"
+"\n"
+"tx = session.beginTransaction();\n"
+"\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"// contract.getCustomerName() is still \"Sherman\"\n"
+"...\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:529
+#, no-c-format
+msgid "Unidirectional associations"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:532
+#, no-c-format
+msgid "Unidirectional one-to-one and many-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:534
+#, no-c-format
+msgid ""
+"Hibernate treats unidirectional one-to-one and many-to-one associations in "
+"the same way when the owning entity is read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:540
+#, no-c-format
+msgid ""
+"We use the term <emphasis>unidirectional single-ended association</emphasis> "
+"when referring to functionality that is common to unidirectional one-to-one "
+"and many-to-one associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:547
+#, no-c-format
+msgid ""
+"Hibernate does not dirty-check unidirectional single-ended associations when "
+"the owning entity is read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:552
+#, no-c-format
+msgid ""
+"If you change a read-only entity's reference to a unidirectional single-"
+"ended association to null, or to refer to a different entity, that change "
+"will not be flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:560
+#, no-c-format
+msgid ""
+"If an entity is of an immutable class, then its references to unidirectional "
+"single-ended associations must be assigned when that entity is first "
+"created. Because the entity is automatically made read-only, these "
+"references can not be updated."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:570
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will not increment the version "
+"due to local changes to unidirectional single-ended associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:576
+#, no-c-format
+msgid ""
+"In the following examples, Contract has a unidirectional many-to-one "
+"association with Plan. Contract cascades save and update operations to the "
+"association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:582
+#, no-c-format
+msgid ""
+"The following shows that changing a read-only entity's many-to-one "
+"association reference to null has no effect on the entity's database "
+"representation."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:588
+#, no-c-format
+msgid ""
+"// get a contract with an existing plan;\n"
+"// make the contract read-only and set its plan to null \n"
+"tx = session.beginTransaction();\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"contract.setPlan( null );\n"
+"tx.commit();\n"
+"\n"
+"// get the same contract\n"
+"tx = session.beginTransaction();\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"\n"
+"// contract.getPlan() still refers to the original plan;\n"
+"\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:590
+#, no-c-format
+msgid ""
+"The following shows that, even though an update to a read-only entity's many-"
+"to-one association has no affect on the entity's database representation, "
+"flush still cascades the save-update operation to the locally changed "
+"association."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:599
+#, no-c-format
+msgid ""
+"// get a contract with an existing plan;\n"
+"// make the contract read-only and change to a new plan\n"
+"tx = session.beginTransaction();\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"Plan newPlan = new Plan( \"new plan\"\n"
+"contract.setPlan( newPlan);\n"
+"tx.commit();\n"
+"\n"
+"// get the same contract\n"
+"tx = session.beginTransaction();\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"newPlan = ( Contract ) session.get( Plan.class, newPlan.getId() ); \n"
+"\n"
+"// contract.getPlan() still refers to the original plan;\n"
+"// newPlan is non-null because it was persisted when \n"
+"// the previous transaction was committed; \n"
+"\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:604
+#, no-c-format
+msgid "Unidirectional one-to-many and many-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:606
+#, no-c-format
+msgid ""
+"Hibernate treats unidirectional one-to-many and many-to-many associations "
+"owned by a read-only entity the same as when owned by an entity that is not "
+"read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:613
+#, no-c-format
+msgid ""
+"Hibernate dirty-checks unidirectional one-to-many and many-to-many "
+"associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:618
+#, no-c-format
+msgid ""
+"The collection can contain entities that are read-only, as well as entities "
+"that are not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:624
+#, no-c-format
+msgid ""
+"Entities can be added and removed from the collection; changes are flushed "
+"to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:629
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will update the version due to "
+"changes in the collection if they dirty the owning entity."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:640
+#, no-c-format
+msgid "Bidirectional associations"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:643
+#, no-c-format
+msgid "<title>Bidirectional one-to-one</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:645
+#, no-c-format
+msgid "If a read-only entity owns a bidirectional one-to-one association:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:652
+#, no-c-format
+msgid "Hibernate does not dirty-check the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:657
+#, no-c-format
+msgid ""
+"updates that change the association reference to null or to refer to a "
+"different entity will not be flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:664
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will not increment the version "
+"due to local changes to the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:673
+#, no-c-format
+msgid ""
+"If an entity is of an immutable class, and it owns a bidirectional one-to-"
+"one association, then its reference must be assigned when that entity is "
+"first created. Because the entity is automatically made read-only, these "
+"references cannot be updated."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:683
+#, no-c-format
+msgid ""
+"When the owner is not read-only, Hibernate treats an association with a read-"
+"only entity the same as when the association is with an entity that is not "
+"read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:693
+#, no-c-format
+msgid "<title>Bidirectional one-to-many/many-to-one</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:695
+#, no-c-format
+msgid ""
+"A read-only entity has no impact on a bidirectional one-to-many/many-to-one "
+"association if:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:702
+#, no-c-format
+msgid ""
+"the read-only entity is on the one-to-many side using an inverse collection;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:708
+#, no-c-format
+msgid ""
+"the read-only entity is on the one-to-many side using a non-inverse "
+"collection;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:714
+#, no-c-format
+msgid ""
+"the one-to-many side uses a non-inverse collection that contains the read-"
+"only entity"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:721
+#, no-c-format
+msgid "When the one-to-many side uses an inverse collection:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:727
+#, no-c-format
+msgid ""
+"a read-only entity can only be added to the collection when it is created;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:733
+#, no-c-format
+msgid ""
+"a read-only entity can only be removed from the collection by an orphan "
+"delete or by explicitly deleting the entity."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:744
+#, no-c-format
+msgid "<title>Bidirectional many-to-many</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:745
+#, no-c-format
+msgid ""
+"Hibernate treats bidirectional many-to-many associations owned by a read-"
+"only entity the same as when owned by an entity that is not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:752
+#, no-c-format
+msgid "Hibernate dirty-checks bidirectional many-to-many associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:757
+#, no-c-format
+msgid ""
+"The collection on either side of the association can contain entities that "
+"are read-only, as well as entities that are not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:763
+#, no-c-format
+msgid ""
+"Entities are added and removed from both sides of the collection; changes "
+"are flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:769
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will update the version due to "
+"changes in both sides of the collection if they dirty the entity owning the "
+"respective collections."
+msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/fr-FR/content/portability.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/fr-FR/content/portability.po 2010-03-24 22:47:51 UTC (rev 19111)
+++ core/trunk/documentation/manual/src/main/docbook/fr-FR/content/portability.po 2010-03-25 06:51:01 UTC (rev 19112)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: portability\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:47\n"
+"POT-Creation-Date: 2010-03-25 06:26+0000\n"
"PO-Revision-Date: 2010-01-05 09:42+1000\n"
"Last-Translator: Corina Roe <croe(a)redhat.com>\n"
"Language-Team: French <i18(a)redhat.com>\n"
@@ -17,16 +17,19 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: portability.xml:31
#, no-c-format
msgid "Database Portability Considerations"
msgstr "Considérations de portabilité des bases de données"
#. Tag: title
+#: portability.xml:34
#, no-c-format
msgid "Portability Basics"
msgstr "Aspects fondamentaux de la portabilité"
#. Tag: para
+#: portability.xml:36
#, no-c-format
msgid ""
"One of the selling points of Hibernate (and really Object/Relational Mapping "
@@ -50,11 +53,13 @@
"modifications des métadonnées de mappage."
#. Tag: title
+#: portability.xml:47
#, no-c-format
msgid "Dialect"
msgstr "Dialecte"
#. Tag: para
+#: portability.xml:49
#, no-c-format
msgid ""
"The first line of portability for Hibernate is the dialect, which is a "
@@ -77,11 +82,13 @@
"n'est pas difficile d'écrire votre propre dialecte."
#. Tag: title
+#: portability.xml:60
#, no-c-format
msgid "Dialect resolution"
msgstr "Résolution de dialecte"
#. Tag: para
+#: portability.xml:62
#, no-c-format
msgid ""
"Originally, Hibernate would always require that users specify which dialect "
@@ -98,6 +105,7 @@
"valeur."
#. Tag: para
+#: portability.xml:69
#, no-c-format
msgid ""
"Starting with version 3.2, Hibernate introduced the notion of automatically "
@@ -115,23 +123,24 @@
"connues d'Hibernate et elle n'était ni configurable, ni remplaçable."
#. Tag: para
+#: portability.xml:77
#, fuzzy, no-c-format
msgid ""
"Starting with version 3.3, Hibernate has a fare more powerful way to "
"automatically determine which dialect to should be used by relying on a "
"series of delegates which implement the <interfacename>org.hibernate.dialect."
"resolver.DialectResolver</interfacename> which defines only a single method:"
-"<programlisting role=\"JAVA\">public Dialect resolveDialect(DatabaseMetaData "
-"metaData) throws JDBCConnectionException</programlisting>. The basic "
-"contract here is that if the resolver 'understands' the given database "
-"metadata then it returns the corresponding Dialect; if not it returns null "
-"and the process continues to the next resolver. The signature also "
-"identifies <exceptionname>org.hibernate.exception.JDBCConnectionException</"
-"exceptionname> as possibly being thrown. A JDBCConnectionException here is "
-"interpreted to imply a \"non transient\" (aka non-recoverable) connection "
-"problem and is used to indicate an immediate stop to resolution attempts. "
-"All other exceptions result in a warning and continuing on to the next "
-"resolver."
+"<programlisting role=\"JAVA\"><![CDATA[public Dialect resolveDialect"
+"(DatabaseMetaData metaData) throws JDBCConnectionException]]></"
+"programlisting>. The basic contract here is that if the resolver "
+"'understands' the given database metadata then it returns the corresponding "
+"Dialect; if not it returns null and the process continues to the next "
+"resolver. The signature also identifies <exceptionname>org.hibernate."
+"exception.JDBCConnectionException</exceptionname> as possibly being thrown. "
+"A JDBCConnectionException here is interpreted to imply a \"non transient"
+"\" (aka non-recoverable) connection problem and is used to indicate an "
+"immediate stop to resolution attempts. All other exceptions result in a "
+"warning and continuing on to the next resolver."
msgstr ""
"A partir de la version 3.3, Hibernate a un moyen bien plus puissant de "
"déterminer automatiquement quel dialecte devrait être utilisé en s'appuyant "
@@ -150,6 +159,7 @@
"exceptions entraînent un avertissement et de passer à la résolution suivante."
#. Tag: para
+#: portability.xml:90
#, no-c-format
msgid ""
"The cool part about these resolvers is that users can also register their "
@@ -177,11 +187,13 @@
"sur <classname>cfg.Environment org.Hibernate.</classname>)."
#. Tag: title
+#: portability.xml:103
#, no-c-format
msgid "Identifier generation"
msgstr "Générer les identifiants"
#. Tag: para
+#: portability.xml:105
#, fuzzy, no-c-format
msgid ""
"When considering portability between databases, another important decision "
@@ -200,7 +212,10 @@
"reference entities within a persistence context it must then issue the "
"insert immediately when the users requests the entitiy be associated with "
"the session (like via save() e.g.) regardless of current transactional "
-"semantics."
+"semantics. <note> <para> Hibernate was changed slightly once the implication "
+"of this was better understood so that the insert is delayed in cases where "
+"that is feasible. </para> </note> The underlying issue is that the actual "
+"semanctics of the application itself changes in these cases."
msgstr ""
"Quand on considère la portabilité entre les bases de données, la sélection "
"de stratégie de génération d'identifiant à utiliser est une autre décision "
@@ -224,72 +239,31 @@
"sémantique de l'application elle-même change dans ces cas."
#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"Hibernate was changed slightly once the implication of this was better "
-"understood so that the insert is delayed in cases where that is feasible."
-msgstr ""
-"Hibernate a été amélioré de façon à ce que l'insertion puisse être retardée "
-"quand c'est possible."
-
-#. Tag: note
+#: portability.xml:130
#, no-c-format
msgid ""
-"The underlying issue is that the actual semanctics of the application itself "
-"changes in these cases."
-msgstr ""
-
-#. Tag: para
-#, no-c-format
-msgid ""
"Starting with version 3.2.3, Hibernate comes with a set of <ulink url="
"\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier generators "
-"targetting portability in a much different way."
+"targetting portability in a much different way. <note> <para> There are "
+"specifically 2 bundled <emphasis>enhanced</emphasis>generators: "
+"<itemizedlist> <listitem> <para> <classname>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</classname> </para> </listitem> <listitem> <para> "
+"<classname>org.hibernate.id.enhanced.TableGenerator</classname> </para> </"
+"listitem> </itemizedlist> </para> </note> The idea behind these generators "
+"is to port the actual semantics of the identifer value generation to the "
+"different databases. For example, the <classname>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</classname> mimics the behavior of a sequence on "
+"databases which do not support sequences by using a table."
msgstr ""
-"A partir de la version 3.2.3, Hibernate est fourni avec un ensemble de "
-"générateurs d'identifiants <ulink url=\"http://in.relation.to/2082.lace"
-"\">améliorés</ulink>qui ciblent la portabilité d'une façon très différente."
-#. Tag: para
-#, no-c-format
-msgid ""
-"There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
-msgstr ""
-"Il existe 2 générateurs <emphasis>améliorés</emphasis> spécifiques qui sont "
-"livrés."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
-msgstr ""
-"<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
-msgstr "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
-
-#. Tag: note
-#, no-c-format
-msgid ""
-"The idea behind these generators is to port the actual semantics of the "
-"identifer value generation to the different databases. For example, the "
-"<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> "
-"mimics the behavior of a sequence on databases which do not support "
-"sequences by using a table."
-msgstr ""
-"L'idée qui se cache là derrière, c'est de porter la sémantique de la "
-"génération de la valeur d'identifiant vers les bases de données diverses. "
-"Ainsi, <classname>org.hibernate.id.enhanced.SequenceStyleGenerator</"
-"classname> imite le comportement d'une séquence de databases, ne supportant "
-"pas les séquences par une table."
-
#. Tag: title
+#: portability.xml:159
#, no-c-format
msgid "Database functions"
msgstr "Fonctions de base de données"
#. Tag: para
+#: portability.xml:162
#, no-c-format
msgid ""
"This is an area in Hibernate in need of improvement. In terms of portability "
@@ -298,6 +272,7 @@
msgstr ""
#. Tag: para
+#: portability.xml:169
#, fuzzy, no-c-format
msgid ""
"SQL functions can be referenced in many ways by users. However, not all "
@@ -314,6 +289,7 @@
"appel de fonction physique totalement différente."
#. Tag: para
+#: portability.xml:175
#, no-c-format
msgid ""
"Technically this function registration is handled through the <classname>org."
@@ -330,6 +306,7 @@
"terminé."
#. Tag: para
+#: portability.xml:182
#, no-c-format
msgid ""
"It is sort of implemented such that users can programatically register "
@@ -341,16 +318,65 @@
"Configuration</classname> et ces fonctions seront reconnues pour HQL."
#. Tag: title
+#: portability.xml:192
#, no-c-format
msgid "Type mappings"
msgstr ""
#. Tag: para
+#: portability.xml:194
#, no-c-format
msgid "This section scheduled for completion at a later date..."
msgstr ""
+#, fuzzy
#~ msgid ""
+#~ "Hibernate was changed slightly once the implication of this was better "
+#~ "understood so that the insert is delayed in cases where that is feasible."
+#~ msgstr ""
+#~ "Hibernate a été amélioré de façon à ce que l'insertion puisse être "
+#~ "retardée quand c'est possible."
+
+#~ msgid ""
+#~ "Starting with version 3.2.3, Hibernate comes with a set of <ulink url="
+#~ "\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier "
+#~ "generators targetting portability in a much different way."
+#~ msgstr ""
+#~ "A partir de la version 3.2.3, Hibernate est fourni avec un ensemble de "
+#~ "générateurs d'identifiants <ulink url=\"http://in.relation.to/2082.lace"
+#~ "\">améliorés</ulink>qui ciblent la portabilité d'une façon très "
+#~ "différente."
+
+#~ msgid ""
+#~ "There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
+#~ msgstr ""
+#~ "Il existe 2 générateurs <emphasis>améliorés</emphasis> spécifiques qui "
+#~ "sont livrés."
+
+#, fuzzy
+#~ msgid ""
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
+#~ msgstr ""
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
+
+#, fuzzy
+#~ msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
+#~ msgstr "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
+
+#~ msgid ""
+#~ "The idea behind these generators is to port the actual semantics of the "
+#~ "identifer value generation to the different databases. For example, the "
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> "
+#~ "mimics the behavior of a sequence on databases which do not support "
+#~ "sequences by using a table."
+#~ msgstr ""
+#~ "L'idée qui se cache là derrière, c'est de porter la sémantique de la "
+#~ "génération de la valeur d'identifiant vers les bases de données diverses. "
+#~ "Ainsi, <classname>org.hibernate.id.enhanced.SequenceStyleGenerator</"
+#~ "classname> imite le comportement d'une séquence de databases, ne "
+#~ "supportant pas les séquences par une table."
+
+#~ msgid ""
#~ "This is a new area in Hibernate and as such it is not as mature as the "
#~ "overall Hibernate experience."
#~ msgstr ""
Added: core/trunk/documentation/manual/src/main/docbook/fr-FR/content/readonly.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/fr-FR/content/readonly.po (rev 0)
+++ core/trunk/documentation/manual/src/main/docbook/fr-FR/content/readonly.po 2010-03-25 06:51:01 UTC (rev 19112)
@@ -0,0 +1,1124 @@
+# Language fr-FR translations for PACKAGE package.
+# Automatically generated, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-03-25 06:26+0000\n"
+"PO-Revision-Date: 2010-03-25 06:26+0000\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Tag: title
+#: readonly.xml:33
+#, no-c-format
+msgid "Read-only entities"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:36
+#, no-c-format
+msgid ""
+"Hibernate's treatment of <emphasis>read-only</emphasis> entities may differ "
+"from what you may have encountered elsewhere. Incorrect usage may cause "
+"unexpected results."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:43
+#, no-c-format
+msgid "When an entity is read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:48
+#, no-c-format
+msgid ""
+"Hibernate does not dirty-check the entity's simple properties or single-"
+"ended associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:54
+#, no-c-format
+msgid ""
+"Hibernate will not update simple properties or updatable single-ended "
+"associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:60
+#, no-c-format
+msgid ""
+"Hibernate will not update the version of the read-only entity if only simple "
+"properties or single-ended updatable associations are changed;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:69
+#, no-c-format
+msgid ""
+"In some ways, Hibernate treats read-only entities the same as entities that "
+"are not read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:75
+#, no-c-format
+msgid ""
+"Hibernate cascades operations to associations as defined in the entity "
+"mapping."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:81
+#, no-c-format
+msgid ""
+"Hibernate updates the version if the entity has a collection with changes "
+"that dirties the entity;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:87
+#, no-c-format
+msgid "A read-only entity can be deleted."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:94
+#, no-c-format
+msgid ""
+"Even if an entity is not read-only, its collection association can be "
+"affected if it contains a read-only entity."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:99
+#, no-c-format
+msgid ""
+"For details about the affect of read-only entities on different property and "
+"association types, see <xref linkend=\"readonly-proptypes\"/>."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:105
+#, no-c-format
+msgid "For details about how to make entities read-only, see"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:110
+#, no-c-format
+msgid "Hibernate does some optimizing for read-only entities:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:115
+#, no-c-format
+msgid ""
+"It saves execution time by not dirty-checking simple properties or single-"
+"ended associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:121
+#, no-c-format
+msgid "It saves memory by deleting database snapshots."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:128
+#, no-c-format
+msgid "Making persistent entities read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:130
+#, no-c-format
+msgid ""
+"Only persistent entities can be made read-only. Transient and detached "
+"entities must be put in persistent state before they can be made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:136
+#, no-c-format
+msgid ""
+"Hibernate provides the following ways to make persistent entities read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:142
+#, no-c-format
+msgid ""
+"you can map an entity class as <emphasis>immutable</emphasis>; when an "
+"entity of an immutable class is made persistent, Hibernate automatically "
+"makes it read-only. see <xref linkend=\"readonly-api-immutable\"/> for "
+"details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:150
+#, no-c-format
+msgid ""
+"you can change a default so that entities loaded into the session by "
+"Hibernate are automatically made read-only; see <xref linkend=\"readonly-api-"
+"loaddefault\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:157
+#, no-c-format
+msgid ""
+"you can make an HQL query or criteria read-only so that entities loaded when "
+"the query or criteria executes, scrolls, or iterates, are automatically made "
+"read-only; see <xref linkend=\"readonly-api-querycriteria\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:165
+#, no-c-format
+msgid ""
+"you can make a persistent entity that is already in the in the session read-"
+"only; see <xref linkend=\"readonly-api-entity\"/> for details"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:174
+#, no-c-format
+msgid "Entities of immutable classes"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:176
+#, no-c-format
+msgid ""
+"When an entity instance of an immutable class is made persistent, Hibernate "
+"automatically makes it read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:180
+#, no-c-format
+msgid ""
+"An entity of an immutable class can created and deleted the same as an "
+"entity of a mutable class."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:185
+#, no-c-format
+msgid ""
+"Hibernate treats a persistent entity of an immutable class the same way as a "
+"read-only persistent entity of a mutable class. The only exception is that "
+"Hibernate will not allow an entity of an immutable class to be changed so it "
+"is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:196
+#, no-c-format
+msgid "Loading persistent entities as read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:199 readonly.xml:286
+#, no-c-format
+msgid "Entities of immutable classes are automatically loaded as read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:205
+#, no-c-format
+msgid ""
+"To change the default behavior so Hibernate loads entity instances of "
+"mutable classes into the session and automatically makes them read-only, "
+"call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:210
+#, no-c-format
+msgid "Session.setDefaultReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:212
+#, no-c-format
+msgid ""
+"To change the default back so entities loaded by Hibernate are not made read-"
+"only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:216
+#, no-c-format
+msgid "Session.setDefaultReadOnly( false );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:218
+#, no-c-format
+msgid "You can determine the current setting by calling:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:221
+#, no-c-format
+msgid "Session.isDefaultReadOnly();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:223
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns true, entities loaded by the "
+"following are automatically made read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:229
+#, no-c-format
+msgid "Session.load()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:234
+#, no-c-format
+msgid "Session.get()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:239
+#, no-c-format
+msgid "Session.merge()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:244
+#, no-c-format
+msgid ""
+"executing, scrolling, or iterating HQL queries and criteria; to override "
+"this setting for a particular HQL query or criteria see"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:253
+#, no-c-format
+msgid "Changing this default has no effect on:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:258
+#, no-c-format
+msgid "persistent entities already in the session when the default was changed"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:264
+#, no-c-format
+msgid ""
+"persistent entities that are refreshed via Session.refresh(); a refreshed "
+"persistent entity will only be read-only if it was read-only before "
+"refreshing"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:272
+#, no-c-format
+msgid ""
+"persistent entities added by the application via Session.persist(), Session."
+"save(), and Session.update() Session.saveOrUpdate()"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:283
+#, no-c-format
+msgid "Loading read-only entities from an HQL query/criteria"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:292
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns false (the default) when an HQL query "
+"or criteria executes, then entities and proxies of mutable classes loaded by "
+"the query will not be read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:299
+#, no-c-format
+msgid ""
+"You can override this behavior so that entities and proxies loaded by an HQL "
+"query or criteria are automatically made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:304
+#, no-c-format
+msgid "For an HQL query, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:307
+#, no-c-format
+msgid "Query.setReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:309
+#, no-c-format
+msgid ""
+"<literal>Query.setReadOnly( true )</literal> must be called before "
+"<literal>Query.list()</literal>, <literal>Query.uniqueResult()</literal>, "
+"<literal>Query.scroll()</literal>, or <literal>Query.iterate()</literal>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:315
+#, no-c-format
+msgid "For an HQL criteria, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:318
+#, no-c-format
+msgid "Criteria.setReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:320
+#, no-c-format
+msgid ""
+"<literal>Criteria.setReadOnly( true )</literal> must be called before "
+"<literal>Criteria.list()</literal>, <literal>Criteria.uniqueResult()</"
+"literal>, or <literal>Criteria.scroll()</literal>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:326
+#, no-c-format
+msgid ""
+"Entities and proxies that exist in the session before being returned by an "
+"HQL query or criteria are not affected."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:331
+#, no-c-format
+msgid ""
+"Uninitialized persistent collections returned by the query are not affected. "
+"Later, when the collection is initialized, entities loaded into the session "
+"will be read-only if Session.isDefaultReadOnly() returns true."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:338
+#, no-c-format
+msgid ""
+"Using <literal>Query.setReadOnly( true )</literal> or <literal>Criteria."
+"setReadOnly( true )</literal> works well when a single HQL query or criteria "
+"loads all the entities and intializes all the proxies and collections that "
+"the application needs to be read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:346
+#, no-c-format
+msgid ""
+"When it is not possible to load and initialize all necessary entities in a "
+"single query or criteria, you can temporarily change the session default to "
+"load entities as read-only before the query is executed. Then you can "
+"explicitly initialize proxies and collections before restoring the session "
+"default."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:355
+#, no-c-format
+msgid ""
+"Session session = factory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+" \n"
+"setDefaultReadOnly( true );\n"
+"Contract contract = \n"
+" ( Contract ) session.createQuery(\n"
+" \"from Contract where customerName = 'Sherman'\" )\n"
+" .uniqueResult();\n"
+"Hibernate.initialize( contract.getPlan() );\n"
+"Hibernate.initialize( contract.getVariations() );\n"
+"Hibernate.initialize( contract.getNotes() );\n"
+"setDefaultReadOnly( false );\n"
+"...\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:357
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns true, then you can use Query."
+"setReadOnly( false ) and Criteria.setReadOnly( false ) to override this "
+"session setting and load entities that are not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:367
+#, no-c-format
+msgid "Making a persistent entity read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:369
+#, no-c-format
+msgid ""
+"Persistent entities of immutable classes are automatically made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:375
+#, no-c-format
+msgid "To make a persistent entity or proxy read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:378
+#, no-c-format
+msgid "Session.setReadOnly(entityOrProxy, true)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:380
+#, no-c-format
+msgid ""
+"To change a read-only entity or proxy of a mutable class so it is no longer "
+"read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:384
+#, no-c-format
+msgid "Session.setReadOnly(entityOrProxy, false)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:387
+#, no-c-format
+msgid ""
+"When a read-only entity or proxy is changed so it is no longer read-only, "
+"Hibernate assumes that the current state of the read-only entity is "
+"consistent with its database representation. If this is not true, then any "
+"non-flushed changes made before or while the entity was read-only, will be "
+"ignored."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:396
+#, no-c-format
+msgid ""
+"To throw away non-flushed changes and make the persistent entity consistent "
+"with its database representation, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:400
+#, no-c-format
+msgid "session.refresh( entity );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:402
+#, no-c-format
+msgid ""
+"To flush changes made before or while the entity was read-only and make the "
+"database representation consistent with the current state of the persistent "
+"entity:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:408
+#, no-c-format
+msgid ""
+"// evict the read-only entity so it is detached\n"
+"session.evict( entity );\n"
+"\n"
+"// make the detached entity (with the non-flushed changes) persistent\n"
+"session.update( entity );\n"
+"\n"
+"// now entity is no longer read-only and its changes can be flushed\n"
+"s.flush();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:413
+#, no-c-format
+msgid "Read-only affect on property type"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:415
+#, no-c-format
+msgid ""
+"The following table summarizes how different property types are affected by "
+"making an entity read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:421
+#, no-c-format
+msgid "Affect of read-only entity on property types"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:427
+#, no-c-format
+msgid "Property/Association Type"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:428
+#, no-c-format
+msgid "Changes flushed to DB?"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:433
+#, no-c-format
+msgid "Simple"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:435
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-simple\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:439
+#, no-c-format
+msgid "<entry>no*</entry>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:443
+#, no-c-format
+msgid "Unidirectional one-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:444
+#, no-c-format
+msgid "Unidirectional many-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:445
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-singleended-unidir\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:451 readonly.xml:452
+#, no-c-format
+msgid "<para>no*</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:457
+#, no-c-format
+msgid "Unidirectional one-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:458
+#, no-c-format
+msgid "Unidirectional many-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:459
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-manyended-unidir\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:464 readonly.xml:465 readonly.xml:489
+#, no-c-format
+msgid "<para>yes</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:470
+#, no-c-format
+msgid "<para>Bidirectional one-to-one</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:471
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-onetoone-bidir\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:475
+#, no-c-format
+msgid "only if the owning entity is not read-only*"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:479
+#, no-c-format
+msgid "<para>Bidirectional one-to-many/many-to-one</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:480
+#, no-c-format
+msgid "inverse collection"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:481
+#, no-c-format
+msgid "non-inverse collection"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:482
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-onetomany-manytoone\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:488
+#, no-c-format
+msgid "only added/removed entities that are not read-only*"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:494
+#, no-c-format
+msgid "<para>Bidirectional many-to-many</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:495
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-manytomany-bidir\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:499
+#, no-c-format
+msgid "<entry>yes</entry>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:505
+#, no-c-format
+msgid ""
+"* Behavior is different when the entity having the property/association is "
+"read-only, compared to when it is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:511
+#, no-c-format
+msgid "Simple properties"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:513
+#, no-c-format
+msgid ""
+"When a persistent object is read-only, Hibernate does not dirty-check simple "
+"properties."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:518
+#, no-c-format
+msgid ""
+"Hibernate will not synchronize simple property state changes to the "
+"database. If you have automatic versioning, Hibernate will not increment the "
+"version if any simple properties change."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:524
+#, no-c-format
+msgid ""
+"Session session = factory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+"\n"
+"// get a contract and make it read-only\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"\n"
+"// contract.getCustomerName() is \"Sherman\"\n"
+"contract.setCustomerName( \"Yogi\" );\n"
+"tx.commit();\n"
+"\n"
+"tx = session.beginTransaction();\n"
+"\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"// contract.getCustomerName() is still \"Sherman\"\n"
+"...\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:529
+#, no-c-format
+msgid "Unidirectional associations"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:532
+#, no-c-format
+msgid "Unidirectional one-to-one and many-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:534
+#, no-c-format
+msgid ""
+"Hibernate treats unidirectional one-to-one and many-to-one associations in "
+"the same way when the owning entity is read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:540
+#, no-c-format
+msgid ""
+"We use the term <emphasis>unidirectional single-ended association</emphasis> "
+"when referring to functionality that is common to unidirectional one-to-one "
+"and many-to-one associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:547
+#, no-c-format
+msgid ""
+"Hibernate does not dirty-check unidirectional single-ended associations when "
+"the owning entity is read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:552
+#, no-c-format
+msgid ""
+"If you change a read-only entity's reference to a unidirectional single-"
+"ended association to null, or to refer to a different entity, that change "
+"will not be flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:560
+#, no-c-format
+msgid ""
+"If an entity is of an immutable class, then its references to unidirectional "
+"single-ended associations must be assigned when that entity is first "
+"created. Because the entity is automatically made read-only, these "
+"references can not be updated."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:570
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will not increment the version "
+"due to local changes to unidirectional single-ended associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:576
+#, no-c-format
+msgid ""
+"In the following examples, Contract has a unidirectional many-to-one "
+"association with Plan. Contract cascades save and update operations to the "
+"association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:582
+#, no-c-format
+msgid ""
+"The following shows that changing a read-only entity's many-to-one "
+"association reference to null has no effect on the entity's database "
+"representation."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:588
+#, no-c-format
+msgid ""
+"// get a contract with an existing plan;\n"
+"// make the contract read-only and set its plan to null \n"
+"tx = session.beginTransaction();\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"contract.setPlan( null );\n"
+"tx.commit();\n"
+"\n"
+"// get the same contract\n"
+"tx = session.beginTransaction();\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"\n"
+"// contract.getPlan() still refers to the original plan;\n"
+"\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:590
+#, no-c-format
+msgid ""
+"The following shows that, even though an update to a read-only entity's many-"
+"to-one association has no affect on the entity's database representation, "
+"flush still cascades the save-update operation to the locally changed "
+"association."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:599
+#, no-c-format
+msgid ""
+"// get a contract with an existing plan;\n"
+"// make the contract read-only and change to a new plan\n"
+"tx = session.beginTransaction();\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"Plan newPlan = new Plan( \"new plan\"\n"
+"contract.setPlan( newPlan);\n"
+"tx.commit();\n"
+"\n"
+"// get the same contract\n"
+"tx = session.beginTransaction();\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"newPlan = ( Contract ) session.get( Plan.class, newPlan.getId() ); \n"
+"\n"
+"// contract.getPlan() still refers to the original plan;\n"
+"// newPlan is non-null because it was persisted when \n"
+"// the previous transaction was committed; \n"
+"\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:604
+#, no-c-format
+msgid "Unidirectional one-to-many and many-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:606
+#, no-c-format
+msgid ""
+"Hibernate treats unidirectional one-to-many and many-to-many associations "
+"owned by a read-only entity the same as when owned by an entity that is not "
+"read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:613
+#, no-c-format
+msgid ""
+"Hibernate dirty-checks unidirectional one-to-many and many-to-many "
+"associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:618
+#, no-c-format
+msgid ""
+"The collection can contain entities that are read-only, as well as entities "
+"that are not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:624
+#, no-c-format
+msgid ""
+"Entities can be added and removed from the collection; changes are flushed "
+"to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:629
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will update the version due to "
+"changes in the collection if they dirty the owning entity."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:640
+#, no-c-format
+msgid "Bidirectional associations"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:643
+#, no-c-format
+msgid "<title>Bidirectional one-to-one</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:645
+#, no-c-format
+msgid "If a read-only entity owns a bidirectional one-to-one association:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:652
+#, no-c-format
+msgid "Hibernate does not dirty-check the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:657
+#, no-c-format
+msgid ""
+"updates that change the association reference to null or to refer to a "
+"different entity will not be flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:664
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will not increment the version "
+"due to local changes to the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:673
+#, no-c-format
+msgid ""
+"If an entity is of an immutable class, and it owns a bidirectional one-to-"
+"one association, then its reference must be assigned when that entity is "
+"first created. Because the entity is automatically made read-only, these "
+"references cannot be updated."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:683
+#, no-c-format
+msgid ""
+"When the owner is not read-only, Hibernate treats an association with a read-"
+"only entity the same as when the association is with an entity that is not "
+"read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:693
+#, no-c-format
+msgid "<title>Bidirectional one-to-many/many-to-one</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:695
+#, no-c-format
+msgid ""
+"A read-only entity has no impact on a bidirectional one-to-many/many-to-one "
+"association if:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:702
+#, no-c-format
+msgid ""
+"the read-only entity is on the one-to-many side using an inverse collection;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:708
+#, no-c-format
+msgid ""
+"the read-only entity is on the one-to-many side using a non-inverse "
+"collection;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:714
+#, no-c-format
+msgid ""
+"the one-to-many side uses a non-inverse collection that contains the read-"
+"only entity"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:721
+#, no-c-format
+msgid "When the one-to-many side uses an inverse collection:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:727
+#, no-c-format
+msgid ""
+"a read-only entity can only be added to the collection when it is created;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:733
+#, no-c-format
+msgid ""
+"a read-only entity can only be removed from the collection by an orphan "
+"delete or by explicitly deleting the entity."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:744
+#, no-c-format
+msgid "<title>Bidirectional many-to-many</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:745
+#, no-c-format
+msgid ""
+"Hibernate treats bidirectional many-to-many associations owned by a read-"
+"only entity the same as when owned by an entity that is not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:752
+#, no-c-format
+msgid "Hibernate dirty-checks bidirectional many-to-many associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:757
+#, no-c-format
+msgid ""
+"The collection on either side of the association can contain entities that "
+"are read-only, as well as entities that are not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:763
+#, no-c-format
+msgid ""
+"Entities are added and removed from both sides of the collection; changes "
+"are flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:769
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will update the version due to "
+"changes in both sides of the collection if they dirty the entity owning the "
+"respective collections."
+msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/ja-JP/content/portability.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ja-JP/content/portability.po 2010-03-24 22:47:51 UTC (rev 19111)
+++ core/trunk/documentation/manual/src/main/docbook/ja-JP/content/portability.po 2010-03-25 06:51:01 UTC (rev 19112)
@@ -4,7 +4,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:47\n"
+"POT-Creation-Date: 2010-03-25 06:26+0000\n"
"PO-Revision-Date: 2010-01-20 17:03+1000\n"
"Last-Translator: Xi HUANG <xhuang(a)redhat.com>\n"
"Language-Team: <en(a)li.org>\n"
@@ -14,16 +14,19 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: portability.xml:31
#, no-c-format
msgid "Database Portability Considerations"
msgstr ""
#. Tag: title
+#: portability.xml:34
#, no-c-format
msgid "Portability Basics"
msgstr ""
#. Tag: para
+#: portability.xml:36
#, no-c-format
msgid ""
"One of the selling points of Hibernate (and really Object/Relational Mapping "
@@ -37,11 +40,13 @@
msgstr ""
#. Tag: title
+#: portability.xml:47
#, no-c-format
msgid "Dialect"
msgstr ""
#. Tag: para
+#: portability.xml:49
#, no-c-format
msgid ""
"The first line of portability for Hibernate is the dialect, which is a "
@@ -55,11 +60,13 @@
msgstr ""
#. Tag: title
+#: portability.xml:60
#, no-c-format
msgid "Dialect resolution"
msgstr ""
#. Tag: para
+#: portability.xml:62
#, no-c-format
msgid ""
"Originally, Hibernate would always require that users specify which dialect "
@@ -70,6 +77,7 @@
msgstr ""
#. Tag: para
+#: portability.xml:69
#, no-c-format
msgid ""
"Starting with version 3.2, Hibernate introduced the notion of automatically "
@@ -81,26 +89,28 @@
msgstr ""
#. Tag: para
+#: portability.xml:77
#, no-c-format
msgid ""
"Starting with version 3.3, Hibernate has a fare more powerful way to "
"automatically determine which dialect to should be used by relying on a "
"series of delegates which implement the <interfacename>org.hibernate.dialect."
"resolver.DialectResolver</interfacename> which defines only a single method:"
-"<programlisting role=\"JAVA\">public Dialect resolveDialect(DatabaseMetaData "
-"metaData) throws JDBCConnectionException</programlisting>. The basic "
-"contract here is that if the resolver 'understands' the given database "
-"metadata then it returns the corresponding Dialect; if not it returns null "
-"and the process continues to the next resolver. The signature also "
-"identifies <exceptionname>org.hibernate.exception.JDBCConnectionException</"
-"exceptionname> as possibly being thrown. A JDBCConnectionException here is "
-"interpreted to imply a \"non transient\" (aka non-recoverable) connection "
-"problem and is used to indicate an immediate stop to resolution attempts. "
-"All other exceptions result in a warning and continuing on to the next "
-"resolver."
+"<programlisting role=\"JAVA\"><![CDATA[public Dialect resolveDialect"
+"(DatabaseMetaData metaData) throws JDBCConnectionException]]></"
+"programlisting>. The basic contract here is that if the resolver "
+"'understands' the given database metadata then it returns the corresponding "
+"Dialect; if not it returns null and the process continues to the next "
+"resolver. The signature also identifies <exceptionname>org.hibernate."
+"exception.JDBCConnectionException</exceptionname> as possibly being thrown. "
+"A JDBCConnectionException here is interpreted to imply a \"non transient"
+"\" (aka non-recoverable) connection problem and is used to indicate an "
+"immediate stop to resolution attempts. All other exceptions result in a "
+"warning and continuing on to the next resolver."
msgstr ""
#. Tag: para
+#: portability.xml:90
#, no-c-format
msgid ""
"The cool part about these resolvers is that users can also register their "
@@ -116,11 +126,13 @@
msgstr ""
#. Tag: title
+#: portability.xml:103
#, no-c-format
msgid "Identifier generation"
msgstr ""
#. Tag: para
+#: portability.xml:105
#, no-c-format
msgid ""
"When considering portability between databases, another important decision "
@@ -139,64 +151,38 @@
"reference entities within a persistence context it must then issue the "
"insert immediately when the users requests the entitiy be associated with "
"the session (like via save() e.g.) regardless of current transactional "
-"semantics."
+"semantics. <note> <para> Hibernate was changed slightly once the implication "
+"of this was better understood so that the insert is delayed in cases where "
+"that is feasible. </para> </note> The underlying issue is that the actual "
+"semanctics of the application itself changes in these cases."
msgstr ""
#. Tag: para
+#: portability.xml:130
#, no-c-format
msgid ""
-"Hibernate was changed slightly once the implication of this was better "
-"understood so that the insert is delayed in cases where that is feasible."
-msgstr ""
-
-#. Tag: note
-#, no-c-format
-msgid ""
-"The underlying issue is that the actual semanctics of the application itself "
-"changes in these cases."
-msgstr ""
-
-#. Tag: para
-#, no-c-format
-msgid ""
"Starting with version 3.2.3, Hibernate comes with a set of <ulink url="
"\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier generators "
-"targetting portability in a much different way."
+"targetting portability in a much different way. <note> <para> There are "
+"specifically 2 bundled <emphasis>enhanced</emphasis>generators: "
+"<itemizedlist> <listitem> <para> <classname>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</classname> </para> </listitem> <listitem> <para> "
+"<classname>org.hibernate.id.enhanced.TableGenerator</classname> </para> </"
+"listitem> </itemizedlist> </para> </note> The idea behind these generators "
+"is to port the actual semantics of the identifer value generation to the "
+"different databases. For example, the <classname>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</classname> mimics the behavior of a sequence on "
+"databases which do not support sequences by using a table."
msgstr ""
-#. Tag: para
-#, no-c-format
-msgid ""
-"There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
-msgstr ""
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
-msgstr ""
-"<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
-msgstr "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
-
-#. Tag: note
-#, no-c-format
-msgid ""
-"The idea behind these generators is to port the actual semantics of the "
-"identifer value generation to the different databases. For example, the "
-"<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> "
-"mimics the behavior of a sequence on databases which do not support "
-"sequences by using a table."
-msgstr ""
-
#. Tag: title
+#: portability.xml:159
#, no-c-format
msgid "Database functions"
msgstr ""
#. Tag: para
+#: portability.xml:162
#, no-c-format
msgid ""
"This is an area in Hibernate in need of improvement. In terms of portability "
@@ -205,6 +191,7 @@
msgstr ""
#. Tag: para
+#: portability.xml:169
#, no-c-format
msgid ""
"SQL functions can be referenced in many ways by users. However, not all "
@@ -215,6 +202,7 @@
msgstr ""
#. Tag: para
+#: portability.xml:175
#, no-c-format
msgid ""
"Technically this function registration is handled through the <classname>org."
@@ -225,6 +213,7 @@
msgstr ""
#. Tag: para
+#: portability.xml:182
#, no-c-format
msgid ""
"It is sort of implemented such that users can programatically register "
@@ -233,11 +222,23 @@
msgstr ""
#. Tag: title
+#: portability.xml:192
#, no-c-format
msgid "Type mappings"
msgstr ""
#. Tag: para
+#: portability.xml:194
#, no-c-format
msgid "This section scheduled for completion at a later date..."
msgstr ""
+
+#, fuzzy
+#~ msgid ""
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
+#~ msgstr ""
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
+
+#, fuzzy
+#~ msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
+#~ msgstr "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
Added: core/trunk/documentation/manual/src/main/docbook/ja-JP/content/readonly.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ja-JP/content/readonly.po (rev 0)
+++ core/trunk/documentation/manual/src/main/docbook/ja-JP/content/readonly.po 2010-03-25 06:51:01 UTC (rev 19112)
@@ -0,0 +1,1124 @@
+# Language ja-JP translations for PACKAGE package.
+# Automatically generated, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-03-25 06:26+0000\n"
+"PO-Revision-Date: 2010-03-25 06:26+0000\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Tag: title
+#: readonly.xml:33
+#, no-c-format
+msgid "Read-only entities"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:36
+#, no-c-format
+msgid ""
+"Hibernate's treatment of <emphasis>read-only</emphasis> entities may differ "
+"from what you may have encountered elsewhere. Incorrect usage may cause "
+"unexpected results."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:43
+#, no-c-format
+msgid "When an entity is read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:48
+#, no-c-format
+msgid ""
+"Hibernate does not dirty-check the entity's simple properties or single-"
+"ended associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:54
+#, no-c-format
+msgid ""
+"Hibernate will not update simple properties or updatable single-ended "
+"associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:60
+#, no-c-format
+msgid ""
+"Hibernate will not update the version of the read-only entity if only simple "
+"properties or single-ended updatable associations are changed;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:69
+#, no-c-format
+msgid ""
+"In some ways, Hibernate treats read-only entities the same as entities that "
+"are not read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:75
+#, no-c-format
+msgid ""
+"Hibernate cascades operations to associations as defined in the entity "
+"mapping."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:81
+#, no-c-format
+msgid ""
+"Hibernate updates the version if the entity has a collection with changes "
+"that dirties the entity;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:87
+#, no-c-format
+msgid "A read-only entity can be deleted."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:94
+#, no-c-format
+msgid ""
+"Even if an entity is not read-only, its collection association can be "
+"affected if it contains a read-only entity."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:99
+#, no-c-format
+msgid ""
+"For details about the affect of read-only entities on different property and "
+"association types, see <xref linkend=\"readonly-proptypes\"/>."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:105
+#, no-c-format
+msgid "For details about how to make entities read-only, see"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:110
+#, no-c-format
+msgid "Hibernate does some optimizing for read-only entities:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:115
+#, no-c-format
+msgid ""
+"It saves execution time by not dirty-checking simple properties or single-"
+"ended associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:121
+#, no-c-format
+msgid "It saves memory by deleting database snapshots."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:128
+#, no-c-format
+msgid "Making persistent entities read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:130
+#, no-c-format
+msgid ""
+"Only persistent entities can be made read-only. Transient and detached "
+"entities must be put in persistent state before they can be made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:136
+#, no-c-format
+msgid ""
+"Hibernate provides the following ways to make persistent entities read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:142
+#, no-c-format
+msgid ""
+"you can map an entity class as <emphasis>immutable</emphasis>; when an "
+"entity of an immutable class is made persistent, Hibernate automatically "
+"makes it read-only. see <xref linkend=\"readonly-api-immutable\"/> for "
+"details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:150
+#, no-c-format
+msgid ""
+"you can change a default so that entities loaded into the session by "
+"Hibernate are automatically made read-only; see <xref linkend=\"readonly-api-"
+"loaddefault\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:157
+#, no-c-format
+msgid ""
+"you can make an HQL query or criteria read-only so that entities loaded when "
+"the query or criteria executes, scrolls, or iterates, are automatically made "
+"read-only; see <xref linkend=\"readonly-api-querycriteria\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:165
+#, no-c-format
+msgid ""
+"you can make a persistent entity that is already in the in the session read-"
+"only; see <xref linkend=\"readonly-api-entity\"/> for details"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:174
+#, no-c-format
+msgid "Entities of immutable classes"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:176
+#, no-c-format
+msgid ""
+"When an entity instance of an immutable class is made persistent, Hibernate "
+"automatically makes it read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:180
+#, no-c-format
+msgid ""
+"An entity of an immutable class can created and deleted the same as an "
+"entity of a mutable class."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:185
+#, no-c-format
+msgid ""
+"Hibernate treats a persistent entity of an immutable class the same way as a "
+"read-only persistent entity of a mutable class. The only exception is that "
+"Hibernate will not allow an entity of an immutable class to be changed so it "
+"is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:196
+#, no-c-format
+msgid "Loading persistent entities as read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:199 readonly.xml:286
+#, no-c-format
+msgid "Entities of immutable classes are automatically loaded as read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:205
+#, no-c-format
+msgid ""
+"To change the default behavior so Hibernate loads entity instances of "
+"mutable classes into the session and automatically makes them read-only, "
+"call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:210
+#, no-c-format
+msgid "Session.setDefaultReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:212
+#, no-c-format
+msgid ""
+"To change the default back so entities loaded by Hibernate are not made read-"
+"only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:216
+#, no-c-format
+msgid "Session.setDefaultReadOnly( false );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:218
+#, no-c-format
+msgid "You can determine the current setting by calling:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:221
+#, no-c-format
+msgid "Session.isDefaultReadOnly();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:223
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns true, entities loaded by the "
+"following are automatically made read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:229
+#, no-c-format
+msgid "Session.load()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:234
+#, no-c-format
+msgid "Session.get()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:239
+#, no-c-format
+msgid "Session.merge()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:244
+#, no-c-format
+msgid ""
+"executing, scrolling, or iterating HQL queries and criteria; to override "
+"this setting for a particular HQL query or criteria see"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:253
+#, no-c-format
+msgid "Changing this default has no effect on:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:258
+#, no-c-format
+msgid "persistent entities already in the session when the default was changed"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:264
+#, no-c-format
+msgid ""
+"persistent entities that are refreshed via Session.refresh(); a refreshed "
+"persistent entity will only be read-only if it was read-only before "
+"refreshing"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:272
+#, no-c-format
+msgid ""
+"persistent entities added by the application via Session.persist(), Session."
+"save(), and Session.update() Session.saveOrUpdate()"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:283
+#, no-c-format
+msgid "Loading read-only entities from an HQL query/criteria"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:292
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns false (the default) when an HQL query "
+"or criteria executes, then entities and proxies of mutable classes loaded by "
+"the query will not be read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:299
+#, no-c-format
+msgid ""
+"You can override this behavior so that entities and proxies loaded by an HQL "
+"query or criteria are automatically made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:304
+#, no-c-format
+msgid "For an HQL query, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:307
+#, no-c-format
+msgid "Query.setReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:309
+#, no-c-format
+msgid ""
+"<literal>Query.setReadOnly( true )</literal> must be called before "
+"<literal>Query.list()</literal>, <literal>Query.uniqueResult()</literal>, "
+"<literal>Query.scroll()</literal>, or <literal>Query.iterate()</literal>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:315
+#, no-c-format
+msgid "For an HQL criteria, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:318
+#, no-c-format
+msgid "Criteria.setReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:320
+#, no-c-format
+msgid ""
+"<literal>Criteria.setReadOnly( true )</literal> must be called before "
+"<literal>Criteria.list()</literal>, <literal>Criteria.uniqueResult()</"
+"literal>, or <literal>Criteria.scroll()</literal>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:326
+#, no-c-format
+msgid ""
+"Entities and proxies that exist in the session before being returned by an "
+"HQL query or criteria are not affected."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:331
+#, no-c-format
+msgid ""
+"Uninitialized persistent collections returned by the query are not affected. "
+"Later, when the collection is initialized, entities loaded into the session "
+"will be read-only if Session.isDefaultReadOnly() returns true."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:338
+#, no-c-format
+msgid ""
+"Using <literal>Query.setReadOnly( true )</literal> or <literal>Criteria."
+"setReadOnly( true )</literal> works well when a single HQL query or criteria "
+"loads all the entities and intializes all the proxies and collections that "
+"the application needs to be read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:346
+#, no-c-format
+msgid ""
+"When it is not possible to load and initialize all necessary entities in a "
+"single query or criteria, you can temporarily change the session default to "
+"load entities as read-only before the query is executed. Then you can "
+"explicitly initialize proxies and collections before restoring the session "
+"default."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:355
+#, no-c-format
+msgid ""
+"Session session = factory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+" \n"
+"setDefaultReadOnly( true );\n"
+"Contract contract = \n"
+" ( Contract ) session.createQuery(\n"
+" \"from Contract where customerName = 'Sherman'\" )\n"
+" .uniqueResult();\n"
+"Hibernate.initialize( contract.getPlan() );\n"
+"Hibernate.initialize( contract.getVariations() );\n"
+"Hibernate.initialize( contract.getNotes() );\n"
+"setDefaultReadOnly( false );\n"
+"...\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:357
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns true, then you can use Query."
+"setReadOnly( false ) and Criteria.setReadOnly( false ) to override this "
+"session setting and load entities that are not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:367
+#, no-c-format
+msgid "Making a persistent entity read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:369
+#, no-c-format
+msgid ""
+"Persistent entities of immutable classes are automatically made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:375
+#, no-c-format
+msgid "To make a persistent entity or proxy read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:378
+#, no-c-format
+msgid "Session.setReadOnly(entityOrProxy, true)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:380
+#, no-c-format
+msgid ""
+"To change a read-only entity or proxy of a mutable class so it is no longer "
+"read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:384
+#, no-c-format
+msgid "Session.setReadOnly(entityOrProxy, false)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:387
+#, no-c-format
+msgid ""
+"When a read-only entity or proxy is changed so it is no longer read-only, "
+"Hibernate assumes that the current state of the read-only entity is "
+"consistent with its database representation. If this is not true, then any "
+"non-flushed changes made before or while the entity was read-only, will be "
+"ignored."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:396
+#, no-c-format
+msgid ""
+"To throw away non-flushed changes and make the persistent entity consistent "
+"with its database representation, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:400
+#, no-c-format
+msgid "session.refresh( entity );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:402
+#, no-c-format
+msgid ""
+"To flush changes made before or while the entity was read-only and make the "
+"database representation consistent with the current state of the persistent "
+"entity:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:408
+#, no-c-format
+msgid ""
+"// evict the read-only entity so it is detached\n"
+"session.evict( entity );\n"
+"\n"
+"// make the detached entity (with the non-flushed changes) persistent\n"
+"session.update( entity );\n"
+"\n"
+"// now entity is no longer read-only and its changes can be flushed\n"
+"s.flush();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:413
+#, no-c-format
+msgid "Read-only affect on property type"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:415
+#, no-c-format
+msgid ""
+"The following table summarizes how different property types are affected by "
+"making an entity read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:421
+#, no-c-format
+msgid "Affect of read-only entity on property types"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:427
+#, no-c-format
+msgid "Property/Association Type"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:428
+#, no-c-format
+msgid "Changes flushed to DB?"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:433
+#, no-c-format
+msgid "Simple"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:435
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-simple\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:439
+#, no-c-format
+msgid "<entry>no*</entry>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:443
+#, no-c-format
+msgid "Unidirectional one-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:444
+#, no-c-format
+msgid "Unidirectional many-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:445
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-singleended-unidir\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:451 readonly.xml:452
+#, no-c-format
+msgid "<para>no*</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:457
+#, no-c-format
+msgid "Unidirectional one-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:458
+#, no-c-format
+msgid "Unidirectional many-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:459
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-manyended-unidir\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:464 readonly.xml:465 readonly.xml:489
+#, no-c-format
+msgid "<para>yes</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:470
+#, no-c-format
+msgid "<para>Bidirectional one-to-one</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:471
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-onetoone-bidir\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:475
+#, no-c-format
+msgid "only if the owning entity is not read-only*"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:479
+#, no-c-format
+msgid "<para>Bidirectional one-to-many/many-to-one</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:480
+#, no-c-format
+msgid "inverse collection"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:481
+#, no-c-format
+msgid "non-inverse collection"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:482
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-onetomany-manytoone\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:488
+#, no-c-format
+msgid "only added/removed entities that are not read-only*"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:494
+#, no-c-format
+msgid "<para>Bidirectional many-to-many</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:495
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-manytomany-bidir\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:499
+#, no-c-format
+msgid "<entry>yes</entry>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:505
+#, no-c-format
+msgid ""
+"* Behavior is different when the entity having the property/association is "
+"read-only, compared to when it is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:511
+#, no-c-format
+msgid "Simple properties"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:513
+#, no-c-format
+msgid ""
+"When a persistent object is read-only, Hibernate does not dirty-check simple "
+"properties."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:518
+#, no-c-format
+msgid ""
+"Hibernate will not synchronize simple property state changes to the "
+"database. If you have automatic versioning, Hibernate will not increment the "
+"version if any simple properties change."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:524
+#, no-c-format
+msgid ""
+"Session session = factory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+"\n"
+"// get a contract and make it read-only\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"\n"
+"// contract.getCustomerName() is \"Sherman\"\n"
+"contract.setCustomerName( \"Yogi\" );\n"
+"tx.commit();\n"
+"\n"
+"tx = session.beginTransaction();\n"
+"\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"// contract.getCustomerName() is still \"Sherman\"\n"
+"...\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:529
+#, no-c-format
+msgid "Unidirectional associations"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:532
+#, no-c-format
+msgid "Unidirectional one-to-one and many-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:534
+#, no-c-format
+msgid ""
+"Hibernate treats unidirectional one-to-one and many-to-one associations in "
+"the same way when the owning entity is read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:540
+#, no-c-format
+msgid ""
+"We use the term <emphasis>unidirectional single-ended association</emphasis> "
+"when referring to functionality that is common to unidirectional one-to-one "
+"and many-to-one associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:547
+#, no-c-format
+msgid ""
+"Hibernate does not dirty-check unidirectional single-ended associations when "
+"the owning entity is read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:552
+#, no-c-format
+msgid ""
+"If you change a read-only entity's reference to a unidirectional single-"
+"ended association to null, or to refer to a different entity, that change "
+"will not be flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:560
+#, no-c-format
+msgid ""
+"If an entity is of an immutable class, then its references to unidirectional "
+"single-ended associations must be assigned when that entity is first "
+"created. Because the entity is automatically made read-only, these "
+"references can not be updated."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:570
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will not increment the version "
+"due to local changes to unidirectional single-ended associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:576
+#, no-c-format
+msgid ""
+"In the following examples, Contract has a unidirectional many-to-one "
+"association with Plan. Contract cascades save and update operations to the "
+"association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:582
+#, no-c-format
+msgid ""
+"The following shows that changing a read-only entity's many-to-one "
+"association reference to null has no effect on the entity's database "
+"representation."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:588
+#, no-c-format
+msgid ""
+"// get a contract with an existing plan;\n"
+"// make the contract read-only and set its plan to null \n"
+"tx = session.beginTransaction();\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"contract.setPlan( null );\n"
+"tx.commit();\n"
+"\n"
+"// get the same contract\n"
+"tx = session.beginTransaction();\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"\n"
+"// contract.getPlan() still refers to the original plan;\n"
+"\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:590
+#, no-c-format
+msgid ""
+"The following shows that, even though an update to a read-only entity's many-"
+"to-one association has no affect on the entity's database representation, "
+"flush still cascades the save-update operation to the locally changed "
+"association."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:599
+#, no-c-format
+msgid ""
+"// get a contract with an existing plan;\n"
+"// make the contract read-only and change to a new plan\n"
+"tx = session.beginTransaction();\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"Plan newPlan = new Plan( \"new plan\"\n"
+"contract.setPlan( newPlan);\n"
+"tx.commit();\n"
+"\n"
+"// get the same contract\n"
+"tx = session.beginTransaction();\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"newPlan = ( Contract ) session.get( Plan.class, newPlan.getId() ); \n"
+"\n"
+"// contract.getPlan() still refers to the original plan;\n"
+"// newPlan is non-null because it was persisted when \n"
+"// the previous transaction was committed; \n"
+"\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:604
+#, no-c-format
+msgid "Unidirectional one-to-many and many-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:606
+#, no-c-format
+msgid ""
+"Hibernate treats unidirectional one-to-many and many-to-many associations "
+"owned by a read-only entity the same as when owned by an entity that is not "
+"read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:613
+#, no-c-format
+msgid ""
+"Hibernate dirty-checks unidirectional one-to-many and many-to-many "
+"associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:618
+#, no-c-format
+msgid ""
+"The collection can contain entities that are read-only, as well as entities "
+"that are not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:624
+#, no-c-format
+msgid ""
+"Entities can be added and removed from the collection; changes are flushed "
+"to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:629
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will update the version due to "
+"changes in the collection if they dirty the owning entity."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:640
+#, no-c-format
+msgid "Bidirectional associations"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:643
+#, no-c-format
+msgid "<title>Bidirectional one-to-one</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:645
+#, no-c-format
+msgid "If a read-only entity owns a bidirectional one-to-one association:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:652
+#, no-c-format
+msgid "Hibernate does not dirty-check the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:657
+#, no-c-format
+msgid ""
+"updates that change the association reference to null or to refer to a "
+"different entity will not be flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:664
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will not increment the version "
+"due to local changes to the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:673
+#, no-c-format
+msgid ""
+"If an entity is of an immutable class, and it owns a bidirectional one-to-"
+"one association, then its reference must be assigned when that entity is "
+"first created. Because the entity is automatically made read-only, these "
+"references cannot be updated."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:683
+#, no-c-format
+msgid ""
+"When the owner is not read-only, Hibernate treats an association with a read-"
+"only entity the same as when the association is with an entity that is not "
+"read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:693
+#, no-c-format
+msgid "<title>Bidirectional one-to-many/many-to-one</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:695
+#, no-c-format
+msgid ""
+"A read-only entity has no impact on a bidirectional one-to-many/many-to-one "
+"association if:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:702
+#, no-c-format
+msgid ""
+"the read-only entity is on the one-to-many side using an inverse collection;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:708
+#, no-c-format
+msgid ""
+"the read-only entity is on the one-to-many side using a non-inverse "
+"collection;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:714
+#, no-c-format
+msgid ""
+"the one-to-many side uses a non-inverse collection that contains the read-"
+"only entity"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:721
+#, no-c-format
+msgid "When the one-to-many side uses an inverse collection:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:727
+#, no-c-format
+msgid ""
+"a read-only entity can only be added to the collection when it is created;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:733
+#, no-c-format
+msgid ""
+"a read-only entity can only be removed from the collection by an orphan "
+"delete or by explicitly deleting the entity."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:744
+#, no-c-format
+msgid "<title>Bidirectional many-to-many</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:745
+#, no-c-format
+msgid ""
+"Hibernate treats bidirectional many-to-many associations owned by a read-"
+"only entity the same as when owned by an entity that is not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:752
+#, no-c-format
+msgid "Hibernate dirty-checks bidirectional many-to-many associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:757
+#, no-c-format
+msgid ""
+"The collection on either side of the association can contain entities that "
+"are read-only, as well as entities that are not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:763
+#, no-c-format
+msgid ""
+"Entities are added and removed from both sides of the collection; changes "
+"are flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:769
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will update the version due to "
+"changes in both sides of the collection if they dirty the entity owning the "
+"respective collections."
+msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/pot/content/portability.pot
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pot/content/portability.pot 2010-03-24 22:47:51 UTC (rev 19111)
+++ core/trunk/documentation/manual/src/main/docbook/pot/content/portability.pot 2010-03-25 06:51:01 UTC (rev 19112)
@@ -1,143 +1,135 @@
-#
-# AUTHOR <EMAIL@ADDRESS>, YEAR.
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0\n"
-"POT-Creation-Date: 2010-02-11T05:38:15\n"
-"PO-Revision-Date: 2010-02-11T05:38:15\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: None\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-03-25 06:26+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc(a)kde.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: application/x-publican; charset=UTF-8\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Tag: title
+#: portability.xml:31
#, no-c-format
msgid "Database Portability Considerations"
msgstr ""
#. Tag: title
+#: portability.xml:34
#, no-c-format
msgid "Portability Basics"
msgstr ""
#. Tag: para
+#: portability.xml:36
#, no-c-format
msgid "One of the selling points of Hibernate (and really Object/Relational Mapping as a whole) is the notion of database portability. This could mean an internal IT user migrating from one database vendor to another, or it could mean a framework or deployable application consuming Hibernate to simultaneously target multiple database products by their users. Regardless of the exact scenario, the basic idea is that you want Hibernate to help you run against any number of databases without changes to your code, and ideally without any changes to the mapping metadata."
msgstr ""
#. Tag: title
+#: portability.xml:47
#, no-c-format
msgid "Dialect"
msgstr ""
#. Tag: para
+#: portability.xml:49
#, no-c-format
msgid "The first line of portability for Hibernate is the dialect, which is a specialization of the <classname>org.hibernate.dialect.Dialect</classname> contract. A dialect encapsulates all the differences in how Hibernate must communicate with a particular database to accomplish some task like getting a sequence value or structuring a SELECT query. Hibernate bundles a wide range of dialects for many of the most popular databases. If you find that your particular database is not among them, it is not terribly difficult to write your own."
msgstr ""
#. Tag: title
+#: portability.xml:60
#, no-c-format
msgid "Dialect resolution"
msgstr ""
#. Tag: para
+#: portability.xml:62
#, no-c-format
msgid "Originally, Hibernate would always require that users specify which dialect to use. In the case of users looking to simultaneously target multiple databases with their build that was problematic. Generally this required their users to configure the Hibernate dialect or defining their own method of setting that value."
msgstr ""
#. Tag: para
+#: portability.xml:69
#, no-c-format
msgid "Starting with version 3.2, Hibernate introduced the notion of automatically detecting the dialect to use based on the <interfacename>java.sql.DatabaseMetaData</interfacename> obtained from a <interfacename>java.sql.Connection</interfacename> to that database. This was much better, expect that this resolution was limited to databases Hibernate know about ahead of time and was in no way configurable or overrideable."
msgstr ""
#. Tag: para
+#: portability.xml:77
#, no-c-format
-msgid "Starting with version 3.3, Hibernate has a fare more powerful way to automatically determine which dialect to should be used by relying on a series of delegates which implement the <interfacename>org.hibernate.dialect.resolver.DialectResolver</interfacename> which defines only a single method:<programlisting role=\"JAVA\">public Dialect resolveDialect(DatabaseMetaData metaData) throws JDBCConnectionException</programlisting>. The basic contract here is that if the resolver 'understands' the given database metadata then it returns the corresponding Dialect; if not it returns null and the process continues to the next resolver. The signature also identifies <exceptionname>org.hibernate.exception.JDBCConnectionException</exceptionname> as possibly being thrown. A JDBCConnectionException here is interpreted to imply a \"non transient\" (aka non-recoverable) connection problem and is used to indicate an immediate stop to resolution attempts. All other exceptions result in!
a warning and continuing on to the next resolver."
+msgid "Starting with version 3.3, Hibernate has a fare more powerful way to automatically determine which dialect to should be used by relying on a series of delegates which implement the <interfacename>org.hibernate.dialect.resolver.DialectResolver</interfacename> which defines only a single method:<programlisting role=\"JAVA\"><![CDATA[public Dialect resolveDialect(DatabaseMetaData metaData) throws JDBCConnectionException]]></programlisting>. The basic contract here is that if the resolver 'understands' the given database metadata then it returns the corresponding Dialect; if not it returns null and the process continues to the next resolver. The signature also identifies <exceptionname>org.hibernate.exception.JDBCConnectionException</exceptionname> as possibly being thrown. A JDBCConnectionException here is interpreted to imply a \"non transient\" (aka non-recoverable) connection problem and is used to indicate an immediate stop to resolution attempts. All other exceptio!
ns result in a warning and continuing on to the next resolver."
msgstr ""
#. Tag: para
+#: portability.xml:90
#, no-c-format
msgid "The cool part about these resolvers is that users can also register their own custom resolvers which will be processed ahead of the built-in Hibernate ones. This might be useful in a number of different situations: it allows easy integration for auto-detection of dialects beyond those shipped with HIbernate itself; it allows you to specify to use a custom dialect when a particular database is recognized; etc. To register one or more resolvers, simply specify them (seperated by commas, tabs or spaces) using the 'hibernate.dialect_resolvers' configuration setting (see the <constant>DIALECT_RESOLVERS</constant> constant on <classname>org.hibernate.cfg.Environment</classname>)."
msgstr ""
#. Tag: title
+#: portability.xml:103
#, no-c-format
msgid "Identifier generation"
msgstr ""
#. Tag: para
+#: portability.xml:105
#, no-c-format
-msgid "When considering portability between databases, another important decision is selecting the identifier generation stratagy you want to use. Originally Hibernate provided the <emphasis>native</emphasis> generator for this purpose, which was intended to select between a <emphasis>sequence</emphasis>, <emphasis>identity</emphasis>, or <emphasis>table</emphasis> strategy depending on the capability of the underlying database. However, an insidious implication of this approach comes about when targtetting some databases which support <emphasis>identity</emphasis> generation and some which do not. <emphasis>identity</emphasis> generation relies on the SQL definition of an IDENTITY (or auto-increment) column to manage the identifier value; it is what is known as a post-insert generation strategy becauase the insert must actually happen before we can know the identifier value. Because Hibernate relies on this identifier value to uniquely reference entities within a persisten!
ce context it must then issue the insert immediately when the users requests the entitiy be associated with the session (like via save() e.g.) regardless of current transactional semantics."
+msgid "When considering portability between databases, another important decision is selecting the identifier generation stratagy you want to use. Originally Hibernate provided the <emphasis>native</emphasis> generator for this purpose, which was intended to select between a <emphasis>sequence</emphasis>, <emphasis>identity</emphasis>, or <emphasis>table</emphasis> strategy depending on the capability of the underlying database. However, an insidious implication of this approach comes about when targtetting some databases which support <emphasis>identity</emphasis> generation and some which do not. <emphasis>identity</emphasis> generation relies on the SQL definition of an IDENTITY (or auto-increment) column to manage the identifier value; it is what is known as a post-insert generation strategy becauase the insert must actually happen before we can know the identifier value. Because Hibernate relies on this identifier value to uniquely reference entities within a persisten!
ce context it must then issue the insert immediately when the users requests the entitiy be associated with the session (like via save() e.g.) regardless of current transactional semantics. <note> <para> Hibernate was changed slightly once the implication of this was better understood so that the insert is delayed in cases where that is feasible. </para> </note> The underlying issue is that the actual semanctics of the application itself changes in these cases."
msgstr ""
#. Tag: para
+#: portability.xml:130
#, no-c-format
-msgid "Hibernate was changed slightly once the implication of this was better understood so that the insert is delayed in cases where that is feasible."
+msgid "Starting with version 3.2.3, Hibernate comes with a set of <ulink url=\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier generators targetting portability in a much different way. <note> <para> There are specifically 2 bundled <emphasis>enhanced</emphasis>generators: <itemizedlist> <listitem> <para> <classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> </para> </listitem> <listitem> <para> <classname>org.hibernate.id.enhanced.TableGenerator</classname> </para> </listitem> </itemizedlist> </para> </note> The idea behind these generators is to port the actual semantics of the identifer value generation to the different databases. For example, the <classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> mimics the behavior of a sequence on databases which do not support sequences by using a table."
msgstr ""
-#. Tag: note
-#, no-c-format
-msgid "The underlying issue is that the actual semanctics of the application itself changes in these cases."
-msgstr ""
-
-#. Tag: para
-#, no-c-format
-msgid "Starting with version 3.2.3, Hibernate comes with a set of <ulink url=\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier generators targetting portability in a much different way."
-msgstr ""
-
-#. Tag: para
-#, no-c-format
-msgid "There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
-msgstr ""
-
-#. Tag: para
-#, no-c-format
-msgid "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
-msgstr ""
-
-#. Tag: para
-#, no-c-format
-msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
-msgstr ""
-
-#. Tag: note
-#, no-c-format
-msgid "The idea behind these generators is to port the actual semantics of the identifer value generation to the different databases. For example, the <classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> mimics the behavior of a sequence on databases which do not support sequences by using a table."
-msgstr ""
-
#. Tag: title
+#: portability.xml:159
#, no-c-format
msgid "Database functions"
msgstr ""
#. Tag: para
+#: portability.xml:162
#, no-c-format
msgid "This is an area in Hibernate in need of improvement. In terms of portability concerns, this function handling currently works pretty well from HQL; however, it is quite lacking in all other aspects."
msgstr ""
#. Tag: para
+#: portability.xml:169
#, no-c-format
-msgid "SQL functions can be referenced in many ways by users. However, not all databases support the same set of functions. Hibernate, provides a means of mapping a <emphasis>logical</emphasis> function name to a a delegate which knows how to render that particular function, perhaps even using a totally different physical function call."
+msgid "SQL functions can be referenced in many ways by users. However, not all databases support the same set of functions. Hibernate, provides a means of mapping a <emphasis>logical</emphasis> function name to a delegate which knows how to render that particular function, perhaps even using a totally different physical function call."
msgstr ""
#. Tag: para
+#: portability.xml:175
#, no-c-format
msgid "Technically this function registration is handled through the <classname>org.hibernate.dialect.function.SQLFunctionRegistry</classname> class which is intended to allow users to provide custom function definitions without having to provide a custom dialect. This specific behavior is not fully completed as of yet."
msgstr ""
#. Tag: para
+#: portability.xml:182
#, no-c-format
msgid "It is sort of implemented such that users can programatically register functions with the <classname>org.hibernate.cfg.Configuration</classname> and those functions will be recognized for HQL."
msgstr ""
#. Tag: title
+#: portability.xml:192
#, no-c-format
msgid "Type mappings"
msgstr ""
#. Tag: para
+#: portability.xml:194
#, no-c-format
msgid "This section scheduled for completion at a later date..."
msgstr ""
Added: core/trunk/documentation/manual/src/main/docbook/pot/content/readonly.pot
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pot/content/readonly.pot (rev 0)
+++ core/trunk/documentation/manual/src/main/docbook/pot/content/readonly.pot 2010-03-25 06:51:01 UTC (rev 19112)
@@ -0,0 +1,951 @@
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-03-25 06:26+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc(a)kde.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Tag: title
+#: readonly.xml:33
+#, no-c-format
+msgid "Read-only entities"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:36
+#, no-c-format
+msgid "Hibernate's treatment of <emphasis>read-only</emphasis> entities may differ from what you may have encountered elsewhere. Incorrect usage may cause unexpected results."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:43
+#, no-c-format
+msgid "When an entity is read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:48
+#, no-c-format
+msgid "Hibernate does not dirty-check the entity's simple properties or single-ended associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:54
+#, no-c-format
+msgid "Hibernate will not update simple properties or updatable single-ended associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:60
+#, no-c-format
+msgid "Hibernate will not update the version of the read-only entity if only simple properties or single-ended updatable associations are changed;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:69
+#, no-c-format
+msgid "In some ways, Hibernate treats read-only entities the same as entities that are not read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:75
+#, no-c-format
+msgid "Hibernate cascades operations to associations as defined in the entity mapping."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:81
+#, no-c-format
+msgid "Hibernate updates the version if the entity has a collection with changes that dirties the entity;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:87
+#, no-c-format
+msgid "A read-only entity can be deleted."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:94
+#, no-c-format
+msgid "Even if an entity is not read-only, its collection association can be affected if it contains a read-only entity."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:99
+#, no-c-format
+msgid "For details about the affect of read-only entities on different property and association types, see <xref linkend=\"readonly-proptypes\"/>."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:105
+#, no-c-format
+msgid "For details about how to make entities read-only, see"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:110
+#, no-c-format
+msgid "Hibernate does some optimizing for read-only entities:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:115
+#, no-c-format
+msgid "It saves execution time by not dirty-checking simple properties or single-ended associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:121
+#, no-c-format
+msgid "It saves memory by deleting database snapshots."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:128
+#, no-c-format
+msgid "Making persistent entities read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:130
+#, no-c-format
+msgid "Only persistent entities can be made read-only. Transient and detached entities must be put in persistent state before they can be made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:136
+#, no-c-format
+msgid "Hibernate provides the following ways to make persistent entities read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:142
+#, no-c-format
+msgid "you can map an entity class as <emphasis>immutable</emphasis>; when an entity of an immutable class is made persistent, Hibernate automatically makes it read-only. see <xref linkend=\"readonly-api-immutable\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:150
+#, no-c-format
+msgid "you can change a default so that entities loaded into the session by Hibernate are automatically made read-only; see <xref linkend=\"readonly-api-loaddefault\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:157
+#, no-c-format
+msgid "you can make an HQL query or criteria read-only so that entities loaded when the query or criteria executes, scrolls, or iterates, are automatically made read-only; see <xref linkend=\"readonly-api-querycriteria\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:165
+#, no-c-format
+msgid "you can make a persistent entity that is already in the in the session read-only; see <xref linkend=\"readonly-api-entity\"/> for details"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:174
+#, no-c-format
+msgid "Entities of immutable classes"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:176
+#, no-c-format
+msgid "When an entity instance of an immutable class is made persistent, Hibernate automatically makes it read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:180
+#, no-c-format
+msgid "An entity of an immutable class can created and deleted the same as an entity of a mutable class."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:185
+#, no-c-format
+msgid "Hibernate treats a persistent entity of an immutable class the same way as a read-only persistent entity of a mutable class. The only exception is that Hibernate will not allow an entity of an immutable class to be changed so it is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:196
+#, no-c-format
+msgid "Loading persistent entities as read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:199 readonly.xml:286
+#, no-c-format
+msgid "Entities of immutable classes are automatically loaded as read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:205
+#, no-c-format
+msgid "To change the default behavior so Hibernate loads entity instances of mutable classes into the session and automatically makes them read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:210
+#, no-c-format
+msgid "Session.setDefaultReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:212
+#, no-c-format
+msgid "To change the default back so entities loaded by Hibernate are not made read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:216
+#, no-c-format
+msgid "Session.setDefaultReadOnly( false );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:218
+#, no-c-format
+msgid "You can determine the current setting by calling:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:221
+#, no-c-format
+msgid "Session.isDefaultReadOnly();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:223
+#, no-c-format
+msgid "If Session.isDefaultReadOnly() returns true, entities loaded by the following are automatically made read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:229
+#, no-c-format
+msgid "Session.load()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:234
+#, no-c-format
+msgid "Session.get()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:239
+#, no-c-format
+msgid "Session.merge()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:244
+#, no-c-format
+msgid "executing, scrolling, or iterating HQL queries and criteria; to override this setting for a particular HQL query or criteria see"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:253
+#, no-c-format
+msgid "Changing this default has no effect on:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:258
+#, no-c-format
+msgid "persistent entities already in the session when the default was changed"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:264
+#, no-c-format
+msgid "persistent entities that are refreshed via Session.refresh(); a refreshed persistent entity will only be read-only if it was read-only before refreshing"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:272
+#, no-c-format
+msgid "persistent entities added by the application via Session.persist(), Session.save(), and Session.update() Session.saveOrUpdate()"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:283
+#, no-c-format
+msgid "Loading read-only entities from an HQL query/criteria"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:292
+#, no-c-format
+msgid "If Session.isDefaultReadOnly() returns false (the default) when an HQL query or criteria executes, then entities and proxies of mutable classes loaded by the query will not be read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:299
+#, no-c-format
+msgid "You can override this behavior so that entities and proxies loaded by an HQL query or criteria are automatically made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:304
+#, no-c-format
+msgid "For an HQL query, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:307
+#, no-c-format
+msgid "Query.setReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:309
+#, no-c-format
+msgid "<literal>Query.setReadOnly( true )</literal> must be called before <literal>Query.list()</literal>, <literal>Query.uniqueResult()</literal>, <literal>Query.scroll()</literal>, or <literal>Query.iterate()</literal>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:315
+#, no-c-format
+msgid "For an HQL criteria, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:318
+#, no-c-format
+msgid "Criteria.setReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:320
+#, no-c-format
+msgid "<literal>Criteria.setReadOnly( true )</literal> must be called before <literal>Criteria.list()</literal>, <literal>Criteria.uniqueResult()</literal>, or <literal>Criteria.scroll()</literal>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:326
+#, no-c-format
+msgid "Entities and proxies that exist in the session before being returned by an HQL query or criteria are not affected."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:331
+#, no-c-format
+msgid "Uninitialized persistent collections returned by the query are not affected. Later, when the collection is initialized, entities loaded into the session will be read-only if Session.isDefaultReadOnly() returns true."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:338
+#, no-c-format
+msgid "Using <literal>Query.setReadOnly( true )</literal> or <literal>Criteria.setReadOnly( true )</literal> works well when a single HQL query or criteria loads all the entities and intializes all the proxies and collections that the application needs to be read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:346
+#, no-c-format
+msgid "When it is not possible to load and initialize all necessary entities in a single query or criteria, you can temporarily change the session default to load entities as read-only before the query is executed. Then you can explicitly initialize proxies and collections before restoring the session default."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:355
+#, no-c-format
+msgid ""
+ "Session session = factory.openSession();\n"
+ "Transaction tx = session.beginTransaction();\n"
+ " \n"
+ "setDefaultReadOnly( true );\n"
+ "Contract contract = \n"
+ " ( Contract ) session.createQuery(\n"
+ " \"from Contract where customerName = 'Sherman'\" )\n"
+ " .uniqueResult();\n"
+ "Hibernate.initialize( contract.getPlan() );\n"
+ "Hibernate.initialize( contract.getVariations() );\n"
+ "Hibernate.initialize( contract.getNotes() );\n"
+ "setDefaultReadOnly( false );\n"
+ "...\n"
+ "tx.commit();\n"
+ "session.close();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:357
+#, no-c-format
+msgid "If Session.isDefaultReadOnly() returns true, then you can use Query.setReadOnly( false ) and Criteria.setReadOnly( false ) to override this session setting and load entities that are not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:367
+#, no-c-format
+msgid "Making a persistent entity read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:369
+#, no-c-format
+msgid "Persistent entities of immutable classes are automatically made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:375
+#, no-c-format
+msgid "To make a persistent entity or proxy read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:378
+#, no-c-format
+msgid "Session.setReadOnly(entityOrProxy, true)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:380
+#, no-c-format
+msgid "To change a read-only entity or proxy of a mutable class so it is no longer read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:384
+#, no-c-format
+msgid "Session.setReadOnly(entityOrProxy, false)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:387
+#, no-c-format
+msgid "When a read-only entity or proxy is changed so it is no longer read-only, Hibernate assumes that the current state of the read-only entity is consistent with its database representation. If this is not true, then any non-flushed changes made before or while the entity was read-only, will be ignored."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:396
+#, no-c-format
+msgid "To throw away non-flushed changes and make the persistent entity consistent with its database representation, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:400
+#, no-c-format
+msgid "session.refresh( entity );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:402
+#, no-c-format
+msgid "To flush changes made before or while the entity was read-only and make the database representation consistent with the current state of the persistent entity:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:408
+#, no-c-format
+msgid ""
+ "// evict the read-only entity so it is detached\n"
+ "session.evict( entity );\n"
+ "\n"
+ "// make the detached entity (with the non-flushed changes) persistent\n"
+ "session.update( entity );\n"
+ "\n"
+ "// now entity is no longer read-only and its changes can be flushed\n"
+ "s.flush();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:413
+#, no-c-format
+msgid "Read-only affect on property type"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:415
+#, no-c-format
+msgid "The following table summarizes how different property types are affected by making an entity read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:421
+#, no-c-format
+msgid "Affect of read-only entity on property types"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:427
+#, no-c-format
+msgid "Property/Association Type"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:428
+#, no-c-format
+msgid "Changes flushed to DB?"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:433
+#, no-c-format
+msgid "Simple"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:435
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-simple\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:439
+#, no-c-format
+msgid "<entry>no*</entry>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:443
+#, no-c-format
+msgid "Unidirectional one-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:444
+#, no-c-format
+msgid "Unidirectional many-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:445
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-singleended-unidir\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:451 readonly.xml:452
+#, no-c-format
+msgid "<para>no*</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:457
+#, no-c-format
+msgid "Unidirectional one-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:458
+#, no-c-format
+msgid "Unidirectional many-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:459
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-manyended-unidir\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:464 readonly.xml:465 readonly.xml:489
+#, no-c-format
+msgid "<para>yes</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:470
+#, no-c-format
+msgid "<para>Bidirectional one-to-one</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:471
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-onetoone-bidir\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:475
+#, no-c-format
+msgid "only if the owning entity is not read-only*"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:479
+#, no-c-format
+msgid "<para>Bidirectional one-to-many/many-to-one</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:480
+#, no-c-format
+msgid "inverse collection"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:481
+#, no-c-format
+msgid "non-inverse collection"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:482
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-onetomany-manytoone\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:488
+#, no-c-format
+msgid "only added/removed entities that are not read-only*"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:494
+#, no-c-format
+msgid "<para>Bidirectional many-to-many</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:495
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-manytomany-bidir\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:499
+#, no-c-format
+msgid "<entry>yes</entry>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:505
+#, no-c-format
+msgid "* Behavior is different when the entity having the property/association is read-only, compared to when it is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:511
+#, no-c-format
+msgid "Simple properties"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:513
+#, no-c-format
+msgid "When a persistent object is read-only, Hibernate does not dirty-check simple properties."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:518
+#, no-c-format
+msgid "Hibernate will not synchronize simple property state changes to the database. If you have automatic versioning, Hibernate will not increment the version if any simple properties change."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:524
+#, no-c-format
+msgid ""
+ "Session session = factory.openSession();\n"
+ "Transaction tx = session.beginTransaction();\n"
+ "\n"
+ "// get a contract and make it read-only\n"
+ "Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+ "session.setReadOnly( contract, true );\n"
+ "\n"
+ "// contract.getCustomerName() is \"Sherman\"\n"
+ "contract.setCustomerName( \"Yogi\" );\n"
+ "tx.commit();\n"
+ "\n"
+ "tx = session.beginTransaction();\n"
+ "\n"
+ "contract = ( Contract ) session.get( Contract.class, contractId );\n"
+ "// contract.getCustomerName() is still \"Sherman\"\n"
+ "...\n"
+ "tx.commit();\n"
+ "session.close();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:529
+#, no-c-format
+msgid "Unidirectional associations"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:532
+#, no-c-format
+msgid "Unidirectional one-to-one and many-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:534
+#, no-c-format
+msgid "Hibernate treats unidirectional one-to-one and many-to-one associations in the same way when the owning entity is read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:540
+#, no-c-format
+msgid "We use the term <emphasis>unidirectional single-ended association</emphasis> when referring to functionality that is common to unidirectional one-to-one and many-to-one associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:547
+#, no-c-format
+msgid "Hibernate does not dirty-check unidirectional single-ended associations when the owning entity is read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:552
+#, no-c-format
+msgid "If you change a read-only entity's reference to a unidirectional single-ended association to null, or to refer to a different entity, that change will not be flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:560
+#, no-c-format
+msgid "If an entity is of an immutable class, then its references to unidirectional single-ended associations must be assigned when that entity is first created. Because the entity is automatically made read-only, these references can not be updated."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:570
+#, no-c-format
+msgid "If automatic versioning is used, Hibernate will not increment the version due to local changes to unidirectional single-ended associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:576
+#, no-c-format
+msgid "In the following examples, Contract has a unidirectional many-to-one association with Plan. Contract cascades save and update operations to the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:582
+#, no-c-format
+msgid "The following shows that changing a read-only entity's many-to-one association reference to null has no effect on the entity's database representation."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:588
+#, no-c-format
+msgid ""
+ "// get a contract with an existing plan;\n"
+ "// make the contract read-only and set its plan to null \n"
+ "tx = session.beginTransaction();\n"
+ "Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+ "session.setReadOnly( contract, true );\n"
+ "contract.setPlan( null );\n"
+ "tx.commit();\n"
+ "\n"
+ "// get the same contract\n"
+ "tx = session.beginTransaction();\n"
+ "contract = ( Contract ) session.get( Contract.class, contractId );\n"
+ "\n"
+ "// contract.getPlan() still refers to the original plan;\n"
+ "\n"
+ "tx.commit();\n"
+ "session.close();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:590
+#, no-c-format
+msgid "The following shows that, even though an update to a read-only entity's many-to-one association has no affect on the entity's database representation, flush still cascades the save-update operation to the locally changed association."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:599
+#, no-c-format
+msgid ""
+ "// get a contract with an existing plan;\n"
+ "// make the contract read-only and change to a new plan\n"
+ "tx = session.beginTransaction();\n"
+ "Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+ "session.setReadOnly( contract, true );\n"
+ "Plan newPlan = new Plan( \"new plan\"\n"
+ "contract.setPlan( newPlan);\n"
+ "tx.commit();\n"
+ "\n"
+ "// get the same contract\n"
+ "tx = session.beginTransaction();\n"
+ "contract = ( Contract ) session.get( Contract.class, contractId );\n"
+ "newPlan = ( Contract ) session.get( Plan.class, newPlan.getId() ); \n"
+ "\n"
+ "// contract.getPlan() still refers to the original plan;\n"
+ "// newPlan is non-null because it was persisted when \n"
+ "// the previous transaction was committed; \n"
+ "\n"
+ "tx.commit();\n"
+ "session.close();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:604
+#, no-c-format
+msgid "Unidirectional one-to-many and many-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:606
+#, no-c-format
+msgid "Hibernate treats unidirectional one-to-many and many-to-many associations owned by a read-only entity the same as when owned by an entity that is not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:613
+#, no-c-format
+msgid "Hibernate dirty-checks unidirectional one-to-many and many-to-many associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:618
+#, no-c-format
+msgid "The collection can contain entities that are read-only, as well as entities that are not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:624
+#, no-c-format
+msgid "Entities can be added and removed from the collection; changes are flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:629
+#, no-c-format
+msgid "If automatic versioning is used, Hibernate will update the version due to changes in the collection if they dirty the owning entity."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:640
+#, no-c-format
+msgid "Bidirectional associations"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:643
+#, no-c-format
+msgid "<title>Bidirectional one-to-one</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:645
+#, no-c-format
+msgid "If a read-only entity owns a bidirectional one-to-one association:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:652
+#, no-c-format
+msgid "Hibernate does not dirty-check the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:657
+#, no-c-format
+msgid "updates that change the association reference to null or to refer to a different entity will not be flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:664
+#, no-c-format
+msgid "If automatic versioning is used, Hibernate will not increment the version due to local changes to the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:673
+#, no-c-format
+msgid "If an entity is of an immutable class, and it owns a bidirectional one-to-one association, then its reference must be assigned when that entity is first created. Because the entity is automatically made read-only, these references cannot be updated."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:683
+#, no-c-format
+msgid "When the owner is not read-only, Hibernate treats an association with a read-only entity the same as when the association is with an entity that is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:693
+#, no-c-format
+msgid "<title>Bidirectional one-to-many/many-to-one</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:695
+#, no-c-format
+msgid "A read-only entity has no impact on a bidirectional one-to-many/many-to-one association if:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:702
+#, no-c-format
+msgid "the read-only entity is on the one-to-many side using an inverse collection;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:708
+#, no-c-format
+msgid "the read-only entity is on the one-to-many side using a non-inverse collection;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:714
+#, no-c-format
+msgid "the one-to-many side uses a non-inverse collection that contains the read-only entity"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:721
+#, no-c-format
+msgid "When the one-to-many side uses an inverse collection:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:727
+#, no-c-format
+msgid "a read-only entity can only be added to the collection when it is created;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:733
+#, no-c-format
+msgid "a read-only entity can only be removed from the collection by an orphan delete or by explicitly deleting the entity."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:744
+#, no-c-format
+msgid "<title>Bidirectional many-to-many</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:745
+#, no-c-format
+msgid "Hibernate treats bidirectional many-to-many associations owned by a read-only entity the same as when owned by an entity that is not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:752
+#, no-c-format
+msgid "Hibernate dirty-checks bidirectional many-to-many associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:757
+#, no-c-format
+msgid "The collection on either side of the association can contain entities that are read-only, as well as entities that are not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:763
+#, no-c-format
+msgid "Entities are added and removed from both sides of the collection; changes are flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:769
+#, no-c-format
+msgid "If automatic versioning is used, Hibernate will update the version due to changes in both sides of the collection if they dirty the entity owning the respective collections."
+msgstr ""
+
Modified: core/trunk/documentation/manual/src/main/docbook/pt-BR/content/best_practices.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pt-BR/content/best_practices.po 2010-03-24 22:47:51 UTC (rev 19111)
+++ core/trunk/documentation/manual/src/main/docbook/pt-BR/content/best_practices.po 2010-03-25 06:51:01 UTC (rev 19112)
@@ -297,7 +297,7 @@
"<emphasis>saber</emphasis> se é um afunilamento. E não suponha que o uso "
"direto do JDBC é necessariamente mais rápido. Se você precisar usar "
"diretamente o JDBC, vale a pena abrir uma <literal>Session</literal> do "
-"Hibernate, embrulhar a sua operaçäo JDBC como um objeto literal>org."
+"Hibernate, embrulhar a sua operaçäo JDBC como um objeto <literal>org."
"hibernate.jdbc.Work</literal> e usar uma conexão JDBC. De modo que você possa ainda usar a mesma "
"estratégia de transação e ocultar o provedor a conexão."
Modified: core/trunk/documentation/manual/src/main/docbook/pt-BR/content/portability.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pt-BR/content/portability.po 2010-03-24 22:47:51 UTC (rev 19111)
+++ core/trunk/documentation/manual/src/main/docbook/pt-BR/content/portability.po 2010-03-25 06:51:01 UTC (rev 19112)
@@ -108,7 +108,7 @@
msgstr ""
"Project-Id-Version: portability\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:47\n"
+"POT-Creation-Date: 2010-03-25 06:26+0000\n"
"PO-Revision-Date: 2010-03-18 15:20+1000\n"
"Last-Translator: \n"
"Language-Team: <en(a)li.org>\n"
@@ -118,16 +118,19 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: portability.xml:31
#, no-c-format
msgid "Database Portability Considerations"
msgstr "Considerações da Portabilidade do Banco de Dados"
#. Tag: title
+#: portability.xml:34
#, no-c-format
msgid "Portability Basics"
msgstr "Fundamentos da Portabilidade"
#. Tag: para
+#: portability.xml:36
#, no-c-format
msgid ""
"One of the selling points of Hibernate (and really Object/Relational Mapping "
@@ -151,11 +154,13 @@
"ao metadados de mapeamento."
#. Tag: title
+#: portability.xml:47
#, no-c-format
msgid "Dialect"
msgstr "Dialeto"
#. Tag: para
+#: portability.xml:49
#, no-c-format
msgid ""
"The first line of portability for Hibernate is the dialect, which is a "
@@ -177,11 +182,13 @@
"está seguindo os mesmos, não será difícil escrever o seu próprio."
#. Tag: title
+#: portability.xml:60
#, no-c-format
msgid "Dialect resolution"
msgstr "Resolução do Dialeto"
#. Tag: para
+#: portability.xml:62
#, no-c-format
msgid ""
"Originally, Hibernate would always require that users specify which dialect "
@@ -198,6 +205,7 @@
"determinação do valor."
#. Tag: para
+#: portability.xml:69
#, no-c-format
msgid ""
"Starting with version 3.2, Hibernate introduced the notion of automatically "
@@ -215,42 +223,44 @@
"com antecedência e que em ocasião alguma era configurável ou substituível."
#. Tag: para
-#, no-c-format
+#: portability.xml:77
+#, fuzzy, no-c-format
msgid ""
"Starting with version 3.3, Hibernate has a fare more powerful way to "
"automatically determine which dialect to should be used by relying on a "
"series of delegates which implement the <interfacename>org.hibernate.dialect."
"resolver.DialectResolver</interfacename> which defines only a single method:"
-"<programlisting role=\"JAVA\">public Dialect resolveDialect(DatabaseMetaData "
-"metaData) throws JDBCConnectionException</programlisting>. The basic "
-"contract here is that if the resolver 'understands' the given database "
-"metadata then it returns the corresponding Dialect; if not it returns null "
-"and the process continues to the next resolver. The signature also "
-"identifies <exceptionname>org.hibernate.exception.JDBCConnectionException</"
-"exceptionname> as possibly being thrown. A JDBCConnectionException here is "
-"interpreted to imply a \"non transient\" (aka non-recoverable) connection "
-"problem and is used to indicate an immediate stop to resolution attempts. "
-"All other exceptions result in a warning and continuing on to the next "
-"resolver."
+"<programlisting role=\"JAVA\"><![CDATA[public Dialect resolveDialect"
+"(DatabaseMetaData metaData) throws JDBCConnectionException]]></"
+"programlisting>. The basic contract here is that if the resolver "
+"'understands' the given database metadata then it returns the corresponding "
+"Dialect; if not it returns null and the process continues to the next "
+"resolver. The signature also identifies <exceptionname>org.hibernate."
+"exception.JDBCConnectionException</exceptionname> as possibly being thrown. "
+"A JDBCConnectionException here is interpreted to imply a \"non transient"
+"\" (aka non-recoverable) connection problem and is used to indicate an "
+"immediate stop to resolution attempts. All other exceptions result in a "
+"warning and continuing on to the next resolver."
msgstr ""
"Inicializando com a versão 3.3, o Hibernate possui uma maneira muito mais "
"potente para determinar automaticamente qual dialeto deve ser usado baseando-"
"se numa série de delegações que determinam qual implementação deve ser usada "
"baseando-se numa série de delegações que implementam o <interfacename>org."
"hibernate.dialect.resolver.DialectResolver</interfacename> que define apenas "
-"um método único: <programlisting role=\"JAVA\">public Dialect resolveDialect(DatabaseMetaData "
-"metaData) throws JDBCConnectionException</programlisting>. Este contrato básico é que se o solucionador 'entender' o "
-"metadados do banco de dados dado, ele retornará o Dialeto correspondente. "
-"Caso contrário, ele retornará nulo e o processo continuará ao próximo "
-"solucionador. A assinatura também identifica o <exceptionname>org.hibernate."
-"exception.JDBCConnectionException</exceptionname> como possivelmente "
-"lançado. Neste caso, o JDBCConnectionException é interpretado para implicar "
-"um problema de conexão (também conhecida com não-recuperável) \"não "
-"transiente\" e é usado para indicar uma parada imediata de tentativas de "
-"resolução. Todas as demais exceções resultam num aviso e dão continuidade ao "
-"próximo solucionador. "
+"um método único: <programlisting role=\"JAVA\">public Dialect resolveDialect"
+"(DatabaseMetaData metaData) throws JDBCConnectionException</programlisting>. "
+"Este contrato básico é que se o solucionador 'entender' o metadados do banco "
+"de dados dado, ele retornará o Dialeto correspondente. Caso contrário, ele "
+"retornará nulo e o processo continuará ao próximo solucionador. A assinatura "
+"também identifica o <exceptionname>org.hibernate.exception."
+"JDBCConnectionException</exceptionname> como possivelmente lançado. Neste "
+"caso, o JDBCConnectionException é interpretado para implicar um problema de "
+"conexão (também conhecida com não-recuperável) \"não transiente\" e é usado "
+"para indicar uma parada imediata de tentativas de resolução. Todas as demais "
+"exceções resultam num aviso e dão continuidade ao próximo solucionador. "
#. Tag: para
+#: portability.xml:90
#, no-c-format
msgid ""
"The cool part about these resolvers is that users can also register their "
@@ -277,12 +287,14 @@
"constant> no <classname>org.hibernate.cfg.Environment</classname>)."
#. Tag: title
+#: portability.xml:103
#, no-c-format
msgid "Identifier generation"
msgstr "Geração do identificador"
#. Tag: para
-#, no-c-format
+#: portability.xml:105
+#, fuzzy, no-c-format
msgid ""
"When considering portability between databases, another important decision "
"is selecting the identifier generation stratagy you want to use. Originally "
@@ -300,7 +312,10 @@
"reference entities within a persistence context it must then issue the "
"insert immediately when the users requests the entitiy be associated with "
"the session (like via save() e.g.) regardless of current transactional "
-"semantics."
+"semantics. <note> <para> Hibernate was changed slightly once the implication "
+"of this was better understood so that the insert is delayed in cases where "
+"that is feasible. </para> </note> The underlying issue is that the actual "
+"semanctics of the application itself changes in these cases."
msgstr ""
"Quando considerando a portabilidade entre os bancos de dados, outra "
"importante decisão é selecionar a estratégia de geração do identificador que "
@@ -322,76 +337,44 @@
"semânticas de transação atual. "
#. Tag: para
+#: portability.xml:130
#, no-c-format
msgid ""
-"Hibernate was changed slightly once the implication of this was better "
-"understood so that the insert is delayed in cases where that is feasible."
-msgstr ""
-"O Hibernate foi atualizado para que a inserção seja lenta em casos em que "
-"isto é possível, sendo desta forma melhor compreendido. "
-
-#. Tag: note
-#, no-c-format
-msgid ""
-"The underlying issue is that the actual semanctics of the application itself "
-"changes in these cases."
-msgstr "O problema adjacente é que as semânticas atuais do próprio aplicativo altere nestes casos."
-
-#. Tag: para
-#, no-c-format
-msgid ""
"Starting with version 3.2.3, Hibernate comes with a set of <ulink url="
"\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier generators "
-"targetting portability in a much different way."
+"targetting portability in a much different way. <note> <para> There are "
+"specifically 2 bundled <emphasis>enhanced</emphasis>generators: "
+"<itemizedlist> <listitem> <para> <classname>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</classname> </para> </listitem> <listitem> <para> "
+"<classname>org.hibernate.id.enhanced.TableGenerator</classname> </para> </"
+"listitem> </itemizedlist> </para> </note> The idea behind these generators "
+"is to port the actual semantics of the identifer value generation to the "
+"different databases. For example, the <classname>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</classname> mimics the behavior of a sequence on "
+"databases which do not support sequences by using a table."
msgstr ""
-"Starting with version 3.2.3, Hibernate comes with a set of <ulink url="
-"\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier generators "
-"targetting portability in a much different way."
-#. Tag: para
-#, no-c-format
-msgid "There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
-msgstr "There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
-
-#. Tag: para
-#, no-c-format
-msgid "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
-msgstr "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
-
-#. Tag: para
-#, no-c-format
-msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
-msgstr "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
-
-#. Tag: note
-#, no-c-format
-msgid ""
-"The idea behind these generators is to port the actual semantics of the "
-"identifer value generation to the different databases. For example, the "
-"<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> "
-"mimics the behavior of a sequence on databases which do not support "
-"sequences by using a table."
-msgstr ""
-"The idea behind these generators is to port the actual semantics of the "
-"identifer value generation to the different databases. For example, the "
-"<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> "
-"mimics the behavior of a sequence on databases which do not support "
-"sequences by using a table."
-
#. Tag: title
+#: portability.xml:159
#, no-c-format
msgid "Database functions"
msgstr "Funções do banco de dados"
#. Tag: para
+#: portability.xml:162
#, no-c-format
msgid ""
"This is an area in Hibernate in need of improvement. In terms of portability "
"concerns, this function handling currently works pretty well from HQL; "
"however, it is quite lacking in all other aspects."
-msgstr "Esta é uma área do Hibernate com necessidade de melhoramentos. Este manuseio de função funciona atualmente muito bem com o HQL, quando falamos das preocupações de portabilidade. No entanto, é bastante precária em outros aspectos."
+msgstr ""
+"Esta é uma área do Hibernate com necessidade de melhoramentos. Este manuseio "
+"de função funciona atualmente muito bem com o HQL, quando falamos das "
+"preocupações de portabilidade. No entanto, é bastante precária em outros "
+"aspectos."
#. Tag: para
+#: portability.xml:169
#, no-c-format
msgid ""
"SQL functions can be referenced in many ways by users. However, not all "
@@ -399,9 +382,16 @@
"mapping a <emphasis>logical</emphasis> function name to a delegate which "
"knows how to render that particular function, perhaps even using a totally "
"different physical function call."
-msgstr "As funções SQL podem ser referenciadas em diversas maneiras pelos usuários. No entanto, nem todos os bancos de dados suportam o mesmo conjunto de função. O Hibernate fornece um significado de mapeamento do nome da função <emphasis>lógica</emphasis> para uma delegação que sabe como manusear aquela função em particular, mesmo quando usando uma chamada de função física totalmente diferente."
+msgstr ""
+"As funções SQL podem ser referenciadas em diversas maneiras pelos usuários. "
+"No entanto, nem todos os bancos de dados suportam o mesmo conjunto de "
+"função. O Hibernate fornece um significado de mapeamento do nome da função "
+"<emphasis>lógica</emphasis> para uma delegação que sabe como manusear aquela "
+"função em particular, mesmo quando usando uma chamada de função física "
+"totalmente diferente."
#. Tag: para
+#: portability.xml:175
#, no-c-format
msgid ""
"Technically this function registration is handled through the <classname>org."
@@ -417,6 +407,7 @@
"completed as of yet."
#. Tag: para
+#: portability.xml:182
#, no-c-format
msgid ""
"It is sort of implemented such that users can programatically register "
@@ -428,12 +419,62 @@
"and those functions will be recognized for HQL."
#. Tag: title
+#: portability.xml:192
#, no-c-format
msgid "Type mappings"
msgstr "Tipos de mapeamentos"
#. Tag: para
+#: portability.xml:194
#, no-c-format
msgid "This section scheduled for completion at a later date..."
msgstr "A seção está esquematizada para finalização numa data posterior..."
+#~ msgid ""
+#~ "Hibernate was changed slightly once the implication of this was better "
+#~ "understood so that the insert is delayed in cases where that is feasible."
+#~ msgstr ""
+#~ "O Hibernate foi atualizado para que a inserção seja lenta em casos em que "
+#~ "isto é possível, sendo desta forma melhor compreendido. "
+
+#~ msgid ""
+#~ "The underlying issue is that the actual semanctics of the application "
+#~ "itself changes in these cases."
+#~ msgstr ""
+#~ "O problema adjacente é que as semânticas atuais do próprio aplicativo "
+#~ "altere nestes casos."
+
+#~ msgid ""
+#~ "Starting with version 3.2.3, Hibernate comes with a set of <ulink url="
+#~ "\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier "
+#~ "generators targetting portability in a much different way."
+#~ msgstr ""
+#~ "Starting with version 3.2.3, Hibernate comes with a set of <ulink url="
+#~ "\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier "
+#~ "generators targetting portability in a much different way."
+
+#~ msgid ""
+#~ "There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
+#~ msgstr ""
+#~ "There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
+
+#~ msgid ""
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
+#~ msgstr ""
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
+
+#~ msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
+#~ msgstr "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
+
+#~ msgid ""
+#~ "The idea behind these generators is to port the actual semantics of the "
+#~ "identifer value generation to the different databases. For example, the "
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> "
+#~ "mimics the behavior of a sequence on databases which do not support "
+#~ "sequences by using a table."
+#~ msgstr ""
+#~ "The idea behind these generators is to port the actual semantics of the "
+#~ "identifer value generation to the different databases. For example, the "
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> "
+#~ "mimics the behavior of a sequence on databases which do not support "
+#~ "sequences by using a table."
Added: core/trunk/documentation/manual/src/main/docbook/pt-BR/content/readonly.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/pt-BR/content/readonly.po (rev 0)
+++ core/trunk/documentation/manual/src/main/docbook/pt-BR/content/readonly.po 2010-03-25 06:51:01 UTC (rev 19112)
@@ -0,0 +1,1124 @@
+# Language pt-BR translations for PACKAGE package.
+# Automatically generated, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-03-25 06:26+0000\n"
+"PO-Revision-Date: 2010-03-25 06:26+0000\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Tag: title
+#: readonly.xml:33
+#, no-c-format
+msgid "Read-only entities"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:36
+#, no-c-format
+msgid ""
+"Hibernate's treatment of <emphasis>read-only</emphasis> entities may differ "
+"from what you may have encountered elsewhere. Incorrect usage may cause "
+"unexpected results."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:43
+#, no-c-format
+msgid "When an entity is read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:48
+#, no-c-format
+msgid ""
+"Hibernate does not dirty-check the entity's simple properties or single-"
+"ended associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:54
+#, no-c-format
+msgid ""
+"Hibernate will not update simple properties or updatable single-ended "
+"associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:60
+#, no-c-format
+msgid ""
+"Hibernate will not update the version of the read-only entity if only simple "
+"properties or single-ended updatable associations are changed;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:69
+#, no-c-format
+msgid ""
+"In some ways, Hibernate treats read-only entities the same as entities that "
+"are not read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:75
+#, no-c-format
+msgid ""
+"Hibernate cascades operations to associations as defined in the entity "
+"mapping."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:81
+#, no-c-format
+msgid ""
+"Hibernate updates the version if the entity has a collection with changes "
+"that dirties the entity;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:87
+#, no-c-format
+msgid "A read-only entity can be deleted."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:94
+#, no-c-format
+msgid ""
+"Even if an entity is not read-only, its collection association can be "
+"affected if it contains a read-only entity."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:99
+#, no-c-format
+msgid ""
+"For details about the affect of read-only entities on different property and "
+"association types, see <xref linkend=\"readonly-proptypes\"/>."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:105
+#, no-c-format
+msgid "For details about how to make entities read-only, see"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:110
+#, no-c-format
+msgid "Hibernate does some optimizing for read-only entities:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:115
+#, no-c-format
+msgid ""
+"It saves execution time by not dirty-checking simple properties or single-"
+"ended associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:121
+#, no-c-format
+msgid "It saves memory by deleting database snapshots."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:128
+#, no-c-format
+msgid "Making persistent entities read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:130
+#, no-c-format
+msgid ""
+"Only persistent entities can be made read-only. Transient and detached "
+"entities must be put in persistent state before they can be made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:136
+#, no-c-format
+msgid ""
+"Hibernate provides the following ways to make persistent entities read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:142
+#, no-c-format
+msgid ""
+"you can map an entity class as <emphasis>immutable</emphasis>; when an "
+"entity of an immutable class is made persistent, Hibernate automatically "
+"makes it read-only. see <xref linkend=\"readonly-api-immutable\"/> for "
+"details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:150
+#, no-c-format
+msgid ""
+"you can change a default so that entities loaded into the session by "
+"Hibernate are automatically made read-only; see <xref linkend=\"readonly-api-"
+"loaddefault\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:157
+#, no-c-format
+msgid ""
+"you can make an HQL query or criteria read-only so that entities loaded when "
+"the query or criteria executes, scrolls, or iterates, are automatically made "
+"read-only; see <xref linkend=\"readonly-api-querycriteria\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:165
+#, no-c-format
+msgid ""
+"you can make a persistent entity that is already in the in the session read-"
+"only; see <xref linkend=\"readonly-api-entity\"/> for details"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:174
+#, no-c-format
+msgid "Entities of immutable classes"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:176
+#, no-c-format
+msgid ""
+"When an entity instance of an immutable class is made persistent, Hibernate "
+"automatically makes it read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:180
+#, no-c-format
+msgid ""
+"An entity of an immutable class can created and deleted the same as an "
+"entity of a mutable class."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:185
+#, no-c-format
+msgid ""
+"Hibernate treats a persistent entity of an immutable class the same way as a "
+"read-only persistent entity of a mutable class. The only exception is that "
+"Hibernate will not allow an entity of an immutable class to be changed so it "
+"is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:196
+#, no-c-format
+msgid "Loading persistent entities as read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:199 readonly.xml:286
+#, no-c-format
+msgid "Entities of immutable classes are automatically loaded as read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:205
+#, no-c-format
+msgid ""
+"To change the default behavior so Hibernate loads entity instances of "
+"mutable classes into the session and automatically makes them read-only, "
+"call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:210
+#, no-c-format
+msgid "Session.setDefaultReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:212
+#, no-c-format
+msgid ""
+"To change the default back so entities loaded by Hibernate are not made read-"
+"only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:216
+#, no-c-format
+msgid "Session.setDefaultReadOnly( false );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:218
+#, no-c-format
+msgid "You can determine the current setting by calling:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:221
+#, no-c-format
+msgid "Session.isDefaultReadOnly();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:223
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns true, entities loaded by the "
+"following are automatically made read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:229
+#, no-c-format
+msgid "Session.load()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:234
+#, no-c-format
+msgid "Session.get()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:239
+#, no-c-format
+msgid "Session.merge()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:244
+#, no-c-format
+msgid ""
+"executing, scrolling, or iterating HQL queries and criteria; to override "
+"this setting for a particular HQL query or criteria see"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:253
+#, no-c-format
+msgid "Changing this default has no effect on:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:258
+#, no-c-format
+msgid "persistent entities already in the session when the default was changed"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:264
+#, no-c-format
+msgid ""
+"persistent entities that are refreshed via Session.refresh(); a refreshed "
+"persistent entity will only be read-only if it was read-only before "
+"refreshing"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:272
+#, no-c-format
+msgid ""
+"persistent entities added by the application via Session.persist(), Session."
+"save(), and Session.update() Session.saveOrUpdate()"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:283
+#, no-c-format
+msgid "Loading read-only entities from an HQL query/criteria"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:292
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns false (the default) when an HQL query "
+"or criteria executes, then entities and proxies of mutable classes loaded by "
+"the query will not be read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:299
+#, no-c-format
+msgid ""
+"You can override this behavior so that entities and proxies loaded by an HQL "
+"query or criteria are automatically made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:304
+#, no-c-format
+msgid "For an HQL query, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:307
+#, no-c-format
+msgid "Query.setReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:309
+#, no-c-format
+msgid ""
+"<literal>Query.setReadOnly( true )</literal> must be called before "
+"<literal>Query.list()</literal>, <literal>Query.uniqueResult()</literal>, "
+"<literal>Query.scroll()</literal>, or <literal>Query.iterate()</literal>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:315
+#, no-c-format
+msgid "For an HQL criteria, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:318
+#, no-c-format
+msgid "Criteria.setReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:320
+#, no-c-format
+msgid ""
+"<literal>Criteria.setReadOnly( true )</literal> must be called before "
+"<literal>Criteria.list()</literal>, <literal>Criteria.uniqueResult()</"
+"literal>, or <literal>Criteria.scroll()</literal>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:326
+#, no-c-format
+msgid ""
+"Entities and proxies that exist in the session before being returned by an "
+"HQL query or criteria are not affected."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:331
+#, no-c-format
+msgid ""
+"Uninitialized persistent collections returned by the query are not affected. "
+"Later, when the collection is initialized, entities loaded into the session "
+"will be read-only if Session.isDefaultReadOnly() returns true."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:338
+#, no-c-format
+msgid ""
+"Using <literal>Query.setReadOnly( true )</literal> or <literal>Criteria."
+"setReadOnly( true )</literal> works well when a single HQL query or criteria "
+"loads all the entities and intializes all the proxies and collections that "
+"the application needs to be read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:346
+#, no-c-format
+msgid ""
+"When it is not possible to load and initialize all necessary entities in a "
+"single query or criteria, you can temporarily change the session default to "
+"load entities as read-only before the query is executed. Then you can "
+"explicitly initialize proxies and collections before restoring the session "
+"default."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:355
+#, no-c-format
+msgid ""
+"Session session = factory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+" \n"
+"setDefaultReadOnly( true );\n"
+"Contract contract = \n"
+" ( Contract ) session.createQuery(\n"
+" \"from Contract where customerName = 'Sherman'\" )\n"
+" .uniqueResult();\n"
+"Hibernate.initialize( contract.getPlan() );\n"
+"Hibernate.initialize( contract.getVariations() );\n"
+"Hibernate.initialize( contract.getNotes() );\n"
+"setDefaultReadOnly( false );\n"
+"...\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:357
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns true, then you can use Query."
+"setReadOnly( false ) and Criteria.setReadOnly( false ) to override this "
+"session setting and load entities that are not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:367
+#, no-c-format
+msgid "Making a persistent entity read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:369
+#, no-c-format
+msgid ""
+"Persistent entities of immutable classes are automatically made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:375
+#, no-c-format
+msgid "To make a persistent entity or proxy read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:378
+#, no-c-format
+msgid "Session.setReadOnly(entityOrProxy, true)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:380
+#, no-c-format
+msgid ""
+"To change a read-only entity or proxy of a mutable class so it is no longer "
+"read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:384
+#, no-c-format
+msgid "Session.setReadOnly(entityOrProxy, false)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:387
+#, no-c-format
+msgid ""
+"When a read-only entity or proxy is changed so it is no longer read-only, "
+"Hibernate assumes that the current state of the read-only entity is "
+"consistent with its database representation. If this is not true, then any "
+"non-flushed changes made before or while the entity was read-only, will be "
+"ignored."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:396
+#, no-c-format
+msgid ""
+"To throw away non-flushed changes and make the persistent entity consistent "
+"with its database representation, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:400
+#, no-c-format
+msgid "session.refresh( entity );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:402
+#, no-c-format
+msgid ""
+"To flush changes made before or while the entity was read-only and make the "
+"database representation consistent with the current state of the persistent "
+"entity:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:408
+#, no-c-format
+msgid ""
+"// evict the read-only entity so it is detached\n"
+"session.evict( entity );\n"
+"\n"
+"// make the detached entity (with the non-flushed changes) persistent\n"
+"session.update( entity );\n"
+"\n"
+"// now entity is no longer read-only and its changes can be flushed\n"
+"s.flush();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:413
+#, no-c-format
+msgid "Read-only affect on property type"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:415
+#, no-c-format
+msgid ""
+"The following table summarizes how different property types are affected by "
+"making an entity read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:421
+#, no-c-format
+msgid "Affect of read-only entity on property types"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:427
+#, no-c-format
+msgid "Property/Association Type"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:428
+#, no-c-format
+msgid "Changes flushed to DB?"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:433
+#, no-c-format
+msgid "Simple"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:435
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-simple\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:439
+#, no-c-format
+msgid "<entry>no*</entry>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:443
+#, no-c-format
+msgid "Unidirectional one-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:444
+#, no-c-format
+msgid "Unidirectional many-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:445
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-singleended-unidir\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:451 readonly.xml:452
+#, no-c-format
+msgid "<para>no*</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:457
+#, no-c-format
+msgid "Unidirectional one-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:458
+#, no-c-format
+msgid "Unidirectional many-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:459
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-manyended-unidir\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:464 readonly.xml:465 readonly.xml:489
+#, no-c-format
+msgid "<para>yes</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:470
+#, no-c-format
+msgid "<para>Bidirectional one-to-one</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:471
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-onetoone-bidir\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:475
+#, no-c-format
+msgid "only if the owning entity is not read-only*"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:479
+#, no-c-format
+msgid "<para>Bidirectional one-to-many/many-to-one</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:480
+#, no-c-format
+msgid "inverse collection"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:481
+#, no-c-format
+msgid "non-inverse collection"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:482
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-onetomany-manytoone\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:488
+#, no-c-format
+msgid "only added/removed entities that are not read-only*"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:494
+#, no-c-format
+msgid "<para>Bidirectional many-to-many</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:495
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-manytomany-bidir\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:499
+#, no-c-format
+msgid "<entry>yes</entry>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:505
+#, no-c-format
+msgid ""
+"* Behavior is different when the entity having the property/association is "
+"read-only, compared to when it is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:511
+#, no-c-format
+msgid "Simple properties"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:513
+#, no-c-format
+msgid ""
+"When a persistent object is read-only, Hibernate does not dirty-check simple "
+"properties."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:518
+#, no-c-format
+msgid ""
+"Hibernate will not synchronize simple property state changes to the "
+"database. If you have automatic versioning, Hibernate will not increment the "
+"version if any simple properties change."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:524
+#, no-c-format
+msgid ""
+"Session session = factory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+"\n"
+"// get a contract and make it read-only\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"\n"
+"// contract.getCustomerName() is \"Sherman\"\n"
+"contract.setCustomerName( \"Yogi\" );\n"
+"tx.commit();\n"
+"\n"
+"tx = session.beginTransaction();\n"
+"\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"// contract.getCustomerName() is still \"Sherman\"\n"
+"...\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:529
+#, no-c-format
+msgid "Unidirectional associations"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:532
+#, no-c-format
+msgid "Unidirectional one-to-one and many-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:534
+#, no-c-format
+msgid ""
+"Hibernate treats unidirectional one-to-one and many-to-one associations in "
+"the same way when the owning entity is read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:540
+#, no-c-format
+msgid ""
+"We use the term <emphasis>unidirectional single-ended association</emphasis> "
+"when referring to functionality that is common to unidirectional one-to-one "
+"and many-to-one associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:547
+#, no-c-format
+msgid ""
+"Hibernate does not dirty-check unidirectional single-ended associations when "
+"the owning entity is read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:552
+#, no-c-format
+msgid ""
+"If you change a read-only entity's reference to a unidirectional single-"
+"ended association to null, or to refer to a different entity, that change "
+"will not be flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:560
+#, no-c-format
+msgid ""
+"If an entity is of an immutable class, then its references to unidirectional "
+"single-ended associations must be assigned when that entity is first "
+"created. Because the entity is automatically made read-only, these "
+"references can not be updated."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:570
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will not increment the version "
+"due to local changes to unidirectional single-ended associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:576
+#, no-c-format
+msgid ""
+"In the following examples, Contract has a unidirectional many-to-one "
+"association with Plan. Contract cascades save and update operations to the "
+"association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:582
+#, no-c-format
+msgid ""
+"The following shows that changing a read-only entity's many-to-one "
+"association reference to null has no effect on the entity's database "
+"representation."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:588
+#, no-c-format
+msgid ""
+"// get a contract with an existing plan;\n"
+"// make the contract read-only and set its plan to null \n"
+"tx = session.beginTransaction();\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"contract.setPlan( null );\n"
+"tx.commit();\n"
+"\n"
+"// get the same contract\n"
+"tx = session.beginTransaction();\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"\n"
+"// contract.getPlan() still refers to the original plan;\n"
+"\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:590
+#, no-c-format
+msgid ""
+"The following shows that, even though an update to a read-only entity's many-"
+"to-one association has no affect on the entity's database representation, "
+"flush still cascades the save-update operation to the locally changed "
+"association."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:599
+#, no-c-format
+msgid ""
+"// get a contract with an existing plan;\n"
+"// make the contract read-only and change to a new plan\n"
+"tx = session.beginTransaction();\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"Plan newPlan = new Plan( \"new plan\"\n"
+"contract.setPlan( newPlan);\n"
+"tx.commit();\n"
+"\n"
+"// get the same contract\n"
+"tx = session.beginTransaction();\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"newPlan = ( Contract ) session.get( Plan.class, newPlan.getId() ); \n"
+"\n"
+"// contract.getPlan() still refers to the original plan;\n"
+"// newPlan is non-null because it was persisted when \n"
+"// the previous transaction was committed; \n"
+"\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:604
+#, no-c-format
+msgid "Unidirectional one-to-many and many-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:606
+#, no-c-format
+msgid ""
+"Hibernate treats unidirectional one-to-many and many-to-many associations "
+"owned by a read-only entity the same as when owned by an entity that is not "
+"read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:613
+#, no-c-format
+msgid ""
+"Hibernate dirty-checks unidirectional one-to-many and many-to-many "
+"associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:618
+#, no-c-format
+msgid ""
+"The collection can contain entities that are read-only, as well as entities "
+"that are not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:624
+#, no-c-format
+msgid ""
+"Entities can be added and removed from the collection; changes are flushed "
+"to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:629
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will update the version due to "
+"changes in the collection if they dirty the owning entity."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:640
+#, no-c-format
+msgid "Bidirectional associations"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:643
+#, no-c-format
+msgid "<title>Bidirectional one-to-one</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:645
+#, no-c-format
+msgid "If a read-only entity owns a bidirectional one-to-one association:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:652
+#, no-c-format
+msgid "Hibernate does not dirty-check the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:657
+#, no-c-format
+msgid ""
+"updates that change the association reference to null or to refer to a "
+"different entity will not be flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:664
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will not increment the version "
+"due to local changes to the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:673
+#, no-c-format
+msgid ""
+"If an entity is of an immutable class, and it owns a bidirectional one-to-"
+"one association, then its reference must be assigned when that entity is "
+"first created. Because the entity is automatically made read-only, these "
+"references cannot be updated."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:683
+#, no-c-format
+msgid ""
+"When the owner is not read-only, Hibernate treats an association with a read-"
+"only entity the same as when the association is with an entity that is not "
+"read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:693
+#, no-c-format
+msgid "<title>Bidirectional one-to-many/many-to-one</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:695
+#, no-c-format
+msgid ""
+"A read-only entity has no impact on a bidirectional one-to-many/many-to-one "
+"association if:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:702
+#, no-c-format
+msgid ""
+"the read-only entity is on the one-to-many side using an inverse collection;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:708
+#, no-c-format
+msgid ""
+"the read-only entity is on the one-to-many side using a non-inverse "
+"collection;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:714
+#, no-c-format
+msgid ""
+"the one-to-many side uses a non-inverse collection that contains the read-"
+"only entity"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:721
+#, no-c-format
+msgid "When the one-to-many side uses an inverse collection:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:727
+#, no-c-format
+msgid ""
+"a read-only entity can only be added to the collection when it is created;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:733
+#, no-c-format
+msgid ""
+"a read-only entity can only be removed from the collection by an orphan "
+"delete or by explicitly deleting the entity."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:744
+#, no-c-format
+msgid "<title>Bidirectional many-to-many</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:745
+#, no-c-format
+msgid ""
+"Hibernate treats bidirectional many-to-many associations owned by a read-"
+"only entity the same as when owned by an entity that is not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:752
+#, no-c-format
+msgid "Hibernate dirty-checks bidirectional many-to-many associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:757
+#, no-c-format
+msgid ""
+"The collection on either side of the association can contain entities that "
+"are read-only, as well as entities that are not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:763
+#, no-c-format
+msgid ""
+"Entities are added and removed from both sides of the collection; changes "
+"are flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:769
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will update the version due to "
+"changes in both sides of the collection if they dirty the entity owning the "
+"respective collections."
+msgstr ""
Modified: core/trunk/documentation/manual/src/main/docbook/zh-CN/content/portability.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/zh-CN/content/portability.po 2010-03-24 22:47:51 UTC (rev 19111)
+++ core/trunk/documentation/manual/src/main/docbook/zh-CN/content/portability.po 2010-03-25 06:51:01 UTC (rev 19112)
@@ -5,7 +5,7 @@
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-03-12T00:03:47\n"
+"POT-Creation-Date: 2010-03-25 06:26+0000\n"
"PO-Revision-Date: 2010-03-16 10:10+1000\n"
"Last-Translator: Xi HUANG <xhuang(a)redhat.com>\n"
"Language-Team: <en(a)li.org>\n"
@@ -15,137 +15,320 @@
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
+#: portability.xml:31
#, no-c-format
msgid "Database Portability Considerations"
msgstr "数据库移植性考量"
#. Tag: title
+#: portability.xml:34
#, no-c-format
msgid "Portability Basics"
msgstr "移植性基础"
#. Tag: para
+#: portability.xml:36
#, no-c-format
-msgid "One of the selling points of Hibernate (and really Object/Relational Mapping as a whole) is the notion of database portability. This could mean an internal IT user migrating from one database vendor to another, or it could mean a framework or deployable application consuming Hibernate to simultaneously target multiple database products by their users. Regardless of the exact scenario, the basic idea is that you want Hibernate to help you run against any number of databases without changes to your code, and ideally without any changes to the mapping metadata."
-msgstr "Hibernate(实际上是整个 Object/Relational Mapping)的一个卖点是数据库的移植性。这意味着内部的 IT 用户可以改变数据库供应商,或者可部署的应用程序/框架使用 Hibernate 来同时使用多个数据库产品。不考虑具体的应用情景,这里的基本概念是 Hibernate 可帮助你运行多种数据库而无需修改你的代码,理想情况下甚至不用修改映射元数据。"
+msgid ""
+"One of the selling points of Hibernate (and really Object/Relational Mapping "
+"as a whole) is the notion of database portability. This could mean an "
+"internal IT user migrating from one database vendor to another, or it could "
+"mean a framework or deployable application consuming Hibernate to "
+"simultaneously target multiple database products by their users. Regardless "
+"of the exact scenario, the basic idea is that you want Hibernate to help you "
+"run against any number of databases without changes to your code, and "
+"ideally without any changes to the mapping metadata."
+msgstr ""
+"Hibernate(实际上是整个 Object/Relational Mapping)的一个卖点是数据库的移植"
+"性。这意味着内部的 IT 用户可以改变数据库供应商,或者可部署的应用程序/框架使"
+"用 Hibernate 来同时使用多个数据库产品。不考虑具体的应用情景,这里的基本概念"
+"是 Hibernate 可帮助你运行多种数据库而无需修改你的代码,理想情况下甚至不用修改"
+"映射元数据。"
#. Tag: title
+#: portability.xml:47
#, no-c-format
msgid "Dialect"
msgstr "Dialect"
#. Tag: para
+#: portability.xml:49
#, no-c-format
-msgid "The first line of portability for Hibernate is the dialect, which is a specialization of the <classname>org.hibernate.dialect.Dialect</classname> contract. A dialect encapsulates all the differences in how Hibernate must communicate with a particular database to accomplish some task like getting a sequence value or structuring a SELECT query. Hibernate bundles a wide range of dialects for many of the most popular databases. If you find that your particular database is not among them, it is not terribly difficult to write your own."
-msgstr "Hibernate 的移植性的首要问题是方言(dialect),也就是 <classname>org.hibernate.dialect.Dialect</classname> 合约的具体实例。方言封装了 Hibernate 和特定数据库通讯以完成某些任务如获取序列值或构建 SELECT 查询等的所有差异。Hibernate 捆绑了用于许多最常用的数据库的方言。如果你发现自己使用的数据库不在其中,编写自定义的方言也不是很困难的事情。"
+msgid ""
+"The first line of portability for Hibernate is the dialect, which is a "
+"specialization of the <classname>org.hibernate.dialect.Dialect</classname> "
+"contract. A dialect encapsulates all the differences in how Hibernate must "
+"communicate with a particular database to accomplish some task like getting "
+"a sequence value or structuring a SELECT query. Hibernate bundles a wide "
+"range of dialects for many of the most popular databases. If you find that "
+"your particular database is not among them, it is not terribly difficult to "
+"write your own."
+msgstr ""
+"Hibernate 的移植性的首要问题是方言(dialect),也就是 <classname>org."
+"hibernate.dialect.Dialect</classname> 合约的具体实例。方言封装了 Hibernate 和"
+"特定数据库通讯以完成某些任务如获取序列值或构建 SELECT 查询等的所有差异。"
+"Hibernate 捆绑了用于许多最常用的数据库的方言。如果你发现自己使用的数据库不在"
+"其中,编写自定义的方言也不是很困难的事情。"
#. Tag: title
+#: portability.xml:60
#, no-c-format
msgid "Dialect resolution"
msgstr "方言的使用"
#. Tag: para
+#: portability.xml:62
#, no-c-format
-msgid "Originally, Hibernate would always require that users specify which dialect to use. In the case of users looking to simultaneously target multiple databases with their build that was problematic. Generally this required their users to configure the Hibernate dialect or defining their own method of setting that value."
-msgstr "最开始,Hibernate 总是要求用户指定所使用的方言(dialect)。在用户希望同时使用多个数据库时就会出现问题。通常这要求用户配置 Hibernate 方言或者定义自己设置这个值的方法。"
+msgid ""
+"Originally, Hibernate would always require that users specify which dialect "
+"to use. In the case of users looking to simultaneously target multiple "
+"databases with their build that was problematic. Generally this required "
+"their users to configure the Hibernate dialect or defining their own method "
+"of setting that value."
+msgstr ""
+"最开始,Hibernate 总是要求用户指定所使用的方言(dialect)。在用户希望同时使用"
+"多个数据库时就会出现问题。通常这要求用户配置 Hibernate 方言或者定义自己设置这"
+"个值的方法。"
#. Tag: para
+#: portability.xml:69
#, no-c-format
-msgid "Starting with version 3.2, Hibernate introduced the notion of automatically detecting the dialect to use based on the <interfacename>java.sql.DatabaseMetaData</interfacename> obtained from a <interfacename>java.sql.Connection</interfacename> to that database. This was much better, expect that this resolution was limited to databases Hibernate know about ahead of time and was in no way configurable or overrideable."
-msgstr "从版本 3.2 开始,Hibernate 引入了方言的自动检测,它基于从该数据库的 <interfacename>java.sql.Connection</interfacename> 上获得的 <interfacename>java.sql.DatabaseMetaData</interfacename>。这是一个更好的方案,但它局限于 Hibernate 已知的数据库且无法进行配置和覆盖。"
+msgid ""
+"Starting with version 3.2, Hibernate introduced the notion of automatically "
+"detecting the dialect to use based on the <interfacename>java.sql."
+"DatabaseMetaData</interfacename> obtained from a <interfacename>java.sql."
+"Connection</interfacename> to that database. This was much better, expect "
+"that this resolution was limited to databases Hibernate know about ahead of "
+"time and was in no way configurable or overrideable."
+msgstr ""
+"从版本 3.2 开始,Hibernate 引入了方言的自动检测,它基于从该数据库的 "
+"<interfacename>java.sql.Connection</interfacename> 上获得的 "
+"<interfacename>java.sql.DatabaseMetaData</interfacename>。这是一个更好的方"
+"案,但它局限于 Hibernate 已知的数据库且无法进行配置和覆盖。"
#. Tag: para
-#, no-c-format
-msgid "Starting with version 3.3, Hibernate has a fare more powerful way to automatically determine which dialect to should be used by relying on a series of delegates which implement the <interfacename>org.hibernate.dialect.resolver.DialectResolver</interfacename> which defines only a single method:<programlisting role=\"JAVA\">public Dialect resolveDialect(DatabaseMetaData metaData) throws JDBCConnectionException</programlisting>. The basic contract here is that if the resolver 'understands' the given database metadata then it returns the corresponding Dialect; if not it returns null and the process continues to the next resolver. The signature also identifies <exceptionname>org.hibernate.exception.JDBCConnectionException</exceptionname> as possibly being thrown. A JDBCConnectionException here is interpreted to imply a \"non transient\" (aka non-recoverable) connection problem and is used to indicate an immediate stop to resolution attempts. All other exceptions result in!
a warning and continuing on to the next resolver."
-msgstr "从版本 3.3 开始,Hibernate 有了更为强大的自动决定应该使用哪个方言的方法,这根据一系列实现 <interfacename>org.hibernate.dialect.resolver.DialectResolver</interfacename> 接口的代理,它们只定义一个方法:<programlisting role=\"JAVA\">public Dialect resolveDialect(DatabaseMetaData metaData) throws JDBCConnectionException</programlisting>。这里的基本合约是如果解析者(resolver)“理解”给点数据库的元数据并返回对应的方言;否则返回 null 并使用下一个解析者。这个签名也指定可能抛出的异常 <exceptionname>org.hibernate.exception.JDBCConnectionException</exceptionname>。这里的 JDBCConnectionException 被认为是“非瞬时的”(也就是不可恢复的)连接问题且指示立即终止解析。所有其他的异常都导致警告发出并使用下一个解析者。\""
+#: portability.xml:77
+#, fuzzy, no-c-format
+msgid ""
+"Starting with version 3.3, Hibernate has a fare more powerful way to "
+"automatically determine which dialect to should be used by relying on a "
+"series of delegates which implement the <interfacename>org.hibernate.dialect."
+"resolver.DialectResolver</interfacename> which defines only a single method:"
+"<programlisting role=\"JAVA\"><![CDATA[public Dialect resolveDialect"
+"(DatabaseMetaData metaData) throws JDBCConnectionException]]></"
+"programlisting>. The basic contract here is that if the resolver "
+"'understands' the given database metadata then it returns the corresponding "
+"Dialect; if not it returns null and the process continues to the next "
+"resolver. The signature also identifies <exceptionname>org.hibernate."
+"exception.JDBCConnectionException</exceptionname> as possibly being thrown. "
+"A JDBCConnectionException here is interpreted to imply a \"non transient"
+"\" (aka non-recoverable) connection problem and is used to indicate an "
+"immediate stop to resolution attempts. All other exceptions result in a "
+"warning and continuing on to the next resolver."
+msgstr ""
+"从版本 3.3 开始,Hibernate 有了更为强大的自动决定应该使用哪个方言的方法,这根"
+"据一系列实现 <interfacename>org.hibernate.dialect.resolver.DialectResolver</"
+"interfacename> 接口的代理,它们只定义一个方法:<programlisting role=\"JAVA"
+"\">public Dialect resolveDialect(DatabaseMetaData metaData) throws "
+"JDBCConnectionException</programlisting>。这里的基本合约是如果解析者"
+"(resolver)“理解”给点数据库的元数据并返回对应的方言;否则返回 null 并使用下"
+"一个解析者。这个签名也指定可能抛出的异常 <exceptionname>org.hibernate."
+"exception.JDBCConnectionException</exceptionname>。这里的 "
+"JDBCConnectionException 被认为是“非瞬时的”(也就是不可恢复的)连接问题且指示"
+"立即终止解析。所有其他的异常都导致警告发出并使用下一个解析者。\""
#. Tag: para
+#: portability.xml:90
#, no-c-format
-msgid "The cool part about these resolvers is that users can also register their own custom resolvers which will be processed ahead of the built-in Hibernate ones. This might be useful in a number of different situations: it allows easy integration for auto-detection of dialects beyond those shipped with HIbernate itself; it allows you to specify to use a custom dialect when a particular database is recognized; etc. To register one or more resolvers, simply specify them (seperated by commas, tabs or spaces) using the 'hibernate.dialect_resolvers' configuration setting (see the <constant>DIALECT_RESOLVERS</constant> constant on <classname>org.hibernate.cfg.Environment</classname>)."
-msgstr "这些解析者最棒的功能是用户也可以注册自定义的解析者,它们将在内置的解析者之前被调用。在许多情况下这可能很有用:它可以轻易地集成内置方言之外的方言的自动检测;它让你可以使用自定义的方言等。要注册一个或多个解析者,只要用 'hibernate.dialect_resolvers' 配置设置指定它们(由逗号、制表符或空格隔开)就可以了(请参考 <classname>org.hibernate.cfg.Environment</classname> 上的 <constant>DIALECT_RESOLVERS</constant>)。"
+msgid ""
+"The cool part about these resolvers is that users can also register their "
+"own custom resolvers which will be processed ahead of the built-in Hibernate "
+"ones. This might be useful in a number of different situations: it allows "
+"easy integration for auto-detection of dialects beyond those shipped with "
+"HIbernate itself; it allows you to specify to use a custom dialect when a "
+"particular database is recognized; etc. To register one or more resolvers, "
+"simply specify them (seperated by commas, tabs or spaces) using the "
+"'hibernate.dialect_resolvers' configuration setting (see the "
+"<constant>DIALECT_RESOLVERS</constant> constant on <classname>org.hibernate."
+"cfg.Environment</classname>)."
+msgstr ""
+"这些解析者最棒的功能是用户也可以注册自定义的解析者,它们将在内置的解析者之前"
+"被调用。在许多情况下这可能很有用:它可以轻易地集成内置方言之外的方言的自动检"
+"测;它让你可以使用自定义的方言等。要注册一个或多个解析者,只要用 'hibernate."
+"dialect_resolvers' 配置设置指定它们(由逗号、制表符或空格隔开)就可以了(请参"
+"考 <classname>org.hibernate.cfg.Environment</classname> 上的 "
+"<constant>DIALECT_RESOLVERS</constant>)。"
#. Tag: title
+#: portability.xml:103
#, no-c-format
msgid "Identifier generation"
msgstr "标识符的生成"
#. Tag: para
-#, no-c-format
-msgid "When considering portability between databases, another important decision is selecting the identifier generation stratagy you want to use. Originally Hibernate provided the <emphasis>native</emphasis> generator for this purpose, which was intended to select between a <emphasis>sequence</emphasis>, <emphasis>identity</emphasis>, or <emphasis>table</emphasis> strategy depending on the capability of the underlying database. However, an insidious implication of this approach comes about when targtetting some databases which support <emphasis>identity</emphasis> generation and some which do not. <emphasis>identity</emphasis> generation relies on the SQL definition of an IDENTITY (or auto-increment) column to manage the identifier value; it is what is known as a post-insert generation strategy becauase the insert must actually happen before we can know the identifier value. Because Hibernate relies on this identifier value to uniquely reference entities within a persisten!
ce context it must then issue the insert immediately when the users requests the entitiy be associated with the session (like via save() e.g.) regardless of current transactional semantics."
-msgstr "当考虑数据库的移植性时,另外一个重要的考量是选择标识符生成策略。Hibernate 原先提供的 <emphasis>native</emphasis> 生成器的目的是根据底层数据库的能力在 <emphasis>sequence</emphasis>、<emphasis>identity</emphasis> 或 <emphasis>table</emphasis> 策略间进行选择。然而,这个方法一个潜在的问题是有些数据库支持<emphasis>标识符(identity)</emphasis>生成而有些则不支持。<emphasis>标识符(identity)</emphasis> 生成依赖于管理标识符值的 IDENTITY(或 auto-increment)字段的 SQL 定义。它也成为 post-insert 生成策略,因为 insert 必须在知道标识符值后才能实际发生。因为 Hibernate 依赖于这个标识符值来唯一地引用持久性上下文里的实体,当用户请求和会话相关联的实体时(如通过 save()),它必须立即执行 insert 语句而不管当前的事务性语义。"
+#: portability.xml:105
+#, fuzzy, no-c-format
+msgid ""
+"When considering portability between databases, another important decision "
+"is selecting the identifier generation stratagy you want to use. Originally "
+"Hibernate provided the <emphasis>native</emphasis> generator for this "
+"purpose, which was intended to select between a <emphasis>sequence</"
+"emphasis>, <emphasis>identity</emphasis>, or <emphasis>table</emphasis> "
+"strategy depending on the capability of the underlying database. However, an "
+"insidious implication of this approach comes about when targtetting some "
+"databases which support <emphasis>identity</emphasis> generation and some "
+"which do not. <emphasis>identity</emphasis> generation relies on the SQL "
+"definition of an IDENTITY (or auto-increment) column to manage the "
+"identifier value; it is what is known as a post-insert generation strategy "
+"becauase the insert must actually happen before we can know the identifier "
+"value. Because Hibernate relies on this identifier value to uniquely "
+"reference entities within a persistence context it must then issue the "
+"insert immediately when the users requests the entitiy be associated with "
+"the session (like via save() e.g.) regardless of current transactional "
+"semantics. <note> <para> Hibernate was changed slightly once the implication "
+"of this was better understood so that the insert is delayed in cases where "
+"that is feasible. </para> </note> The underlying issue is that the actual "
+"semanctics of the application itself changes in these cases."
+msgstr ""
+"当考虑数据库的移植性时,另外一个重要的考量是选择标识符生成策略。Hibernate 原"
+"先提供的 <emphasis>native</emphasis> 生成器的目的是根据底层数据库的能力在 "
+"<emphasis>sequence</emphasis>、<emphasis>identity</emphasis> 或 "
+"<emphasis>table</emphasis> 策略间进行选择。然而,这个方法一个潜在的问题是有些"
+"数据库支持<emphasis>标识符(identity)</emphasis>生成而有些则不支持。"
+"<emphasis>标识符(identity)</emphasis> 生成依赖于管理标识符值的 IDENTITY"
+"(或 auto-increment)字段的 SQL 定义。它也成为 post-insert 生成策略,因为 "
+"insert 必须在知道标识符值后才能实际发生。因为 Hibernate 依赖于这个标识符值来"
+"唯一地引用持久性上下文里的实体,当用户请求和会话相关联的实体时(如通过 save"
+"()),它必须立即执行 insert 语句而不管当前的事务性语义。"
#. Tag: para
+#: portability.xml:130
#, no-c-format
-msgid "Hibernate was changed slightly once the implication of this was better understood so that the insert is delayed in cases where that is feasible."
-msgstr "Hibernate 已经进行了轻微改进,所以在可行时这种插入会被延迟。"
+msgid ""
+"Starting with version 3.2.3, Hibernate comes with a set of <ulink url="
+"\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier generators "
+"targetting portability in a much different way. <note> <para> There are "
+"specifically 2 bundled <emphasis>enhanced</emphasis>generators: "
+"<itemizedlist> <listitem> <para> <classname>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</classname> </para> </listitem> <listitem> <para> "
+"<classname>org.hibernate.id.enhanced.TableGenerator</classname> </para> </"
+"listitem> </itemizedlist> </para> </note> The idea behind these generators "
+"is to port the actual semantics of the identifer value generation to the "
+"different databases. For example, the <classname>org.hibernate.id.enhanced."
+"SequenceStyleGenerator</classname> mimics the behavior of a sequence on "
+"databases which do not support sequences by using a table."
+msgstr ""
-#. Tag: note
-#, no-c-format
-msgid "The underlying issue is that the actual semanctics of the application itself changes in these cases."
-msgstr "底层的问题是这些例子里应用程序自身的实际模式的改变。"
-
-#. Tag: para
-#, no-c-format
-msgid "Starting with version 3.2.3, Hibernate comes with a set of <ulink url=\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier generators targetting portability in a much different way."
-msgstr "从 3.2.3 版本开始,Hibernate 带有一套 <ulink url=\"http://in.relation.to/2082.lace\">enhanced</ulink> 标识符生成器,它以很不同的方式实现移植性。"
-
-#. Tag: para
-#, no-c-format
-msgid "There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
-msgstr "特别是两个捆绑的 <emphasis>enhanced</emphasis> 生成器:"
-
-#. Tag: para
-#, no-c-format
-msgid "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
-msgstr "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
-
-#. Tag: para
-#, no-c-format
-msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
-msgstr "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
-
-#. Tag: note
-#, no-c-format
-msgid "The idea behind these generators is to port the actual semantics of the identifer value generation to the different databases. For example, the <classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> mimics the behavior of a sequence on databases which do not support sequences by using a table."
-msgstr "这些生成器背后的概念是把标识符值生成的实际情景移植到不同的数据库里。例如,<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> 通过使用表来模拟不支持序列(sequences)的数据库上的序列行为。"
-
#. Tag: title
+#: portability.xml:159
#, no-c-format
msgid "Database functions"
msgstr "数据库函数"
#. Tag: para
+#: portability.xml:162
#, no-c-format
-msgid "This is an area in Hibernate in need of improvement. In terms of portability concerns, this function handling currently works pretty well from HQL; however, it is quite lacking in all other aspects."
-msgstr "这是 Hibernate 需要提高的一个领域。从可移植性来说,这个功能可以很好地处理 HQL 的内容,但在其他方面就有所欠缺。"
+msgid ""
+"This is an area in Hibernate in need of improvement. In terms of portability "
+"concerns, this function handling currently works pretty well from HQL; "
+"however, it is quite lacking in all other aspects."
+msgstr ""
+"这是 Hibernate 需要提高的一个领域。从可移植性来说,这个功能可以很好地处理 "
+"HQL 的内容,但在其他方面就有所欠缺。"
#. Tag: para
+#: portability.xml:169
#, no-c-format
-msgid "SQL functions can be referenced in many ways by users. However, not all databases support the same set of functions. Hibernate, provides a means of mapping a <emphasis>logical</emphasis> function name to a delegate which knows how to render that particular function, perhaps even using a totally different physical function call."
-msgstr "用户可以以多种方式引用 SQL 函数。然而,不是所有的数据库都支持相同的函数集。Hibernate 提供了一种映射<emphasis>逻辑</emphasis>函数名到代理的方法,这个代理知道如何解析特定的函数,甚至可能使用完全不同的物理函数调用。 "
+msgid ""
+"SQL functions can be referenced in many ways by users. However, not all "
+"databases support the same set of functions. Hibernate, provides a means of "
+"mapping a <emphasis>logical</emphasis> function name to a delegate which "
+"knows how to render that particular function, perhaps even using a totally "
+"different physical function call."
+msgstr ""
+"用户可以以多种方式引用 SQL 函数。然而,不是所有的数据库都支持相同的函数集。"
+"Hibernate 提供了一种映射<emphasis>逻辑</emphasis>函数名到代理的方法,这个代理"
+"知道如何解析特定的函数,甚至可能使用完全不同的物理函数调用。 "
#. Tag: para
+#: portability.xml:175
#, no-c-format
-msgid "Technically this function registration is handled through the <classname>org.hibernate.dialect.function.SQLFunctionRegistry</classname> class which is intended to allow users to provide custom function definitions without having to provide a custom dialect. This specific behavior is not fully completed as of yet."
-msgstr "从技术上来讲,这个函数注册是通过 <classname>org.hibernate.dialect.function.SQLFunctionRegistry</classname> 类进行处理的,它的目的是允许用户提供自定义的函数定义而无需提供自定义的方言。这种特殊的行为目前还未全部开发完毕。"
+msgid ""
+"Technically this function registration is handled through the <classname>org."
+"hibernate.dialect.function.SQLFunctionRegistry</classname> class which is "
+"intended to allow users to provide custom function definitions without "
+"having to provide a custom dialect. This specific behavior is not fully "
+"completed as of yet."
+msgstr ""
+"从技术上来讲,这个函数注册是通过 <classname>org.hibernate.dialect.function."
+"SQLFunctionRegistry</classname> 类进行处理的,它的目的是允许用户提供自定义的"
+"函数定义而无需提供自定义的方言。这种特殊的行为目前还未全部开发完毕。"
#. Tag: para
+#: portability.xml:182
#, no-c-format
-msgid "It is sort of implemented such that users can programatically register functions with the <classname>org.hibernate.cfg.Configuration</classname> and those functions will be recognized for HQL."
-msgstr "其中一些功能已经实现,如用户可以在程序里用 <classname>org.hibernate.cfg.Configuration</classname> 注册函数且这些函数可被 HQL 识别。"
+msgid ""
+"It is sort of implemented such that users can programatically register "
+"functions with the <classname>org.hibernate.cfg.Configuration</classname> "
+"and those functions will be recognized for HQL."
+msgstr ""
+"其中一些功能已经实现,如用户可以在程序里用 <classname>org.hibernate.cfg."
+"Configuration</classname> 注册函数且这些函数可被 HQL 识别。"
#. Tag: title
+#: portability.xml:192
#, no-c-format
msgid "Type mappings"
msgstr "类型映射"
#. Tag: para
+#: portability.xml:194
#, no-c-format
msgid "This section scheduled for completion at a later date..."
msgstr "本节内容仍未完成..."
#~ msgid ""
+#~ "Hibernate was changed slightly once the implication of this was better "
+#~ "understood so that the insert is delayed in cases where that is feasible."
+#~ msgstr "Hibernate 已经进行了轻微改进,所以在可行时这种插入会被延迟。"
+
+#~ msgid ""
+#~ "The underlying issue is that the actual semanctics of the application "
+#~ "itself changes in these cases."
+#~ msgstr "底层的问题是这些例子里应用程序自身的实际模式的改变。"
+
+#~ msgid ""
+#~ "Starting with version 3.2.3, Hibernate comes with a set of <ulink url="
+#~ "\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier "
+#~ "generators targetting portability in a much different way."
+#~ msgstr ""
+#~ "从 3.2.3 版本开始,Hibernate 带有一套 <ulink url=\"http://in.relation."
+#~ "to/2082.lace\">enhanced</ulink> 标识符生成器,它以很不同的方式实现移植性。"
+
+#~ msgid ""
+#~ "There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
+#~ msgstr "特别是两个捆绑的 <emphasis>enhanced</emphasis> 生成器:"
+
+#~ msgid ""
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
+#~ msgstr ""
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
+
+#~ msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
+#~ msgstr "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
+
+#~ msgid ""
+#~ "The idea behind these generators is to port the actual semantics of the "
+#~ "identifer value generation to the different databases. For example, the "
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> "
+#~ "mimics the behavior of a sequence on databases which do not support "
+#~ "sequences by using a table."
+#~ msgstr ""
+#~ "这些生成器背后的概念是把标识符值生成的实际情景移植到不同的数据库里。例如,"
+#~ "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> 通"
+#~ "过使用表来模拟不支持序列(sequences)的数据库上的序列行为。"
+
+#~ msgid ""
#~ "This is a new area in Hibernate and as such it is not as mature as the "
#~ "overall Hibernate experience."
#~ msgstr "这是 Hibernate 的一个新的领域,暂时还不如 Hibernate 总体那么成熟。"
-
Added: core/trunk/documentation/manual/src/main/docbook/zh-CN/content/readonly.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/zh-CN/content/readonly.po (rev 0)
+++ core/trunk/documentation/manual/src/main/docbook/zh-CN/content/readonly.po 2010-03-25 06:51:01 UTC (rev 19112)
@@ -0,0 +1,1124 @@
+# Language zh-CN translations for PACKAGE package.
+# Automatically generated, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-03-25 06:26+0000\n"
+"PO-Revision-Date: 2010-03-25 06:26+0000\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Tag: title
+#: readonly.xml:33
+#, no-c-format
+msgid "Read-only entities"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:36
+#, no-c-format
+msgid ""
+"Hibernate's treatment of <emphasis>read-only</emphasis> entities may differ "
+"from what you may have encountered elsewhere. Incorrect usage may cause "
+"unexpected results."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:43
+#, no-c-format
+msgid "When an entity is read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:48
+#, no-c-format
+msgid ""
+"Hibernate does not dirty-check the entity's simple properties or single-"
+"ended associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:54
+#, no-c-format
+msgid ""
+"Hibernate will not update simple properties or updatable single-ended "
+"associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:60
+#, no-c-format
+msgid ""
+"Hibernate will not update the version of the read-only entity if only simple "
+"properties or single-ended updatable associations are changed;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:69
+#, no-c-format
+msgid ""
+"In some ways, Hibernate treats read-only entities the same as entities that "
+"are not read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:75
+#, no-c-format
+msgid ""
+"Hibernate cascades operations to associations as defined in the entity "
+"mapping."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:81
+#, no-c-format
+msgid ""
+"Hibernate updates the version if the entity has a collection with changes "
+"that dirties the entity;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:87
+#, no-c-format
+msgid "A read-only entity can be deleted."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:94
+#, no-c-format
+msgid ""
+"Even if an entity is not read-only, its collection association can be "
+"affected if it contains a read-only entity."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:99
+#, no-c-format
+msgid ""
+"For details about the affect of read-only entities on different property and "
+"association types, see <xref linkend=\"readonly-proptypes\"/>."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:105
+#, no-c-format
+msgid "For details about how to make entities read-only, see"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:110
+#, no-c-format
+msgid "Hibernate does some optimizing for read-only entities:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:115
+#, no-c-format
+msgid ""
+"It saves execution time by not dirty-checking simple properties or single-"
+"ended associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:121
+#, no-c-format
+msgid "It saves memory by deleting database snapshots."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:128
+#, no-c-format
+msgid "Making persistent entities read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:130
+#, no-c-format
+msgid ""
+"Only persistent entities can be made read-only. Transient and detached "
+"entities must be put in persistent state before they can be made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:136
+#, no-c-format
+msgid ""
+"Hibernate provides the following ways to make persistent entities read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:142
+#, no-c-format
+msgid ""
+"you can map an entity class as <emphasis>immutable</emphasis>; when an "
+"entity of an immutable class is made persistent, Hibernate automatically "
+"makes it read-only. see <xref linkend=\"readonly-api-immutable\"/> for "
+"details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:150
+#, no-c-format
+msgid ""
+"you can change a default so that entities loaded into the session by "
+"Hibernate are automatically made read-only; see <xref linkend=\"readonly-api-"
+"loaddefault\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:157
+#, no-c-format
+msgid ""
+"you can make an HQL query or criteria read-only so that entities loaded when "
+"the query or criteria executes, scrolls, or iterates, are automatically made "
+"read-only; see <xref linkend=\"readonly-api-querycriteria\"/> for details"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:165
+#, no-c-format
+msgid ""
+"you can make a persistent entity that is already in the in the session read-"
+"only; see <xref linkend=\"readonly-api-entity\"/> for details"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:174
+#, no-c-format
+msgid "Entities of immutable classes"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:176
+#, no-c-format
+msgid ""
+"When an entity instance of an immutable class is made persistent, Hibernate "
+"automatically makes it read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:180
+#, no-c-format
+msgid ""
+"An entity of an immutable class can created and deleted the same as an "
+"entity of a mutable class."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:185
+#, no-c-format
+msgid ""
+"Hibernate treats a persistent entity of an immutable class the same way as a "
+"read-only persistent entity of a mutable class. The only exception is that "
+"Hibernate will not allow an entity of an immutable class to be changed so it "
+"is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:196
+#, no-c-format
+msgid "Loading persistent entities as read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:199 readonly.xml:286
+#, no-c-format
+msgid "Entities of immutable classes are automatically loaded as read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:205
+#, no-c-format
+msgid ""
+"To change the default behavior so Hibernate loads entity instances of "
+"mutable classes into the session and automatically makes them read-only, "
+"call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:210
+#, no-c-format
+msgid "Session.setDefaultReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:212
+#, no-c-format
+msgid ""
+"To change the default back so entities loaded by Hibernate are not made read-"
+"only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:216
+#, no-c-format
+msgid "Session.setDefaultReadOnly( false );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:218
+#, no-c-format
+msgid "You can determine the current setting by calling:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:221
+#, no-c-format
+msgid "Session.isDefaultReadOnly();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:223
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns true, entities loaded by the "
+"following are automatically made read-only:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:229
+#, no-c-format
+msgid "Session.load()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:234
+#, no-c-format
+msgid "Session.get()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:239
+#, no-c-format
+msgid "Session.merge()"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:244
+#, no-c-format
+msgid ""
+"executing, scrolling, or iterating HQL queries and criteria; to override "
+"this setting for a particular HQL query or criteria see"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:253
+#, no-c-format
+msgid "Changing this default has no effect on:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:258
+#, no-c-format
+msgid "persistent entities already in the session when the default was changed"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:264
+#, no-c-format
+msgid ""
+"persistent entities that are refreshed via Session.refresh(); a refreshed "
+"persistent entity will only be read-only if it was read-only before "
+"refreshing"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:272
+#, no-c-format
+msgid ""
+"persistent entities added by the application via Session.persist(), Session."
+"save(), and Session.update() Session.saveOrUpdate()"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:283
+#, no-c-format
+msgid "Loading read-only entities from an HQL query/criteria"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:292
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns false (the default) when an HQL query "
+"or criteria executes, then entities and proxies of mutable classes loaded by "
+"the query will not be read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:299
+#, no-c-format
+msgid ""
+"You can override this behavior so that entities and proxies loaded by an HQL "
+"query or criteria are automatically made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:304
+#, no-c-format
+msgid "For an HQL query, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:307
+#, no-c-format
+msgid "Query.setReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:309
+#, no-c-format
+msgid ""
+"<literal>Query.setReadOnly( true )</literal> must be called before "
+"<literal>Query.list()</literal>, <literal>Query.uniqueResult()</literal>, "
+"<literal>Query.scroll()</literal>, or <literal>Query.iterate()</literal>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:315
+#, no-c-format
+msgid "For an HQL criteria, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:318
+#, no-c-format
+msgid "Criteria.setReadOnly( true );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:320
+#, no-c-format
+msgid ""
+"<literal>Criteria.setReadOnly( true )</literal> must be called before "
+"<literal>Criteria.list()</literal>, <literal>Criteria.uniqueResult()</"
+"literal>, or <literal>Criteria.scroll()</literal>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:326
+#, no-c-format
+msgid ""
+"Entities and proxies that exist in the session before being returned by an "
+"HQL query or criteria are not affected."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:331
+#, no-c-format
+msgid ""
+"Uninitialized persistent collections returned by the query are not affected. "
+"Later, when the collection is initialized, entities loaded into the session "
+"will be read-only if Session.isDefaultReadOnly() returns true."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:338
+#, no-c-format
+msgid ""
+"Using <literal>Query.setReadOnly( true )</literal> or <literal>Criteria."
+"setReadOnly( true )</literal> works well when a single HQL query or criteria "
+"loads all the entities and intializes all the proxies and collections that "
+"the application needs to be read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:346
+#, no-c-format
+msgid ""
+"When it is not possible to load and initialize all necessary entities in a "
+"single query or criteria, you can temporarily change the session default to "
+"load entities as read-only before the query is executed. Then you can "
+"explicitly initialize proxies and collections before restoring the session "
+"default."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:355
+#, no-c-format
+msgid ""
+"Session session = factory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+" \n"
+"setDefaultReadOnly( true );\n"
+"Contract contract = \n"
+" ( Contract ) session.createQuery(\n"
+" \"from Contract where customerName = 'Sherman'\" )\n"
+" .uniqueResult();\n"
+"Hibernate.initialize( contract.getPlan() );\n"
+"Hibernate.initialize( contract.getVariations() );\n"
+"Hibernate.initialize( contract.getNotes() );\n"
+"setDefaultReadOnly( false );\n"
+"...\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:357
+#, no-c-format
+msgid ""
+"If Session.isDefaultReadOnly() returns true, then you can use Query."
+"setReadOnly( false ) and Criteria.setReadOnly( false ) to override this "
+"session setting and load entities that are not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:367
+#, no-c-format
+msgid "Making a persistent entity read-only"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:369
+#, no-c-format
+msgid ""
+"Persistent entities of immutable classes are automatically made read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:375
+#, no-c-format
+msgid "To make a persistent entity or proxy read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:378
+#, no-c-format
+msgid "Session.setReadOnly(entityOrProxy, true)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:380
+#, no-c-format
+msgid ""
+"To change a read-only entity or proxy of a mutable class so it is no longer "
+"read-only, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:384
+#, no-c-format
+msgid "Session.setReadOnly(entityOrProxy, false)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:387
+#, no-c-format
+msgid ""
+"When a read-only entity or proxy is changed so it is no longer read-only, "
+"Hibernate assumes that the current state of the read-only entity is "
+"consistent with its database representation. If this is not true, then any "
+"non-flushed changes made before or while the entity was read-only, will be "
+"ignored."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:396
+#, no-c-format
+msgid ""
+"To throw away non-flushed changes and make the persistent entity consistent "
+"with its database representation, call:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:400
+#, no-c-format
+msgid "session.refresh( entity );"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:402
+#, no-c-format
+msgid ""
+"To flush changes made before or while the entity was read-only and make the "
+"database representation consistent with the current state of the persistent "
+"entity:"
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:408
+#, no-c-format
+msgid ""
+"// evict the read-only entity so it is detached\n"
+"session.evict( entity );\n"
+"\n"
+"// make the detached entity (with the non-flushed changes) persistent\n"
+"session.update( entity );\n"
+"\n"
+"// now entity is no longer read-only and its changes can be flushed\n"
+"s.flush();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:413
+#, no-c-format
+msgid "Read-only affect on property type"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:415
+#, no-c-format
+msgid ""
+"The following table summarizes how different property types are affected by "
+"making an entity read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:421
+#, no-c-format
+msgid "Affect of read-only entity on property types"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:427
+#, no-c-format
+msgid "Property/Association Type"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:428
+#, no-c-format
+msgid "Changes flushed to DB?"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:433
+#, no-c-format
+msgid "Simple"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:435
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-simple\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:439
+#, no-c-format
+msgid "<entry>no*</entry>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:443
+#, no-c-format
+msgid "Unidirectional one-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:444
+#, no-c-format
+msgid "Unidirectional many-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:445
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-singleended-unidir\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:451 readonly.xml:452
+#, no-c-format
+msgid "<para>no*</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:457
+#, no-c-format
+msgid "Unidirectional one-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:458
+#, no-c-format
+msgid "Unidirectional many-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:459
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-manyended-unidir\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:464 readonly.xml:465 readonly.xml:489
+#, no-c-format
+msgid "<para>yes</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:470
+#, no-c-format
+msgid "<para>Bidirectional one-to-one</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:471
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-onetoone-bidir\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:475
+#, no-c-format
+msgid "only if the owning entity is not read-only*"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:479
+#, no-c-format
+msgid "<para>Bidirectional one-to-many/many-to-one</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:480
+#, no-c-format
+msgid "inverse collection"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:481
+#, no-c-format
+msgid "non-inverse collection"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:482
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-onetomany-manytoone\"/>)"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:488
+#, no-c-format
+msgid "only added/removed entities that are not read-only*"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:494
+#, no-c-format
+msgid "<para>Bidirectional many-to-many</para>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:495
+#, no-c-format
+msgid "(<xref linkend=\"readonly-proptypes-manytomany-bidir\"/>)"
+msgstr ""
+
+#. Tag: entry
+#: readonly.xml:499
+#, no-c-format
+msgid "<entry>yes</entry>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:505
+#, no-c-format
+msgid ""
+"* Behavior is different when the entity having the property/association is "
+"read-only, compared to when it is not read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:511
+#, no-c-format
+msgid "Simple properties"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:513
+#, no-c-format
+msgid ""
+"When a persistent object is read-only, Hibernate does not dirty-check simple "
+"properties."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:518
+#, no-c-format
+msgid ""
+"Hibernate will not synchronize simple property state changes to the "
+"database. If you have automatic versioning, Hibernate will not increment the "
+"version if any simple properties change."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:524
+#, no-c-format
+msgid ""
+"Session session = factory.openSession();\n"
+"Transaction tx = session.beginTransaction();\n"
+"\n"
+"// get a contract and make it read-only\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"\n"
+"// contract.getCustomerName() is \"Sherman\"\n"
+"contract.setCustomerName( \"Yogi\" );\n"
+"tx.commit();\n"
+"\n"
+"tx = session.beginTransaction();\n"
+"\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"// contract.getCustomerName() is still \"Sherman\"\n"
+"...\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:529
+#, no-c-format
+msgid "Unidirectional associations"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:532
+#, no-c-format
+msgid "Unidirectional one-to-one and many-to-one"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:534
+#, no-c-format
+msgid ""
+"Hibernate treats unidirectional one-to-one and many-to-one associations in "
+"the same way when the owning entity is read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:540
+#, no-c-format
+msgid ""
+"We use the term <emphasis>unidirectional single-ended association</emphasis> "
+"when referring to functionality that is common to unidirectional one-to-one "
+"and many-to-one associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:547
+#, no-c-format
+msgid ""
+"Hibernate does not dirty-check unidirectional single-ended associations when "
+"the owning entity is read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:552
+#, no-c-format
+msgid ""
+"If you change a read-only entity's reference to a unidirectional single-"
+"ended association to null, or to refer to a different entity, that change "
+"will not be flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:560
+#, no-c-format
+msgid ""
+"If an entity is of an immutable class, then its references to unidirectional "
+"single-ended associations must be assigned when that entity is first "
+"created. Because the entity is automatically made read-only, these "
+"references can not be updated."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:570
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will not increment the version "
+"due to local changes to unidirectional single-ended associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:576
+#, no-c-format
+msgid ""
+"In the following examples, Contract has a unidirectional many-to-one "
+"association with Plan. Contract cascades save and update operations to the "
+"association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:582
+#, no-c-format
+msgid ""
+"The following shows that changing a read-only entity's many-to-one "
+"association reference to null has no effect on the entity's database "
+"representation."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:588
+#, no-c-format
+msgid ""
+"// get a contract with an existing plan;\n"
+"// make the contract read-only and set its plan to null \n"
+"tx = session.beginTransaction();\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"contract.setPlan( null );\n"
+"tx.commit();\n"
+"\n"
+"// get the same contract\n"
+"tx = session.beginTransaction();\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"\n"
+"// contract.getPlan() still refers to the original plan;\n"
+"\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:590
+#, no-c-format
+msgid ""
+"The following shows that, even though an update to a read-only entity's many-"
+"to-one association has no affect on the entity's database representation, "
+"flush still cascades the save-update operation to the locally changed "
+"association."
+msgstr ""
+
+#. Tag: programlisting
+#: readonly.xml:599
+#, no-c-format
+msgid ""
+"// get a contract with an existing plan;\n"
+"// make the contract read-only and change to a new plan\n"
+"tx = session.beginTransaction();\n"
+"Contract contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"session.setReadOnly( contract, true );\n"
+"Plan newPlan = new Plan( \"new plan\"\n"
+"contract.setPlan( newPlan);\n"
+"tx.commit();\n"
+"\n"
+"// get the same contract\n"
+"tx = session.beginTransaction();\n"
+"contract = ( Contract ) session.get( Contract.class, contractId );\n"
+"newPlan = ( Contract ) session.get( Plan.class, newPlan.getId() ); \n"
+"\n"
+"// contract.getPlan() still refers to the original plan;\n"
+"// newPlan is non-null because it was persisted when \n"
+"// the previous transaction was committed; \n"
+"\n"
+"tx.commit();\n"
+"session.close();"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:604
+#, no-c-format
+msgid "Unidirectional one-to-many and many-to-many"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:606
+#, no-c-format
+msgid ""
+"Hibernate treats unidirectional one-to-many and many-to-many associations "
+"owned by a read-only entity the same as when owned by an entity that is not "
+"read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:613
+#, no-c-format
+msgid ""
+"Hibernate dirty-checks unidirectional one-to-many and many-to-many "
+"associations;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:618
+#, no-c-format
+msgid ""
+"The collection can contain entities that are read-only, as well as entities "
+"that are not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:624
+#, no-c-format
+msgid ""
+"Entities can be added and removed from the collection; changes are flushed "
+"to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:629
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will update the version due to "
+"changes in the collection if they dirty the owning entity."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:640
+#, no-c-format
+msgid "Bidirectional associations"
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:643
+#, no-c-format
+msgid "<title>Bidirectional one-to-one</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:645
+#, no-c-format
+msgid "If a read-only entity owns a bidirectional one-to-one association:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:652
+#, no-c-format
+msgid "Hibernate does not dirty-check the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:657
+#, no-c-format
+msgid ""
+"updates that change the association reference to null or to refer to a "
+"different entity will not be flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:664
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will not increment the version "
+"due to local changes to the association."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:673
+#, no-c-format
+msgid ""
+"If an entity is of an immutable class, and it owns a bidirectional one-to-"
+"one association, then its reference must be assigned when that entity is "
+"first created. Because the entity is automatically made read-only, these "
+"references cannot be updated."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:683
+#, no-c-format
+msgid ""
+"When the owner is not read-only, Hibernate treats an association with a read-"
+"only entity the same as when the association is with an entity that is not "
+"read-only."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:693
+#, no-c-format
+msgid "<title>Bidirectional one-to-many/many-to-one</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:695
+#, no-c-format
+msgid ""
+"A read-only entity has no impact on a bidirectional one-to-many/many-to-one "
+"association if:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:702
+#, no-c-format
+msgid ""
+"the read-only entity is on the one-to-many side using an inverse collection;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:708
+#, no-c-format
+msgid ""
+"the read-only entity is on the one-to-many side using a non-inverse "
+"collection;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:714
+#, no-c-format
+msgid ""
+"the one-to-many side uses a non-inverse collection that contains the read-"
+"only entity"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:721
+#, no-c-format
+msgid "When the one-to-many side uses an inverse collection:"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:727
+#, no-c-format
+msgid ""
+"a read-only entity can only be added to the collection when it is created;"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:733
+#, no-c-format
+msgid ""
+"a read-only entity can only be removed from the collection by an orphan "
+"delete or by explicitly deleting the entity."
+msgstr ""
+
+#. Tag: title
+#: readonly.xml:744
+#, no-c-format
+msgid "<title>Bidirectional many-to-many</title>"
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:745
+#, no-c-format
+msgid ""
+"Hibernate treats bidirectional many-to-many associations owned by a read-"
+"only entity the same as when owned by an entity that is not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:752
+#, no-c-format
+msgid "Hibernate dirty-checks bidirectional many-to-many associations."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:757
+#, no-c-format
+msgid ""
+"The collection on either side of the association can contain entities that "
+"are read-only, as well as entities that are not read-only."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:763
+#, no-c-format
+msgid ""
+"Entities are added and removed from both sides of the collection; changes "
+"are flushed to the database."
+msgstr ""
+
+#. Tag: para
+#: readonly.xml:769
+#, no-c-format
+msgid ""
+"If automatic versioning is used, Hibernate will update the version due to "
+"changes in both sides of the collection if they dirty the entity owning the "
+"respective collections."
+msgstr ""
14 years, 8 months
Hibernate SVN: r19111 - search/trunk/hibernate-search.
by hibernate-commits@lists.jboss.org
Author: sannegrinovero
Date: 2010-03-24 18:47:51 -0400 (Wed, 24 Mar 2010)
New Revision: 19111
Modified:
search/trunk/hibernate-search/pom.xml
Log:
fix build: missing dependency
Modified: search/trunk/hibernate-search/pom.xml
===================================================================
--- search/trunk/hibernate-search/pom.xml 2010-03-24 19:18:08 UTC (rev 19110)
+++ search/trunk/hibernate-search/pom.xml 2010-03-24 22:47:51 UTC (rev 19111)
@@ -95,7 +95,11 @@
<artifactId>jms</artifactId>
<scope>provided</scope>
</dependency>
-
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
14 years, 8 months
Hibernate SVN: r19110 - in core/trunk: core/src/main/java/org/hibernate/loader/criteria and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-03-24 15:18:08 -0400 (Wed, 24 Mar 2010)
New Revision: 19110
Added:
core/trunk/core/src/main/java/org/hibernate/criterion/EnhancedProjection.java
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CityState.java
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CourseMeeting.java
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CourseMeetingId.java
Modified:
core/trunk/core/src/main/java/org/hibernate/criterion/AliasedProjection.java
core/trunk/core/src/main/java/org/hibernate/criterion/Distinct.java
core/trunk/core/src/main/java/org/hibernate/criterion/IdentifierProjection.java
core/trunk/core/src/main/java/org/hibernate/criterion/ProjectionList.java
core/trunk/core/src/main/java/org/hibernate/criterion/PropertyProjection.java
core/trunk/core/src/main/java/org/hibernate/criterion/SimpleProjection.java
core/trunk/core/src/main/java/org/hibernate/loader/criteria/CriteriaLoader.java
core/trunk/core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Course.java
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Enrolment.hbm.xml
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Student.java
Log:
HHH-1088 : Add support for projections using composite keys and components
Modified: core/trunk/core/src/main/java/org/hibernate/criterion/AliasedProjection.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/criterion/AliasedProjection.java 2010-03-24 18:24:39 UTC (rev 19109)
+++ core/trunk/core/src/main/java/org/hibernate/criterion/AliasedProjection.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -31,7 +31,7 @@
/**
* @author Gavin King
*/
-public class AliasedProjection implements Projection {
+public class AliasedProjection implements EnhancedProjection {
private final Projection projection;
private final String alias;
@@ -64,7 +64,13 @@
return projection.getColumnAliases(loc);
}
- public Type[] getTypes(String alias, Criteria criteria, CriteriaQuery criteriaQuery)
+ public String[] getColumnAliases(int loc, Criteria criteria, CriteriaQuery criteriaQuery) {
+ return projection instanceof EnhancedProjection ?
+ ( ( EnhancedProjection ) projection ).getColumnAliases( loc, criteria, criteriaQuery ) :
+ getColumnAliases( loc );
+ }
+
+ public Type[] getTypes(String alias, Criteria criteria, CriteriaQuery criteriaQuery)
throws HibernateException {
return this.alias.equals(alias) ?
getTypes(criteria, criteriaQuery) :
@@ -77,6 +83,12 @@
null;
}
+ public String[] getColumnAliases(String alias, int loc, Criteria criteria, CriteriaQuery criteriaQuery) {
+ return this.alias.equals(alias) ?
+ getColumnAliases( loc, criteria, criteriaQuery ) :
+ null;
+ }
+
public String[] getAliases() {
return new String[]{ alias };
}
Modified: core/trunk/core/src/main/java/org/hibernate/criterion/Distinct.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/criterion/Distinct.java 2010-03-24 18:24:39 UTC (rev 19109)
+++ core/trunk/core/src/main/java/org/hibernate/criterion/Distinct.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -31,7 +31,7 @@
/**
* @author Gavin King
*/
-public class Distinct implements Projection {
+public class Distinct implements EnhancedProjection {
private final Projection projection;
@@ -63,10 +63,22 @@
return projection.getColumnAliases(loc);
}
+ public String[] getColumnAliases(int loc, Criteria criteria, CriteriaQuery criteriaQuery) {
+ return projection instanceof EnhancedProjection ?
+ ( ( EnhancedProjection ) projection ).getColumnAliases( loc, criteria, criteriaQuery ) :
+ getColumnAliases( loc );
+ }
+
public String[] getColumnAliases(String alias, int loc) {
return projection.getColumnAliases(alias, loc);
}
+ public String[] getColumnAliases(String alias, int loc, Criteria criteria, CriteriaQuery criteriaQuery) {
+ return projection instanceof EnhancedProjection ?
+ ( ( EnhancedProjection ) projection ).getColumnAliases( alias, loc, criteria, criteriaQuery ) :
+ getColumnAliases( alias, loc );
+ }
+
public String[] getAliases() {
return projection.getAliases();
}
Added: core/trunk/core/src/main/java/org/hibernate/criterion/EnhancedProjection.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/criterion/EnhancedProjection.java (rev 0)
+++ core/trunk/core/src/main/java/org/hibernate/criterion/EnhancedProjection.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -0,0 +1,70 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ *
+ */
+package org.hibernate.criterion;
+
+
+import java.io.Serializable;
+
+import org.hibernate.Criteria;
+import org.hibernate.HibernateException;
+import org.hibernate.type.Type;
+
+/**
+ * An "enhanced" Projection for a {@link Criteria} query.
+ *
+ * @author Gail Badner
+ * @see Projection
+ * @see Criteria
+ */
+public interface EnhancedProjection extends Projection {
+
+ /**
+ * Get the SQL column aliases used by this projection for the columns it writes for inclusion into the
+ * <tt>SELECT</tt> clause ({@link #toSqlString}. Hibernate always uses column aliases to extract data from the
+ * JDBC {@link java.sql.ResultSet}, so it is important that these be implemented correctly in order for
+ * Hibernate to be able to extract these val;ues correctly.
+ *
+ * @param position Just as in {@link #toSqlString}, represents the number of <b>columns</b> rendered
+ * prior to this projection.
+ * @param criteria The local criteria to which this project is attached (for resolution).
+ * @param criteriaQuery The overall criteria query instance.
+ * @return The columns aliases.
+ */
+ public String[] getColumnAliases(int position, Criteria criteria, CriteriaQuery criteriaQuery);
+
+ /**
+ * Get the SQL column aliases used by this projection for the columns it writes for inclusion into the
+ * <tt>SELECT</tt> clause ({@link #toSqlString} <i>for a particular criteria-level alias</i>.
+ *
+ * @param alias The criteria-level alias
+ * @param position Just as in {@link #toSqlString}, represents the number of <b>columns</b> rendered
+ * prior to this projection.
+ * @param criteria The local criteria to which this project is attached (for resolution).
+ * @param criteriaQuery The overall criteria query instance.
+ * @return The columns aliases pertaining to a particular criteria-level alias; expected to return null if
+ * this projection does not understand this alias.
+ */
+ public String[] getColumnAliases(String alias, int position, Criteria criteria, CriteriaQuery criteriaQuery);
+}
Modified: core/trunk/core/src/main/java/org/hibernate/criterion/IdentifierProjection.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/criterion/IdentifierProjection.java 2010-03-24 18:24:39 UTC (rev 19109)
+++ core/trunk/core/src/main/java/org/hibernate/criterion/IdentifierProjection.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -63,6 +63,8 @@
.append(" as y")
.append(position + i)
.append('_');
+ if (i < cols.length -1)
+ buf.append(", ");
}
return buf.toString();
}
Modified: core/trunk/core/src/main/java/org/hibernate/criterion/ProjectionList.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/criterion/ProjectionList.java 2010-03-24 18:24:39 UTC (rev 19109)
+++ core/trunk/core/src/main/java/org/hibernate/criterion/ProjectionList.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -35,7 +35,7 @@
/**
* @author Gavin King
*/
-public class ProjectionList implements Projection {
+public class ProjectionList implements EnhancedProjection {
private List elements = new ArrayList();
@@ -70,7 +70,7 @@
for ( int i=0; i<getLength(); i++ ) {
Projection proj = getProjection(i);
buf.append( proj.toSqlString(criteria, loc, criteriaQuery) );
- loc += proj.getColumnAliases(loc).length;
+ loc += getColumnAliases(loc, criteria, criteriaQuery, proj ).length;
if ( i<elements.size()-1 ) buf.append(", ");
}
return buf.toString();
@@ -100,6 +100,16 @@
return ArrayHelper.toStringArray(result);
}
+ public String[] getColumnAliases(int loc, Criteria criteria, CriteriaQuery criteriaQuery) {
+ List result = new ArrayList( getLength() );
+ for ( int i=0; i<getLength(); i++ ) {
+ String[] colAliases = getColumnAliases( loc, criteria, criteriaQuery, getProjection( i ) );
+ ArrayHelper.addAll(result, colAliases);
+ loc+=colAliases.length;
+ }
+ return ArrayHelper.toStringArray(result);
+ }
+
public String[] getColumnAliases(String alias, int loc) {
for ( int i=0; i<getLength(); i++ ) {
String[] result = getProjection(i).getColumnAliases(alias, loc);
@@ -109,6 +119,27 @@
return null;
}
+ public String[] getColumnAliases(String alias, int loc, Criteria criteria, CriteriaQuery criteriaQuery) {
+ for ( int i=0; i<getLength(); i++ ) {
+ String[] result = getColumnAliases( alias, loc, criteria, criteriaQuery, getProjection(i) );
+ if (result!=null) return result;
+ loc += getColumnAliases( loc, criteria, criteriaQuery, getProjection( i ) ).length;
+ }
+ return null;
+ }
+
+ private static String[] getColumnAliases(int loc, Criteria criteria, CriteriaQuery criteriaQuery, Projection projection) {
+ return projection instanceof EnhancedProjection ?
+ ( ( EnhancedProjection ) projection ).getColumnAliases( loc, criteria, criteriaQuery ) :
+ projection.getColumnAliases( loc );
+ }
+
+ private static String[] getColumnAliases(String alias, int loc, Criteria criteria, CriteriaQuery criteriaQuery, Projection projection) {
+ return projection instanceof EnhancedProjection ?
+ ( ( EnhancedProjection ) projection ).getColumnAliases( alias, loc, criteria, criteriaQuery ) :
+ projection.getColumnAliases( alias, loc );
+ }
+
public Type[] getTypes(String alias, Criteria criteria, CriteriaQuery criteriaQuery) {
for ( int i=0; i<getLength(); i++ ) {
Type[] result = getProjection(i).getTypes(alias, criteria, criteriaQuery);
@@ -134,7 +165,7 @@
public int getLength() {
return elements.size();
}
-
+
public String toString() {
return elements.toString();
}
Modified: core/trunk/core/src/main/java/org/hibernate/criterion/PropertyProjection.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/criterion/PropertyProjection.java 2010-03-24 18:24:39 UTC (rev 19109)
+++ core/trunk/core/src/main/java/org/hibernate/criterion/PropertyProjection.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -61,12 +61,17 @@
public String toSqlString(Criteria criteria, int position, CriteriaQuery criteriaQuery)
throws HibernateException {
- return new StringBuffer()
- .append( criteriaQuery.getColumn(criteria, propertyName) )
- .append(" as y")
- .append(position)
- .append('_')
- .toString();
+ StringBuffer buf = new StringBuffer();
+ String[] cols = criteriaQuery.getColumnsUsingProjection( criteria, propertyName );
+ for ( int i=0; i<cols.length; i++ ) {
+ buf.append( cols[i] )
+ .append(" as y")
+ .append(position + i)
+ .append('_');
+ if (i < cols.length -1)
+ buf.append(", ");
+ }
+ return buf.toString();
}
public boolean isGrouped() {
Modified: core/trunk/core/src/main/java/org/hibernate/criterion/SimpleProjection.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/criterion/SimpleProjection.java 2010-03-24 18:24:39 UTC (rev 19109)
+++ core/trunk/core/src/main/java/org/hibernate/criterion/SimpleProjection.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -24,6 +24,8 @@
*/
package org.hibernate.criterion;
+import java.util.Iterator;
+
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.type.Type;
@@ -33,7 +35,7 @@
* A single-column projection that may be aliased
* @author Gavin King
*/
-public abstract class SimpleProjection implements Projection {
+public abstract class SimpleProjection implements EnhancedProjection {
public Projection as(String alias) {
return Projections.alias(this, alias);
@@ -42,7 +44,11 @@
public String[] getColumnAliases(String alias, int loc) {
return null;
}
-
+
+ public String[] getColumnAliases(String alias, int loc, Criteria criteria, CriteriaQuery criteriaQuery) {
+ return getColumnAliases( alias, loc );
+ }
+
public Type[] getTypes(String alias, Criteria criteria, CriteriaQuery criteriaQuery)
throws HibernateException {
return null;
@@ -51,7 +57,26 @@
public String[] getColumnAliases(int loc) {
return new String[] { "y" + loc + "_" };
}
-
+
+ public int getColumnCount(Criteria criteria, CriteriaQuery criteriaQuery) {
+ Type types[] = getTypes( criteria, criteriaQuery );
+ int count = 0;
+ for ( int i=0; i<types.length; i++ ) {
+ count += types[ i ].getColumnSpan( criteriaQuery.getFactory() );
+ }
+ return count;
+ }
+
+ public String[] getColumnAliases(int loc, Criteria criteria, CriteriaQuery criteriaQuery) {
+ int numColumns = getColumnCount( criteria, criteriaQuery );
+ String[] aliases = new String[ numColumns ];
+ for (int i = 0; i < numColumns; i++) {
+ aliases[i] = "y" + loc + "_";
+ loc++;
+ }
+ return aliases;
+ }
+
public String[] getAliases() {
return new String[1];
}
Modified: core/trunk/core/src/main/java/org/hibernate/loader/criteria/CriteriaLoader.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/loader/criteria/CriteriaLoader.java 2010-03-24 18:24:39 UTC (rev 19109)
+++ core/trunk/core/src/main/java/org/hibernate/loader/criteria/CriteriaLoader.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -48,6 +48,7 @@
import org.hibernate.persister.entity.Lockable;
import org.hibernate.transform.ResultTransformer;
import org.hibernate.type.Type;
+import org.hibernate.util.ArrayHelper;
/**
* A <tt>Loader</tt> for <tt>Criteria</tt> queries. Note that criteria queries are
@@ -127,8 +128,16 @@
Type[] types = translator.getProjectedTypes();
result = new Object[types.length];
String[] columnAliases = translator.getProjectedColumnAliases();
- for ( int i=0; i<result.length; i++ ) {
- result[i] = types[i].nullSafeGet(rs, columnAliases[i], session, null);
+ for ( int i=0, pos=0; i<result.length; i++ ) {
+ int numColumns = types[i].getColumnSpan( session.getFactory() );
+ if ( numColumns > 1 ) {
+ String[] typeColumnAliases = ArrayHelper.slice( columnAliases, pos, numColumns );
+ result[i] = types[i].nullSafeGet(rs, typeColumnAliases, session, null);
+ }
+ else {
+ result[i] = types[i].nullSafeGet(rs, columnAliases[pos], session, null);
+ }
+ pos += numColumns;
}
aliases = translator.getProjectedAliases();
}
Modified: core/trunk/core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java 2010-03-24 18:24:39 UTC (rev 19109)
+++ core/trunk/core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -42,6 +42,7 @@
import org.hibernate.MappingException;
import org.hibernate.QueryException;
import org.hibernate.LockOptions;
+import org.hibernate.criterion.EnhancedProjection;
import org.hibernate.hql.ast.util.SessionFactoryHelper;
import org.hibernate.criterion.CriteriaQuery;
import org.hibernate.criterion.Criterion;
@@ -362,7 +363,9 @@
}
public String[] getProjectedColumnAliases() {
- return rootCriteria.getProjection().getColumnAliases( 0 );
+ return rootCriteria.getProjection() instanceof EnhancedProjection ?
+ ( ( EnhancedProjection ) rootCriteria.getProjection() ).getColumnAliases( 0, rootCriteria, this ) :
+ rootCriteria.getProjection().getColumnAliases( 0 );
}
public String[] getProjectedAliases() {
@@ -426,10 +429,13 @@
//first look for a reference to a projection alias
final Projection projection = rootCriteria.getProjection();
- String[] projectionColumns = projection == null ?
- null :
- projection.getColumnAliases( propertyName, 0 );
-
+ String[] projectionColumns = null;
+ if ( projection != null ) {
+ projectionColumns = ( projection instanceof EnhancedProjection ?
+ ( ( EnhancedProjection ) projection ).getColumnAliases( propertyName, 0, rootCriteria, this ) :
+ projection.getColumnAliases( propertyName, 0 )
+ );
+ }
if ( projectionColumns == null ) {
//it does not refer to an alias of a projection,
//look for a property
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CityState.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CityState.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CityState.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -0,0 +1,58 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ *
+ */
+package org.hibernate.test.criteria;
+
+/**
+ * @author Gail Badner
+ */
+
+public class CityState {
+ private String city;
+ private String state;
+
+ public CityState() {}
+
+ public CityState(String city, String state) {
+ this.city = city;
+ this.state = state;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+}
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Course.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Course.java 2010-03-24 18:24:39 UTC (rev 19109)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Course.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -1,12 +1,17 @@
//$Id: Course.java 5686 2005-02-12 07:27:32Z steveebersole $
package org.hibernate.test.criteria;
+import java.util.HashSet;
+import java.util.Set;
+
/**
* @author Gavin King
*/
public class Course {
private String courseCode;
private String description;
+ private Set courseMeetings = new HashSet();
+
public String getCourseCode() {
return courseCode;
}
@@ -19,4 +24,10 @@
public void setDescription(String description) {
this.description = description;
}
+ public Set getCourseMeetings() {
+ return courseMeetings;
+ }
+ public void setCourseMeetings(Set courseMeetings) {
+ this.courseMeetings = courseMeetings;
+ }
}
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CourseMeeting.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CourseMeeting.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CourseMeeting.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -0,0 +1,29 @@
+package org.hibernate.test.criteria;
+
+/**
+ * @author Gail Badner
+ */
+public class CourseMeeting {
+ private CourseMeetingId id;
+ private Course course;
+
+ public CourseMeeting() {}
+
+ public CourseMeeting(Course course, String day, int period, String location) {
+ this.id = new CourseMeetingId( course, day, period, location );
+ this.course = course;
+ }
+
+ public CourseMeetingId getId() {
+ return id;
+ }
+ public void setId(CourseMeetingId id) {
+ this.id = id;
+ }
+ public Course getCourse() {
+ return course;
+ }
+ public void setCourse(Course course) {
+ this.course = course;
+ }
+}
\ No newline at end of file
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CourseMeetingId.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CourseMeetingId.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CourseMeetingId.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -0,0 +1,47 @@
+package org.hibernate.test.criteria;
+
+import java.io.Serializable;
+
+/**
+ * @author Gail Badner
+ */
+public class CourseMeetingId implements Serializable {
+ private String courseCode;
+ private String day;
+ private int period;
+ private String location;
+
+ public CourseMeetingId() {}
+
+ public CourseMeetingId(Course course, String day, int period, String location) {
+ this.courseCode = course.getCourseCode();
+ this.day = day;
+ this.period = period;
+ this.location = location;
+ }
+
+ public String getCourseCode() {
+ return courseCode;
+ }
+ public void setCourseCode(String courseCode) {
+ this.courseCode = courseCode;
+ }
+ public String getDay() {
+ return day;
+ }
+ public void setDay(String day) {
+ this.day = day;
+ }
+ public int getPeriod() {
+ return period;
+ }
+ public void setPeriod(int period) {
+ this.period = period;
+ }
+ public String getLocation() {
+ return location;
+ }
+ public void setLocation(String location) {
+ this.location = location;
+ }
+}
\ No newline at end of file
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java 2010-03-24 18:24:39 UTC (rev 19109)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -19,6 +19,7 @@
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Projection;
+import org.hibernate.criterion.ProjectionList;
import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Property;
import org.hibernate.criterion.Restrictions;
@@ -742,6 +743,152 @@
s.close();
}
+ public void testProjectedEmbeddedCompositeId() {
+ Session s = openSession();
+ Transaction t = s.beginTransaction();
+
+ Course course = new Course();
+ course.setCourseCode("HIB");
+ course.setDescription("Hibernate Training");
+ s.save(course);
+
+ Student gavin = new Student();
+ gavin.setName("Gavin King");
+ gavin.setStudentNumber(667);
+ s.save(gavin);
+
+ Student xam = new Student();
+ xam.setName("Max Rydahl Andersen");
+ xam.setStudentNumber(101);
+ s.save(xam);
+
+ Enrolment enrolment = new Enrolment();
+ enrolment.setCourse(course);
+ enrolment.setCourseCode(course.getCourseCode());
+ enrolment.setSemester((short) 1);
+ enrolment.setYear((short) 1999);
+ enrolment.setStudent(xam);
+ enrolment.setStudentNumber(xam.getStudentNumber());
+ xam.getEnrolments().add(enrolment);
+ s.save(enrolment);
+
+ enrolment = new Enrolment();
+ enrolment.setCourse(course);
+ enrolment.setCourseCode(course.getCourseCode());
+ enrolment.setSemester((short) 3);
+ enrolment.setYear((short) 1998);
+ enrolment.setStudent(gavin);
+ enrolment.setStudentNumber(gavin.getStudentNumber());
+ gavin.getEnrolments().add(enrolment);
+ s.save(enrolment);
+
+ s.flush();
+
+ List enrolments = ( List ) s.createCriteria( Enrolment.class).setProjection( Projections.id() ).list();
+ t.rollback();
+ s.close();
+ }
+
+ public void testProjectedCompositeId() {
+ Session s = openSession();
+ Transaction t = s.beginTransaction();
+
+ Course course = new Course();
+ course.setCourseCode("HIB");
+ course.setDescription("Hibernate Training");
+ course.getCourseMeetings().add( new CourseMeeting( course, "Monday", 1, "1313 Mockingbird Lane" ) );
+ s.save(course);
+ s.flush();
+
+ List data = ( List ) s.createCriteria( CourseMeeting.class).setProjection( Projections.id() ).list();
+ t.rollback();
+ s.close();
+ }
+
+ public void testProjectedComponent() {
+ Session s = openSession();
+ Transaction t = s.beginTransaction();
+
+ Student gaith = new Student();
+ gaith.setName("Gaith Bell");
+ gaith.setStudentNumber(123);
+ gaith.setCityState( new CityState( "Chicago", "Illinois" ) );
+ s.save( gaith );
+ s.flush();
+
+ List cityStates = ( List ) s.createCriteria( Student.class).setProjection( Projections.property( "cityState" )).list();
+ t.rollback();
+ s.close();
+ }
+
+ public void testProjectedListIncludesComponent() {
+ Session s = openSession();
+ Transaction t = s.beginTransaction();
+
+ Student gaith = new Student();
+ gaith.setName("Gaith Bell");
+ gaith.setStudentNumber(123);
+ gaith.setCityState( new CityState( "Chicago", "Illinois" ) );
+ s.save(gaith);
+ s.flush();
+ List data = ( List ) s.createCriteria( Student.class)
+ .setProjection( Projections.projectionList()
+ .add( Projections.property( "cityState" ) )
+ .add( Projections.property("name") ) )
+ .list();
+ t.rollback();
+ s.close();
+ }
+
+ public void testProjectedListIncludesEmbeddedCompositeId() {
+ Session s = openSession();
+ Transaction t = s.beginTransaction();
+
+ Course course = new Course();
+ course.setCourseCode("HIB");
+ course.setDescription("Hibernate Training");
+ s.save(course);
+
+ Student gavin = new Student();
+ gavin.setName("Gavin King");
+ gavin.setStudentNumber(667);
+ s.save(gavin);
+
+ Student xam = new Student();
+ xam.setName("Max Rydahl Andersen");
+ xam.setStudentNumber(101);
+ s.save(xam);
+
+ Enrolment enrolment = new Enrolment();
+ enrolment.setCourse(course);
+ enrolment.setCourseCode(course.getCourseCode());
+ enrolment.setSemester((short) 1);
+ enrolment.setYear((short) 1999);
+ enrolment.setStudent(xam);
+ enrolment.setStudentNumber(xam.getStudentNumber());
+ xam.getEnrolments().add(enrolment);
+ s.save(enrolment);
+
+ enrolment = new Enrolment();
+ enrolment.setCourse(course);
+ enrolment.setCourseCode(course.getCourseCode());
+ enrolment.setSemester((short) 3);
+ enrolment.setYear((short) 1998);
+ enrolment.setStudent(gavin);
+ enrolment.setStudentNumber(gavin.getStudentNumber());
+ gavin.getEnrolments().add(enrolment);
+ s.save(enrolment);
+ s.flush();
+ List data = ( List ) s.createCriteria( Enrolment.class)
+ .setProjection( Projections.projectionList()
+ .add( Projections.property( "semester" ) )
+ .add( Projections.property("year") )
+ .add( Projections.id() ) )
+ .list();
+ t.rollback();
+ s.close();
+ }
+
public void testSubcriteriaJoinTypes() {
Session session = openSession();
Transaction t = session.beginTransaction();
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Enrolment.hbm.xml
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Enrolment.hbm.xml 2010-03-24 18:24:39 UTC (rev 19109)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Enrolment.hbm.xml 2010-03-24 19:18:08 UTC (rev 19110)
@@ -10,21 +10,41 @@
<generator class="assigned"/>
</id>
<property name="description"/>
+ <set name="courseMeetings" inverse="true" cascade="all-delete-orphan">
+ <key column="courseCode"/>
+ <one-to-many class="CourseMeeting"/>
+ </set>
</class>
-
+
+ <class name="CourseMeeting">
+ <composite-id name="id" class="CourseMeetingId">
+ <key-property name="courseCode"/>
+ <key-property name="day"/>
+ <key-property name="period"/>
+ <key-property name="location"/>
+ </composite-id>
+ <many-to-one name="course" insert="false" update="false">
+ <column name="courseCode"/>
+ </many-to-one>
+ </class>
+
<class name="Student">
<id name="studentNumber">
<column name="studentId"/>
<generator class="assigned"/>
</id>
<property name="name" not-null="true"/>
+ <component name="cityState">
+ <property name="city" column="address_city"/>
+ <property name="state" column="address_state"/>
+ </component>
<set name="enrolments" inverse="true" cascade="delete">
<key column="studentId"/>
<one-to-many class="Enrolment"/>
</set>
<many-to-one name="preferredCourse" column="preferredCourseCode"/>
</class>
-
+
<class name="Enrolment">
<composite-id>
<key-property name="studentNumber">
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Student.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Student.java 2010-03-24 18:24:39 UTC (rev 19109)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Student.java 2010-03-24 19:18:08 UTC (rev 19110)
@@ -10,6 +10,7 @@
public class Student {
private long studentNumber;
private String name;
+ private CityState cityState;
private Course preferredCourse;
private Set enrolments = new HashSet();
@@ -29,6 +30,14 @@
this.studentNumber = studentNumber;
}
+ public CityState getCityState() {
+ return cityState;
+ }
+
+ public void setCityState(CityState cityState) {
+ this.cityState = cityState;
+ }
+
public Course getPreferredCourse() {
return preferredCourse;
}
14 years, 8 months