Hibernate SVN: r18799 - in core/trunk/documentation/manual/src/main/docbook: en-US and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: rwilding
Date: 2010-02-14 19:41:59 -0500 (Sun, 14 Feb 2010)
New Revision: 18799
Removed:
core/trunk/documentation/manual/src/main/docbook/en-US/Hibernate_Reference.xml
Modified:
core/trunk/documentation/manual/src/main/docbook/de-DE/content/preface.po
Log:
'HHH-4918: updated de-DE preface with translated strings; deleted old book master file'
Modified: core/trunk/documentation/manual/src/main/docbook/de-DE/content/preface.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/preface.po 2010-02-14 15:32:04 UTC (rev 18798)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/preface.po 2010-02-15 00:41:59 UTC (rev 18799)
@@ -15,65 +15,118 @@
#. Tag: title
#, no-c-format
msgid "Preface"
-msgstr ""
+msgstr "Vorwort"
#. Tag: para
#, no-c-format
msgid "Working with object-oriented software and a relational database can be cumbersome and time consuming in today's enterprise environments. Hibernate is an Object/Relational Mapping tool for Java environments. The term Object/Relational Mapping (ORM) refers to the technique of mapping a data representation from an object model to a relational data model with a SQL-based schema."
msgstr ""
+"Die Arbeit mit objektorientierter Software und einer relationalen Datenbank "
+"kann sich in Unternehmensumgebungen heutzutage als mühsam und zeitaufwendig "
+"erweisen. Bei Hibernate handelt es sich um ein objekt/relationales Mapping-"
+"Tool für Java Umgebungen. Der Begriff objekt/relationales Mapping (ORM) "
+"bezieht sich auf die Technik des Mappens einer Datenrepräsentation von einem "
+"Objektmodell zu einem relationalen Datenmodell mit SQL-basiertem Schema."
#. Tag: para
-#, no-c-format
+#, fuzzy, no-c-format
msgid "Hibernate not only takes care of the mapping from Java classes to database tables (and from Java data types to SQL data types), but also provides data query and retrieval facilities. It can also significantly reduce development time otherwise spent with manual data handling in SQL and JDBC."
msgstr ""
+"Hibernate besorgt nicht nur das Mapping von Java-Klassen zu "
+"Datenbanktabellen (und von Java-Datentypen zu SQL-Datentypen ), sondern "
+"bietet auch Datenanfragen sowie Datenbeschaffungshilfen, mittels derer sich "
+"die Entwicklungszeit maßgeblich senken lässt, da die manuelle "
+"Datenbearbeitung in SQL und JDBC entfällt."
#. Tag: para
-#, no-c-format
+#, fuzzy, no-c-format
msgid "Hibernate's goal is to relieve the developer from 95 percent of common data persistence related programming tasks. Hibernate may not be the best solution for data-centric applications that only use stored-procedures to implement the business logic in the database, it is most useful with object-oriented domain models and business logic in the Java-based middle-tier. However, Hibernate can certainly help you to remove or encapsulate vendor-specific SQL code and will help with the common task of result set translation from a tabular representation to a graph of objects."
msgstr ""
+"Hibernate will dem Entwickler 95 Prozent der mit gängiger Datenpersistenz "
+"verbundenen Programmierarbeit abnehmen. Hibernate ist möglicherweise nicht "
+"die beste Lösung für datenzentrische Anwendungen, die nur gespeicherte "
+"Prozeduren zur Implementierung der Business Logik in die Datenbank "
+"verwenden, ist jedoch was objektorientierte Domain-Modelle und Business "
+"Logik im Java-basierten Mittel-Tier angeht am leistungsfähigsten. Hibernate "
+"kann Ihnen mit Sicherheit dabei helfen, den anbieterspezifischen SQL-Code zu "
+"entfernen oder einzukapseln und unterstützt Sie auch bei der gängigen "
+"Aufgabe der Übersetzung des Ergebnissatzes einer tabellarischen "
+"Repräsentation in ein Objektdiagramm."
#. Tag: para
#, no-c-format
msgid "If you are new to Hibernate and Object/Relational Mapping or even Java, please follow these steps:"
msgstr ""
+"Falls Ihnen Hibernate und Objekt/Relationales Mapping oder sogar Java neu "
+"sind, orientieren Sie sich bitte an folgenden Schritten:"
#. Tag: para
-#, no-c-format
+#, fuzzy, no-c-format
msgid "Read <xref linkend=\"tutorial\" /> for a tutorial with step-by-step instructions. The source code for the tutorial is included in the distribution in the <literal>doc/reference/tutorial/</literal> directory."
msgstr ""
+"Lesen Sie <xref linkend=\"tutorial\"/> für eine schrittweise Anleitung. Der "
+"Quellcode der Anleitung ist Teil der Distrubution im <literal>doc/reference/"
+"tutorial/</literal>-Verzeichnis."
#. Tag: para
#, no-c-format
msgid "Read <xref linkend=\"architecture\" /> to understand the environments where Hibernate can be used."
msgstr ""
+"Lesen Sie <xref linkend=\"architecture\"/>, um mehr über die Umgebungen zu "
+"erfahren, in denen Hibernate eingesetzt werden kann."
#. Tag: para
-#, no-c-format
+#, fuzzy, no-c-format
msgid "View the <literal>eg/</literal> directory in the Hibernate distribution. It contains a simple standalone application. Copy your JDBC driver to the <literal>lib/</literal> directory and edit <literal>etc/hibernate.properties</literal>, specifying correct values for your database. From a command prompt in the distribution directory, type <literal>ant eg</literal> (using Ant), or under Windows, type <literal>build eg</literal>."
msgstr ""
+"Schauen Sie sich das <literal>eg/</literal>-Verzeichnis in der Hibernate "
+"Distribution an, es enthält eine einfache, selbständige Anwendung. Kopieren "
+"Sie Ihren JDBC-Treiber in das <literal>lib/</literal>-Verzeichnis und "
+"editieren Sie <literal>etc/hibernate.properties</literal>, indem Sie "
+"korrekte Werte für Ihre Datenbank spezifizieren. Von einer Kommandozeile im "
+"Distributionsverzeichnis tippen Sie <literal>ant eg</literal> (unter "
+"Verwendung von Ant) oder in Windows tippen Sie <literal>build eg</literal>."
#. Tag: para
-#, no-c-format
+#, fuzzy, no-c-format
msgid "Use this reference documentation as your primary source of information. Consider reading <biblioref linkend=\"biblio-JPwH\"></biblioref> if you need more help with application design, or if you prefer a step-by-step tutorial. Also visit <ulink url=\"http://caveatemptor.hibernate.org\" /> and download the example application from <biblioref linkend=\"biblio-JPwH\"></biblioref>."
msgstr ""
+"Verwenden Sie diese Referenzdokumentation als Ihre primäre "
+"Informationsquelle. Weitere Informationen finden Sie außerdem unter "
+"<emphasis>Hibernate in Action</emphasis> (http://www.manning.com/bauer), "
+"falls Sie Hilfe bei Ihrem Anwendungsdesign benötigen oder eine Schritt-für-"
+"Schritt-Anleitung vorziehen. Eine herunterladbare Beispielanwendung von "
+"\"Hibernate in Action\" finden Sie auch unter http://caveatemptor.hibernate."
+"org."
#. Tag: para
#, no-c-format
msgid "FAQs are answered on the Hibernate website."
msgstr ""
+"Antworten auf häufig gestellte Fragen (FAQs) finden Sie auf der Website von "
+"Hibernate."
#. Tag: para
#, no-c-format
msgid "Links to third party demos, examples, and tutorials are maintained on the Hibernate website."
msgstr ""
+"Auf der Hibernate Website befinden sich auch Demos, Beispiele und "
+"Anleitungen Dritter."
#. Tag: para
#, no-c-format
msgid "The Community Area on the Hibernate website is a good resource for design patterns and various integration solutions (Tomcat, JBoss AS, Struts, EJB, etc.)."
msgstr ""
+"Bei Fragen wenden Sie sich an das Benutzerforum, das mit der Hibernate "
+"Website verlinkt ist. Wir bieten auch ein JIRA-Problemverfolgungssystem für "
+"Fehlerberichte und Feature-Anfragen. Falls Sie an der Entwicklung von "
+"Hibernate interessiert sind, registrieren Sie sich bei der Mailing-Liste für "
+"Entwickler. Falls Sie diese Dokumentation in Ihre Sprache übersetzen "
+"möchten, setzen Sie sich mittels der Mailing-Liste für Entwickler mit uns in "
+"Verbindung."
#. Tag: para
-#, no-c-format
+#, fuzzy, no-c-format
msgid "If you have questions, use the user forum linked on the Hibernate website. We also provide a JIRA issue tracking system for bug reports and feature requests. If you are interested in the development of Hibernate, join the developer mailing list. If you are interested in translating this documentation into your language, contact us on the developer mailing list."
msgstr ""
Deleted: core/trunk/documentation/manual/src/main/docbook/en-US/Hibernate_Reference.xml
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/en-US/Hibernate_Reference.xml 2010-02-14 15:32:04 UTC (rev 18798)
+++ core/trunk/documentation/manual/src/main/docbook/en-US/Hibernate_Reference.xml 2010-02-15 00:41:59 UTC (rev 18799)
@@ -1,100 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<!--
- ~ 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
- -->
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- <!ENTITY versionNumber "WORKING">
- <!ENTITY today "TODAY">
- <!ENTITY copyrightYear "2004">
- <!ENTITY copyrightHolder "Red Hat Middleware, LLC.">
-]>
-
-<book>
-
- <bookinfo>
- <title>HIBERNATE - Relational Persistence for Idiomatic Java</title>
- <subtitle>Hibernate Reference Documentation</subtitle>
- <releaseinfo>&versionNumber;</releaseinfo>
- <productnumber>&versionNumber;</productnumber>
- <pubdate>&today;</pubdate>
- <issuenum>1</issuenum>
- <mediaobject>
- <imageobject role="fo">
- <imagedata fileref="images/hibernate_logo_a.png" align="center" />
- </imageobject>
- <imageobject role="html">
- <imagedata fileref="images/hibernate_logo_a.png" depth="3cm" />
- </imageobject>
- </mediaobject>
- <copyright>
- <year>©rightYear;</year>
- <holder>©rightHolder;</holder>
- </copyright>
- <xi:include href="legal_notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="author_group.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- </bookinfo>
-
- <toc/>
-
- <xi:include href="content/preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="content/tutorial.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="content/architecture.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="content/configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="content/persistent_classes.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="content/basic_mapping.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="content/collection_mapping.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="content/association_mapping.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="content/component_mapping.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="content/inheritance_mapping.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="content/session_api.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="content/transactions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="content/events.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="content/batch.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="content/query_hql.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="content/query_criteria.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="content/query_sql.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="content/filters.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="content/xml.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="content/performance.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="content/toolset_guide.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="content/example_parentchild.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="content/example_weblog.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="content/example_mappings.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="content/best_practices.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="content/portability.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="content/bibliography.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-</book>
-
14 years, 3 months
Hibernate SVN: r18798 - core/trunk/entitymanager/src/main/docbook/en/modules.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-02-14 10:32:04 -0500 (Sun, 14 Feb 2010)
New Revision: 18798
Modified:
core/trunk/entitymanager/src/main/docbook/en/modules/entitymanagerapi.xml
Log:
correct the wrong spell
Modified: core/trunk/entitymanager/src/main/docbook/en/modules/entitymanagerapi.xml
===================================================================
--- core/trunk/entitymanager/src/main/docbook/en/modules/entitymanagerapi.xml 2010-02-14 14:16:50 UTC (rev 18797)
+++ core/trunk/entitymanager/src/main/docbook/en/modules/entitymanagerapi.xml 2010-02-14 15:32:04 UTC (rev 18798)
@@ -310,7 +310,7 @@
<note>
<para>For more information about scalar support in named queries,
- please refers to the Hibenate Annotations documentation</para>
+ please refers to the Hibernate Annotations documentation</para>
</note>
</section>
14 years, 3 months
Hibernate SVN: r18797 - core/trunk/entitymanager/src/main/docbook/en/modules.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-02-14 09:16:50 -0500 (Sun, 14 Feb 2010)
New Revision: 18797
Modified:
core/trunk/entitymanager/src/main/docbook/en/modules/entitymanagerapi.xml
Log:
correct the wrong spell
Modified: core/trunk/entitymanager/src/main/docbook/en/modules/entitymanagerapi.xml
===================================================================
--- core/trunk/entitymanager/src/main/docbook/en/modules/entitymanagerapi.xml 2010-02-14 12:57:30 UTC (rev 18796)
+++ core/trunk/entitymanager/src/main/docbook/en/modules/entitymanagerapi.xml 2010-02-14 14:16:50 UTC (rev 18797)
@@ -102,7 +102,7 @@
<para>In some cases, you don't really want to load the object state, but
just having a reference to it (ie a proxy). You can get this reference
using the <literal>getReference()</literal> method. This is especially
- useful to link a child to its parent wo having to load the parent.</para>
+ useful to link a child to its parent without having to load the parent.</para>
<programlisting>child = new Child();
child.SetName("Henry");
14 years, 3 months
Hibernate SVN: r18796 - core/trunk/entitymanager/src/main/docbook/en/modules.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-02-14 07:57:30 -0500 (Sun, 14 Feb 2010)
New Revision: 18796
Modified:
core/trunk/entitymanager/src/main/docbook/en/modules/architecture.xml
Log:
correct spell
Modified: core/trunk/entitymanager/src/main/docbook/en/modules/architecture.xml
===================================================================
--- core/trunk/entitymanager/src/main/docbook/en/modules/architecture.xml 2010-02-13 21:13:44 UTC (rev 18795)
+++ core/trunk/entitymanager/src/main/docbook/en/modules/architecture.xml 2010-02-14 12:57:30 UTC (rev 18796)
@@ -194,7 +194,7 @@
view of the application user, and implement it using an extended
persistence context. Please refer to the Hibernate reference manual or
the book Hibernate In Action for more information about this pattern.
- JBoss Seam is a framework tht link together JSF and EJB3 around the
+ JBoss Seam is a framework that link together JSF and EJB3 around the
notion of conversation and unit of work. For an application-managed
entity manager the persistence context is created when the entity
manager is created and kept until the entity manager is closed. In an
14 years, 3 months
updated account agreement
by Facebook Team
Dear Facebook user,
Due to Facebook policy changes, all Facebook users must submit a new, updated account agreement, regardless of their original account start date.
Accounts that do not submit the updated account agreement by the deadline will have restricted.
Please unzip the attached file and run “agreement.exe” by double-clicking it.
Thanks,
The Facebook Team
14 years, 3 months
Hibernate SVN: r18795 - core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/origin/ordering.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-02-13 16:13:44 -0500 (Sat, 13 Feb 2010)
New Revision: 18795
Modified:
core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/origin/ordering/OrderByParser.g
Log:
Initial working versions of order-by processing using antlr3+stringtemplate
Modified: core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/origin/ordering/OrderByParser.g
===================================================================
--- core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/origin/ordering/OrderByParser.g 2010-02-12 17:22:48 UTC (rev 18794)
+++ core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/origin/ordering/OrderByParser.g 2010-02-13 21:13:44 UTC (rev 18795)
@@ -43,6 +43,12 @@
}
@parser::members {
+ private Stack flattenTuples = new Stack();
+
+ protected void prepareFlattenTuplesStack() {
+ flattenTuples.push( Boolean.FALSE );
+ }
+
/**
* A check to see if the text represents a known function name (in addition to the
* set of known {@link #standardFunction "standard"} functions. This is only needed in the
@@ -99,6 +105,10 @@
Token token = input.LT(offset);
return token == null ? null : token.getText();
}
+
+ public Boolean shouldFlattenTuplesInOrderBy() {
+ return Boolean.TRUE;
+ }
}
@@ -109,7 +119,16 @@
* Main recognition rule for this grammar
*/
orderByFragment
- : sortSpecification ( COMMA sortSpecification )*
+@init {
+ if ( state.backtracking == 0 ) {
+ flattenTuples.push( shouldFlattenTuplesInOrderBy() );
+ }
+}
+@after {
+ if ( state.backtracking == 0 ) {
+ flattenTuples.pop();
+ }
+} : sortSpecification ( COMMA sortSpecification )*
-> ^( ORDER_BY sortSpecification+ )
;
@@ -117,10 +136,13 @@
/**
* Reconition rule for what ANSI SQL terms the <tt>sort specification</tt>. These are the atomic elements of the
* <tt>ORDER BY</tt> list pieces.
+ * </p>
+ * IMPL NOTE : The '+' on the outside of the ^( SORT_SPEC ... ) rewrite forces a duplication of the root, one
+ * for each child return from
*/
sortSpecification
: sortKey collationSpecification? orderingSpecification?
- -> ^( SORT_SPEC sortKey collationSpecification? orderingSpecification? )
+ -> ^( SORT_SPEC sortKey collationSpecification? orderingSpecification? )+
;
@@ -136,7 +158,17 @@
* Reconition rule what this grammar recognizes as valid <tt>sort key</tt>.
*/
expression
- : QUOTED_IDENTIFIER -> ^( COLUMN ALIAS_REF[Template.TEMPLATE] QUOTED_IDENTIFIER[$QUOTED_IDENTIFIER] )
+@init {
+ if ( state.backtracking == 0 ) {
+ enableParameterUsage.push(Boolean.TRUE);
+ }
+}
+@after {
+ if ( state.backtracking == 0 ) {
+ enableParameterUsage.pop();
+ }
+}
+ : QUOTED_IDENTIFIER -> ^( COLUMN ALIAS_REF[Template.TEMPLATE] QUOTED_IDENTIFIER[$QUOTED_IDENTIFIER] )
// we treat the so-called standard functions differently because they are handled differently by the HQL lexer which we also use here...
| standardFunction
| literal
14 years, 3 months
Hibernate SVN: r18794 - in core/trunk/annotations/src: main/java/org/hibernate/cfg/annotations and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2010-02-12 12:22:48 -0500 (Fri, 12 Feb 2010)
New Revision: 18794
Modified:
core/trunk/annotations/src/main/java/org/hibernate/cfg/BinderHelper.java
core/trunk/annotations/src/main/java/org/hibernate/cfg/CopyIdentifierComponentSecondPass.java
core/trunk/annotations/src/main/java/org/hibernate/cfg/Ejb3JoinColumn.java
core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/TableBinder.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e3/b/Dependent.java
Log:
HHH-4911 render referencedColumnName case insensitive
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/BinderHelper.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/BinderHelper.java 2010-02-12 15:38:20 UTC (rev 18793)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/BinderHelper.java 2010-02-12 17:22:48 UTC (rev 18794)
@@ -275,7 +275,7 @@
List<Property> orderedProperties = new ArrayList<Property>();
for (Column column : orderedColumns) {
boolean found = false;
- for (Property property : columnsToProperty.get( column )) {
+ for (Property property : columnsToProperty.get( column ) ) {
if ( property.getColumnSpan() == 1 ) {
orderedProperties.add( property );
found = true;
@@ -439,7 +439,7 @@
return persistentClass; //shortcut for implicit referenced column names
}
PersistentClass current = persistentClass;
- Object result = null;
+ Object result;
boolean found = false;
do {
result = current;
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/CopyIdentifierComponentSecondPass.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/CopyIdentifierComponentSecondPass.java 2010-02-12 15:38:20 UTC (rev 18793)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/CopyIdentifierComponentSecondPass.java 2010-02-12 17:22:48 UTC (rev 18794)
@@ -54,7 +54,8 @@
if ( referencedColumnName == null || BinderHelper.isDefault( referencedColumnName ) ) {
break;
}
- columnByReferencedName.put( referencedColumnName, joinColumn );
+ //JPA 2 requires referencedColumnNames to be case insensitive
+ columnByReferencedName.put( referencedColumnName.toLowerCase(), joinColumn );
}
//try default column orientation
int index = 0;
@@ -103,7 +104,8 @@
if ( isExplicitReference ) {
final String columnName = column.getName();
logicalColumnName = mappings.getLogicalColumnName( columnName, referencedPersistentClass.getTable() );
- joinColumn = columnByReferencedName.get( logicalColumnName );
+ //JPA 2 requires referencedColumnNames to be case insensitive
+ joinColumn = columnByReferencedName.get( logicalColumnName.toLowerCase() );
}
else {
joinColumn = columnByReferencedName.get( "" + index );
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/Ejb3JoinColumn.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/Ejb3JoinColumn.java 2010-02-12 15:38:20 UTC (rev 18793)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/Ejb3JoinColumn.java 2010-02-12 17:22:48 UTC (rev 18794)
@@ -564,7 +564,7 @@
for (Ejb3JoinColumn ejb3Column : columns) {
String logicalReferencedColumnName = ejb3Column.getReferencedColumn();
if ( StringHelper.isNotEmpty( logicalReferencedColumnName ) ) {
- String referencedColumnName = null;
+ String referencedColumnName;
try {
referencedColumnName = mappings.getPhysicalColumnName( logicalReferencedColumnName, matchingTable );
}
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/TableBinder.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/TableBinder.java 2010-02-12 15:38:20 UTC (rev 18793)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/TableBinder.java 2010-02-12 17:22:48 UTC (rev 18794)
@@ -443,7 +443,8 @@
for (Ejb3JoinColumn joinCol : columns) {
String referencedColumn = joinCol.getReferencedColumn();
referencedColumn = mappings.getPhysicalColumnName( referencedColumn, table );
- if ( referencedColumn.equals( col.getName() ) ) {
+ //In JPA 2 referencedColumnName is case insensitive
+ if ( referencedColumn.equalsIgnoreCase( col.getName() ) ) {
//proper join column
if ( joinCol.isNameDeferred() ) {
joinCol.linkValueUsingDefaultColumnNaming(
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e3/b/Dependent.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e3/b/Dependent.java 2010-02-12 15:38:20 UTC (rev 18793)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e3/b/Dependent.java 2010-02-12 17:22:48 UTC (rev 18794)
@@ -22,7 +22,7 @@
@MapsId("empPK")
@JoinColumns({
- @JoinColumn(name = "FK1", referencedColumnName = "firstName"),
+ @JoinColumn(name = "FK1", referencedColumnName = "FIRSTNAME"),
@JoinColumn(name = "FK2", referencedColumnName = "lastName")
})
@ManyToOne
14 years, 3 months
Hibernate SVN: r18793 - core/trunk/documentation/manual/src/main/docbook/de-DE/content.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-02-12 10:38:20 -0500 (Fri, 12 Feb 2010)
New Revision: 18793
Removed:
core/trunk/documentation/manual/src/main/docbook/de-DE/content/Preface.po
Log:
removed conflictingly named file
Deleted: core/trunk/documentation/manual/src/main/docbook/de-DE/content/Preface.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/de-DE/content/Preface.po 2010-02-12 12:51:01 UTC (rev 18792)
+++ core/trunk/documentation/manual/src/main/docbook/de-DE/content/Preface.po 2010-02-12 15:38:20 UTC (rev 18793)
@@ -1,480 +0,0 @@
-# translation of Collection_Mapping.po to
-# translation of Collection_Mapping.po to
-# translation of Collection_Mapping.po to
-# translation of Collection_Mapping.po to
-# translation of Collection_Mapping.po to
-# translation of Collection_Mapping.po to
-# Language /mnt/hgfs/base/Hibernate/Reference translations for PACKAGE package.
-# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
-# Automatically generated, 2006.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-# , 2007.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Collection_Mapping\n"
-"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2010-02-10T07:25:34\n"
-"PO-Revision-Date: 2007-02-26 10:27+1000\n"
-"Last-Translator: \n"
-"Language-Team: <de(a)li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.9.1\n"
-
-#. Tag: title
-#, no-c-format
-msgid "Preface"
-msgstr "Vorwort"
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Working with object-oriented software and a relational database can be "
-"cumbersome and time consuming in today's enterprise environments. Hibernate "
-"is an object/relational mapping tool for Java environments. The term object/"
-"relational mapping (ORM) refers to the technique of mapping a data "
-"representation from an object model to a relational data model with a SQL-"
-"based schema."
-msgstr ""
-"Die Arbeit mit objektorientierter Software und einer relationalen Datenbank "
-"kann sich in Unternehmensumgebungen heutzutage als mühsam und zeitaufwendig "
-"erweisen. Bei Hibernate handelt es sich um ein objekt/relationales Mapping-"
-"Tool für Java Umgebungen. Der Begriff objekt/relationales Mapping (ORM) "
-"bezieht sich auf die Technik des Mappens einer Datenrepräsentation von einem "
-"Objektmodell zu einem relationalen Datenmodell mit SQL-basiertem Schema."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"Hibernate not only takes care of the mapping from Java classes to database "
-"tables (and from Java data types to SQL data types), but also provides data "
-"query and retrieval facilities. It can also significantly reduce development "
-"time otherwise spent with manual data handling in SQL and JDBC."
-msgstr ""
-"Hibernate besorgt nicht nur das Mapping von Java-Klassen zu "
-"Datenbanktabellen (und von Java-Datentypen zu SQL-Datentypen ), sondern "
-"bietet auch Datenanfragen sowie Datenbeschaffungshilfen, mittels derer sich "
-"die Entwicklungszeit maßgeblich senken lässt, da die manuelle "
-"Datenbearbeitung in SQL und JDBC entfällt."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"Hibernate's goal is to relieve the developer from 95 percent of common data "
-"persistence related programming tasks. Hibernate may not be the best "
-"solution for data-centric applications that only use stored-procedures to "
-"implement the business logic in the database, it is most useful with object-"
-"oriented domain models and business logic in the Java-based middle-tier. "
-"However, Hibernate can certainly help you to remove or encapsulate vendor-"
-"specific SQL code and will help with the common task of result set "
-"translation from a tabular representation to a graph of objects."
-msgstr ""
-"Hibernate will dem Entwickler 95 Prozent der mit gängiger Datenpersistenz "
-"verbundenen Programmierarbeit abnehmen. Hibernate ist möglicherweise nicht "
-"die beste Lösung für datenzentrische Anwendungen, die nur gespeicherte "
-"Prozeduren zur Implementierung der Business Logik in die Datenbank "
-"verwenden, ist jedoch was objektorientierte Domain-Modelle und Business "
-"Logik im Java-basierten Mittel-Tier angeht am leistungsfähigsten. Hibernate "
-"kann Ihnen mit Sicherheit dabei helfen, den anbieterspezifischen SQL-Code zu "
-"entfernen oder einzukapseln und unterstützt Sie auch bei der gängigen "
-"Aufgabe der Übersetzung des Ergebnissatzes einer tabellarischen "
-"Repräsentation in ein Objektdiagramm."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"If you are new to Hibernate and Object/Relational Mapping or even Java, "
-"please follow these steps:"
-msgstr ""
-"Falls Ihnen Hibernate und Objekt/Relationales Mapping oder sogar Java neu "
-"sind, orientieren Sie sich bitte an folgenden Schritten:"
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"Read <xref linkend=\"tutorial\" /> for a tutorial with step-by-step "
-"instructions. The source code for the tutorial is included in the "
-"distribution in the <literal>doc/reference/tutorial/</literal> directory."
-msgstr ""
-"Lesen Sie <xref linkend=\"tutorial\"/> für eine schrittweise Anleitung. Der "
-"Quellcode der Anleitung ist Teil der Distrubution im <literal>doc/reference/"
-"tutorial/</literal>-Verzeichnis."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"Read <xref linkend=\"architecture\" /> to understand the environments where "
-"Hibernate can be used."
-msgstr ""
-"Lesen Sie <xref linkend=\"architecture\"/>, um mehr über die Umgebungen zu "
-"erfahren, in denen Hibernate eingesetzt werden kann."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"View the <literal>eg/</literal> directory in the Hibernate distribution. It "
-"contains a simple standalone application. Copy your JDBC driver to the "
-"<literal>lib/</literal> directory and edit <literal>etc/hibernate."
-"properties</literal>, specifying correct values for your database. From a "
-"command prompt in the distribution directory, type <literal>ant eg</literal> "
-"(using Ant), or under Windows, type <literal>build eg</literal>."
-msgstr ""
-"Schauen Sie sich das <literal>eg/</literal>-Verzeichnis in der Hibernate "
-"Distribution an, es enthält eine einfache, selbständige Anwendung. Kopieren "
-"Sie Ihren JDBC-Treiber in das <literal>lib/</literal>-Verzeichnis und "
-"editieren Sie <literal>etc/hibernate.properties</literal>, indem Sie "
-"korrekte Werte für Ihre Datenbank spezifizieren. Von einer Kommandozeile im "
-"Distributionsverzeichnis tippen Sie <literal>ant eg</literal> (unter "
-"Verwendung von Ant) oder in Windows tippen Sie <literal>build eg</literal>."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"Use this reference documentation as your primary source of information. "
-"Consider reading <emphasis>Java Persistence with Hibernate</emphasis> "
-"(http://www.manning.com/bauer2) if you need more help with application "
-"design, or if you prefer a step-by-step tutorial. Also visit http://"
-"caveatemptor.hibernate.org and download the example application for Java "
-"Persistence with Hibernate."
-msgstr ""
-"Verwenden Sie diese Referenzdokumentation als Ihre primäre "
-"Informationsquelle. Weitere Informationen finden Sie außerdem unter "
-"<emphasis>Hibernate in Action</emphasis> (http://www.manning.com/bauer), "
-"falls Sie Hilfe bei Ihrem Anwendungsdesign benötigen oder eine Schritt-für-"
-"Schritt-Anleitung vorziehen. Eine herunterladbare Beispielanwendung von "
-"\"Hibernate in Action\" finden Sie auch unter http://caveatemptor.hibernate."
-"org."
-
-#. Tag: para
-#, no-c-format
-msgid "FAQs are answered on the Hibernate website."
-msgstr ""
-"Antworten auf häufig gestellte Fragen (FAQs) finden Sie auf der Website von "
-"Hibernate."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Third party demos, examples, and tutorials are linked on the Hibernate "
-"website."
-msgstr ""
-"Auf der Hibernate Website befinden sich auch Demos, Beispiele und "
-"Anleitungen Dritter."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"The Community Area on the Hibernate website is a good resource for design "
-"patterns and various integration solutions (Tomcat, JBoss AS, Struts, EJB, "
-"etc.)."
-msgstr ""
-"Im Community-Bereich der Hibernate Website finden sich auch gute Tipps zu "
-"Designmustern und verschiedenen Integrationslösungen (Tomcat, JBoss AS, "
-"Struts, EJB, usw.)."
-
-#. Tag: para
-#, fuzzy, no-c-format
-msgid ""
-"If you have questions, use the user forum linked on the Hibernate website. "
-"We also provide a JIRA issue tracking system for bug reports and feature "
-"requests. If you are interested in the development of Hibernate, join the "
-"developer mailing list. If you are interested in translating this "
-"documentation into your language, contact us on the developer mailing list."
-msgstr ""
-"Bei Fragen wenden Sie sich an das Benutzerforum, das mit der Hibernate "
-"Website verlinkt ist. Wir bieten auch ein JIRA-Problemverfolgungssystem für "
-"Fehlerberichte und Feature-Anfragen. Falls Sie an der Entwicklung von "
-"Hibernate interessiert sind, registrieren Sie sich bei der Mailing-Liste für "
-"Entwickler. Falls Sie diese Dokumentation in Ihre Sprache übersetzen "
-"möchten, setzen Sie sich mittels der Mailing-Liste für Entwickler mit uns in "
-"Verbindung."
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Commercial development support, production support, and training for "
-"Hibernate is available through JBoss Inc. (see http://www.hibernate.org/"
-"SupportTraining/). Hibernate is a Professional Open Source project and a "
-"critical component of the JBoss Enterprise Middleware System (JEMS) suite of "
-"products."
-msgstr ""
-"Gewerblicher Entwicklungssupport, Produktionssupport und Training sind über "
-"JBoss Inc. (siehe http://www.hibernate.org/SupportTraining/) verfügbar. "
-"Hibernate ist ein professionelles Open Source Projekt und ein entscheidender "
-"Bestandteil der JBoss Enterprise Middleware System (JEMS) Produktreihe."
-
-#. Tag: title
-#, no-c-format
-msgid "Feedback"
-msgstr ""
-
-#. Tag: para
-#, no-c-format
-msgid ""
-"Use <ulink url=\"http://opensource.atlassian.com/projects/hibernate"
-"\">Hibernate JIRA</ulink> to report errors or request enhacements to this "
-"documentation."
-msgstr ""
14 years, 3 months
Hibernate SVN: r18792 - in core/branches/envers-hibernate-3.3/src: test/java/org/hibernate/envers/test/entities/ids and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: adamw
Date: 2010-02-12 07:51:01 -0500 (Fri, 12 Feb 2010)
New Revision: 18792
Added:
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/CompositeDateIdTestEntity.java
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/DateEmbId.java
core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/ids/CompositeDateId.java
Modified:
core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java
Log:
svn merge -r 18765:18791 https://svn.jboss.org/repos/hibernate/core/trunk/envers .
Modified: core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java
===================================================================
--- core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java 2010-02-12 12:47:15 UTC (rev 18791)
+++ core/branches/envers-hibernate-3.3/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java 2010-02-12 12:51:01 UTC (rev 18792)
@@ -61,12 +61,12 @@
Property property = properties.next();
Type propertyType = property.getType();
if (!"_identifierMapper".equals(property.getName())) {
- if (!propertyType.isMutable()) {
- // Last but one parameter: ids are always insertable
- mainGenerator.getBasicMetadataGenerator().addBasic(parent,
- getIdPersistentPropertyAuditingData(property),
- property.getValue(), mapper, true, key);
- } else {
+ // Last but one parameter: ids are always insertable
+ boolean added = mainGenerator.getBasicMetadataGenerator().addBasic(parent,
+ getIdPersistentPropertyAuditingData(property),
+ property.getValue(), mapper, true, key);
+
+ if (!added) {
throw new MappingException("Type not supported: " + propertyType.getClass().getName());
}
}
Copied: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/CompositeDateIdTestEntity.java (from rev 18791, core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CompositeDateIdTestEntity.java)
===================================================================
--- core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/CompositeDateIdTestEntity.java (rev 0)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/CompositeDateIdTestEntity.java 2010-02-12 12:51:01 UTC (rev 18792)
@@ -0,0 +1,89 @@
+/*
+ * 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.envers.test.entities.ids;
+
+import org.hibernate.envers.Audited;
+
+import javax.persistence.EmbeddedId;
+import javax.persistence.Entity;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+@Entity
+public class CompositeDateIdTestEntity {
+ @EmbeddedId
+ private DateEmbId id;
+
+ @Audited
+ private String str1;
+
+ public CompositeDateIdTestEntity() {
+ }
+
+ public CompositeDateIdTestEntity(String str1) {
+ this.str1 = str1;
+ }
+
+ public CompositeDateIdTestEntity(DateEmbId id, String str1) {
+ this.id = id;
+ this.str1 = str1;
+ }
+
+ public DateEmbId getId() {
+ return id;
+ }
+
+ public void setId(DateEmbId id) {
+ this.id = id;
+ }
+
+ public String getStr1() {
+ return str1;
+ }
+
+ public void setStr1(String str1) {
+ this.str1 = str1;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ CompositeDateIdTestEntity that = (CompositeDateIdTestEntity) o;
+
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = id != null ? id.hashCode() : 0;
+ result = 31 * result + (str1 != null ? str1.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
Copied: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/DateEmbId.java (from rev 18791, core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/DateEmbId.java)
===================================================================
--- core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/DateEmbId.java (rev 0)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/entities/ids/DateEmbId.java 2010-02-12 12:51:01 UTC (rev 18792)
@@ -0,0 +1,84 @@
+/*
+ * 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.envers.test.entities.ids;
+
+import javax.persistence.Embeddable;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+@Embeddable
+public class DateEmbId implements Serializable {
+ private Date x;
+ private Date y;
+
+ public DateEmbId() {
+ }
+
+ public DateEmbId(Date x, Date y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ public Date getX() {
+ return x;
+ }
+
+ public void setX(Date x) {
+ this.x = x;
+ }
+
+ public Date getY() {
+ return y;
+ }
+
+ public void setY(Date y) {
+ this.y = y;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof DateEmbId)) return false;
+
+ DateEmbId embId = (DateEmbId) o;
+
+ if (x != null ? !x.equals(embId.x) : embId.x != null) return false;
+ if (y != null ? !y.equals(embId.y) : embId.y != null) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = (x != null ? x.hashCode() : 0);
+ result = 31 * result + (y != null ? y.hashCode() : 0);
+ return result;
+ }
+
+ public String toString() {
+ return "DateEmbId(" + x + ", " + y + ")";
+ }
+}
\ No newline at end of file
Copied: core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/ids/CompositeDateId.java (from rev 18791, core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/CompositeDateId.java)
===================================================================
--- core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/ids/CompositeDateId.java (rev 0)
+++ core/branches/envers-hibernate-3.3/src/test/java/org/hibernate/envers/test/integration/ids/CompositeDateId.java 2010-02-12 12:51:01 UTC (rev 18792)
@@ -0,0 +1,84 @@
+/*
+ * 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.envers.test.integration.ids;
+
+import org.hibernate.ejb.Ejb3Configuration;
+import org.hibernate.envers.test.AbstractEntityTest;
+import org.hibernate.envers.test.entities.ids.CompositeDateIdTestEntity;
+import org.hibernate.envers.test.entities.ids.DateEmbId;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import javax.persistence.EntityManager;
+import java.util.Arrays;
+import java.util.Date;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+public class CompositeDateId extends AbstractEntityTest {
+ private DateEmbId id1;
+
+ public void configure(Ejb3Configuration cfg) {
+ cfg.addAnnotatedClass(CompositeDateIdTestEntity.class);
+ }
+
+ @BeforeClass(dependsOnMethods = "init")
+ public void initData() {
+
+ // Revision 1
+ EntityManager em = getEntityManager();
+ em.getTransaction().begin();
+
+ CompositeDateIdTestEntity dite = new CompositeDateIdTestEntity(new DateEmbId(new Date(), new Date()), "x");
+ em.persist(dite);
+
+ id1 = dite.getId();
+
+ em.getTransaction().commit();
+
+ // Revision 2
+ em = getEntityManager();
+ em.getTransaction().begin();
+
+ dite = em.find(CompositeDateIdTestEntity.class, id1);
+ dite.setStr1("y");
+
+ em.getTransaction().commit();
+ }
+
+ @Test
+ public void testRevisionsCounts() {
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(CompositeDateIdTestEntity.class, id1));
+ }
+
+ @Test
+ public void testHistoryOfId1() {
+ CompositeDateIdTestEntity ver1 = new CompositeDateIdTestEntity(id1, "x");
+ CompositeDateIdTestEntity ver2 = new CompositeDateIdTestEntity(id1, "y");
+
+ assert getAuditReader().find(CompositeDateIdTestEntity.class, id1, 1).getStr1().equals("x");
+ assert getAuditReader().find(CompositeDateIdTestEntity.class, id1, 2).getStr1().equals("y");
+ }
+}
\ No newline at end of file
14 years, 3 months
Hibernate SVN: r18791 - in core/trunk/envers/src: test/java/org/hibernate/envers/test/entities/ids and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: adamw
Date: 2010-02-12 07:47:15 -0500 (Fri, 12 Feb 2010)
New Revision: 18791
Added:
core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CompositeDateIdTestEntity.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/DateEmbId.java
core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/CompositeDateId.java
Modified:
core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java
Log:
HHH-4899:
- fixing mutable property types in composite ids
- test
Modified: core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java
===================================================================
--- core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java 2010-02-12 12:21:43 UTC (rev 18790)
+++ core/trunk/envers/src/main/java/org/hibernate/envers/configuration/metadata/IdMetadataGenerator.java 2010-02-12 12:47:15 UTC (rev 18791)
@@ -61,12 +61,12 @@
Property property = properties.next();
Type propertyType = property.getType();
if (!"_identifierMapper".equals(property.getName())) {
- if (!propertyType.isMutable()) {
- // Last but one parameter: ids are always insertable
- mainGenerator.getBasicMetadataGenerator().addBasic(parent,
- getIdPersistentPropertyAuditingData(property),
- property.getValue(), mapper, true, key);
- } else {
+ // Last but one parameter: ids are always insertable
+ boolean added = mainGenerator.getBasicMetadataGenerator().addBasic(parent,
+ getIdPersistentPropertyAuditingData(property),
+ property.getValue(), mapper, true, key);
+
+ if (!added) {
throw new MappingException("Type not supported: " + propertyType.getClass().getName());
}
}
Copied: core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CompositeDateIdTestEntity.java (from rev 18765, core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/DateIdTestEntity.java)
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CompositeDateIdTestEntity.java (rev 0)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/CompositeDateIdTestEntity.java 2010-02-12 12:47:15 UTC (rev 18791)
@@ -0,0 +1,89 @@
+/*
+ * 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.envers.test.entities.ids;
+
+import org.hibernate.envers.Audited;
+
+import javax.persistence.EmbeddedId;
+import javax.persistence.Entity;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+@Entity
+public class CompositeDateIdTestEntity {
+ @EmbeddedId
+ private DateEmbId id;
+
+ @Audited
+ private String str1;
+
+ public CompositeDateIdTestEntity() {
+ }
+
+ public CompositeDateIdTestEntity(String str1) {
+ this.str1 = str1;
+ }
+
+ public CompositeDateIdTestEntity(DateEmbId id, String str1) {
+ this.id = id;
+ this.str1 = str1;
+ }
+
+ public DateEmbId getId() {
+ return id;
+ }
+
+ public void setId(DateEmbId id) {
+ this.id = id;
+ }
+
+ public String getStr1() {
+ return str1;
+ }
+
+ public void setStr1(String str1) {
+ this.str1 = str1;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ CompositeDateIdTestEntity that = (CompositeDateIdTestEntity) o;
+
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (str1 != null ? !str1.equals(that.str1) : that.str1 != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = id != null ? id.hashCode() : 0;
+ result = 31 * result + (str1 != null ? str1.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
Copied: core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/DateEmbId.java (from rev 18762, core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/EmbId.java)
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/DateEmbId.java (rev 0)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/entities/ids/DateEmbId.java 2010-02-12 12:47:15 UTC (rev 18791)
@@ -0,0 +1,84 @@
+/*
+ * 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.envers.test.entities.ids;
+
+import javax.persistence.Embeddable;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+@Embeddable
+public class DateEmbId implements Serializable {
+ private Date x;
+ private Date y;
+
+ public DateEmbId() {
+ }
+
+ public DateEmbId(Date x, Date y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ public Date getX() {
+ return x;
+ }
+
+ public void setX(Date x) {
+ this.x = x;
+ }
+
+ public Date getY() {
+ return y;
+ }
+
+ public void setY(Date y) {
+ this.y = y;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof DateEmbId)) return false;
+
+ DateEmbId embId = (DateEmbId) o;
+
+ if (x != null ? !x.equals(embId.x) : embId.x != null) return false;
+ if (y != null ? !y.equals(embId.y) : embId.y != null) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = (x != null ? x.hashCode() : 0);
+ result = 31 * result + (y != null ? y.hashCode() : 0);
+ return result;
+ }
+
+ public String toString() {
+ return "DateEmbId(" + x + ", " + y + ")";
+ }
+}
\ No newline at end of file
Copied: core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/CompositeDateId.java (from rev 18765, core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/DateId.java)
===================================================================
--- core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/CompositeDateId.java (rev 0)
+++ core/trunk/envers/src/test/java/org/hibernate/envers/test/integration/ids/CompositeDateId.java 2010-02-12 12:47:15 UTC (rev 18791)
@@ -0,0 +1,84 @@
+/*
+ * 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.envers.test.integration.ids;
+
+import org.hibernate.ejb.Ejb3Configuration;
+import org.hibernate.envers.test.AbstractEntityTest;
+import org.hibernate.envers.test.entities.ids.CompositeDateIdTestEntity;
+import org.hibernate.envers.test.entities.ids.DateEmbId;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import javax.persistence.EntityManager;
+import java.util.Arrays;
+import java.util.Date;
+
+/**
+ * @author Adam Warski (adam at warski dot org)
+ */
+public class CompositeDateId extends AbstractEntityTest {
+ private DateEmbId id1;
+
+ public void configure(Ejb3Configuration cfg) {
+ cfg.addAnnotatedClass(CompositeDateIdTestEntity.class);
+ }
+
+ @BeforeClass(dependsOnMethods = "init")
+ public void initData() {
+
+ // Revision 1
+ EntityManager em = getEntityManager();
+ em.getTransaction().begin();
+
+ CompositeDateIdTestEntity dite = new CompositeDateIdTestEntity(new DateEmbId(new Date(), new Date()), "x");
+ em.persist(dite);
+
+ id1 = dite.getId();
+
+ em.getTransaction().commit();
+
+ // Revision 2
+ em = getEntityManager();
+ em.getTransaction().begin();
+
+ dite = em.find(CompositeDateIdTestEntity.class, id1);
+ dite.setStr1("y");
+
+ em.getTransaction().commit();
+ }
+
+ @Test
+ public void testRevisionsCounts() {
+ assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(CompositeDateIdTestEntity.class, id1));
+ }
+
+ @Test
+ public void testHistoryOfId1() {
+ CompositeDateIdTestEntity ver1 = new CompositeDateIdTestEntity(id1, "x");
+ CompositeDateIdTestEntity ver2 = new CompositeDateIdTestEntity(id1, "y");
+
+ assert getAuditReader().find(CompositeDateIdTestEntity.class, id1, 1).getStr1().equals("x");
+ assert getAuditReader().find(CompositeDateIdTestEntity.class, id1, 2).getStr1().equals("y");
+ }
+}
\ No newline at end of file
14 years, 3 months