Hibernate SVN: r18674 - search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-01-31 16:50:23 -0500 (Sun, 31 Jan 2010)
New Revision: 18674
Modified:
search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java
Log:
JBPAPP-3073 Test FSSlaveAndMasterDPTest fails because it needs more time to process copies
Modified: search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java
===================================================================
--- search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java 2010-01-30 17:27:32 UTC (rev 18673)
+++ search/branches/Branch_3_0_1_GA_CP/src/test/org/hibernate/search/test/directoryProvider/FSSlaveAndMasterDPTest.java 2010-01-31 21:50:23 UTC (rev 18674)
@@ -75,11 +75,11 @@
session.persist( sn );
tx.commit();
session.close();
-
- int waitPeriodMilli = 2010; // wait a bit more than 2 refresh periods (one master / one slave) - 2 * 1 * 1000 + 10
+ //JBPAPP-3073 : change the wait time to 2010*2
+ int waitPeriodMilli = 2010*2; // wait a bit more than 2 refresh periods (one master / one slave) - 2 * 1 * 1000 + 10
Thread.sleep( waitPeriodMilli );
- // assert that the master hass indexed the snowstorm
+ // assert that the master has indexed the snowstorm
fullTextSession = Search.createFullTextSession( getMasterSession() );
tx = fullTextSession.beginTransaction();
result = fullTextSession.createFullTextQuery( parser.parse( "location:dallas" ) ).list();
14 years, 9 months
Hibernate SVN: r18673 - core/trunk/core/src/main/java/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: smarlow(a)redhat.com
Date: 2010-01-30 12:27:32 -0500 (Sat, 30 Jan 2010)
New Revision: 18673
Modified:
core/trunk/core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java
Log:
HHH-4765 Enhance Dialect support for JPA-2 locking.
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java 2010-01-29 20:07:40 UTC (rev 18672)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java 2010-01-30 17:27:32 UTC (rev 18673)
@@ -358,4 +358,17 @@
// seems to have spotty LOB suppport
return false;
}
+
+ public String getForUpdateString() {
+ return " for update";
+ }
+
+ public String getWriteLockString(int timeout) {
+ return " for update";
+ }
+
+ public String getReadLockString(int timeout) {
+ return " for share";
+ }
+
}
14 years, 9 months
Hibernate SVN: r18672 - in jpamodelgen/trunk/src: main/java/org/hibernate/jpamodelgen/annotation and 7 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-01-29 15:07:40 -0500 (Fri, 29 Jan 2010)
New Revision: 18672
Added:
jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/MetaModelGenerationException.java
jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/elementcollection/Cleaner.java
jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/elementcollection/Hotel.java
Modified:
jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/annotation/AnnotationMetaEntity.java
jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/xml/XmlMetaEntity.java
jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/accesstype/AccessTypeTest.java
jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/arraytype/ArrayTest.java
jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/elementcollection/ElementCollectionTest.java
jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/util/TestUtil.java
jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/xmlmapped/Boy.java
jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/xmlmapped/XmlMappingTest.java
jpamodelgen/trunk/src/test/resources/org/hibernate/jpamodelgen/test/xmlmapped/boy.xml
Log:
METAGEN-19 - Support @MapKeyClass overriding of the key class
Added: jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/MetaModelGenerationException.java
===================================================================
--- jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/MetaModelGenerationException.java (rev 0)
+++ jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/MetaModelGenerationException.java 2010-01-29 20:07:40 UTC (rev 18672)
@@ -0,0 +1,35 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.jpamodelgen;
+
+/**
+ * {@code RuntimeException} used for errors during meta model generation.
+ *
+ * @author Hardy Ferentschik
+ */
+public class MetaModelGenerationException extends RuntimeException {
+ public MetaModelGenerationException() {
+ super();
+ }
+
+ public MetaModelGenerationException(String message) {
+ super( message );
+ }
+}
+
+
Modified: jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/annotation/AnnotationMetaEntity.java
===================================================================
--- jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/annotation/AnnotationMetaEntity.java 2010-01-29 06:13:23 UTC (rev 18671)
+++ jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/annotation/AnnotationMetaEntity.java 2010-01-29 20:07:40 UTC (rev 18672)
@@ -35,6 +35,7 @@
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.ElementFilter;
+import javax.lang.model.util.Elements;
import javax.lang.model.util.SimpleTypeVisitor6;
import javax.persistence.Access;
import javax.persistence.AccessType;
@@ -46,6 +47,7 @@
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
+import javax.persistence.MapKeyClass;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
@@ -57,6 +59,7 @@
import org.hibernate.jpamodelgen.ImportContextImpl;
import org.hibernate.jpamodelgen.MetaAttribute;
import org.hibernate.jpamodelgen.MetaEntity;
+import org.hibernate.jpamodelgen.MetaModelGenerationException;
import org.hibernate.jpamodelgen.util.TypeUtils;
/**
@@ -369,18 +372,20 @@
@Override
public AnnotationMetaAttribute visitDeclared(DeclaredType declaredType, Element element) {
- //FIXME consider XML
if ( isPersistent( element ) ) {
TypeElement returnedElement = ( TypeElement ) context.getProcessingEnvironment()
.getTypeUtils()
.asElement( declaredType );
// WARNING: .toString() is necessary here since Name equals does not compare to String
- String fqElementName = returnedElement.getQualifiedName().toString();
- String collection = COLLECTIONS.get( fqElementName );
+ String fqNameOfReturnType = returnedElement.getQualifiedName().toString();
+ String collection = COLLECTIONS.get( fqNameOfReturnType );
String targetEntity = getTargetEntity( element.getAnnotationMirrors() );
if ( collection != null ) {
if ( TypeUtils.containsAnnotation( element, ElementCollection.class ) ) {
- TypeMirror collectionElementType = getCollectionElementType( declaredType, fqElementName );
+ String explicitTargetEntity = getTargetEntity( element.getAnnotationMirrors() );
+ TypeMirror collectionElementType = getCollectionElementType(
+ declaredType, fqNameOfReturnType, explicitTargetEntity
+ );
final TypeElement collectionElement = ( TypeElement ) context.getProcessingEnvironment()
.getTypeUtils()
.asElement( collectionElementType );
@@ -390,14 +395,7 @@
);
}
if ( collection.equals( "javax.persistence.metamodel.MapAttribute" ) ) {
- return new AnnotationMetaMap(
- //FIXME support targetEntity for map's key @MapKeyClass
- parent,
- element,
- collection,
- getKeyType( declaredType ),
- getElementType( declaredType, targetEntity )
- );
+ return createAnnotationMetaAttributeForMap( declaredType, element, collection, targetEntity );
}
else {
return new AnnotationMetaCollection(
@@ -423,25 +421,59 @@
}
}
- private TypeMirror getCollectionElementType(DeclaredType t, String fqElementName) {
+ private AnnotationMetaAttribute createAnnotationMetaAttributeForMap(DeclaredType declaredType, Element element, String collection, String targetEntity) {
+ String keyType;
+ if ( TypeUtils.containsAnnotation( element, MapKeyClass.class ) ) {
+ TypeMirror typeMirror = ( TypeMirror ) TypeUtils.getAnnotationValue(
+ TypeUtils.getAnnotationMirror(
+ element, MapKeyClass.class
+ ), DEFAULT_ANNOTATION_PARAMETER_NAME
+ );
+ keyType = typeMirror.toString();
+ }
+ else {
+ keyType = getKeyType( declaredType );
+ }
+ return new AnnotationMetaMap(
+ parent,
+ element,
+ collection,
+ keyType,
+ getElementType( declaredType, targetEntity )
+ );
+ }
+
+ private TypeMirror getCollectionElementType(DeclaredType t, String fqNameOfReturnedType, String explicitTargetEntityName) {
TypeMirror collectionElementType;
- if ( Map.class.getCanonicalName().equals( fqElementName ) ) {
- collectionElementType = t.getTypeArguments().get( 1 );
+ if ( explicitTargetEntityName != null ) {
+ Elements elements = context.getProcessingEnvironment().getElementUtils();
+ TypeElement element = elements.getTypeElement( explicitTargetEntityName );
+ collectionElementType = element.asType();
}
else {
- collectionElementType = t.getTypeArguments().get( 0 );
+ List<? extends TypeMirror> typeArguments = t.getTypeArguments();
+ if ( typeArguments.size() == 0 ) {
+ throw new MetaModelGenerationException( "Unable to determine collection type for property in " + getSimpleName() );
+ }
+ else if ( Map.class.getCanonicalName().equals( fqNameOfReturnedType ) ) {
+ collectionElementType = t.getTypeArguments().get( 1 );
+ }
+ else {
+ collectionElementType = t.getTypeArguments().get( 0 );
+ }
}
return collectionElementType;
}
@Override
public AnnotationMetaAttribute visitExecutable(ExecutableType t, Element p) {
+ if ( !p.getKind().equals( ElementKind.METHOD ) ) {
+ return null;
+ }
+
String string = p.getSimpleName().toString();
-
- // TODO: implement proper property get/is/boolean detection
- if ( string.startsWith( "get" ) || string.startsWith( "is" ) ) {
+ if ( string.startsWith( "get" ) || string.startsWith( "is" ) || string.startsWith( "has" ) ) {
TypeMirror returnType = t.getReturnType();
-
return returnType.accept( this, p );
}
else {
Modified: jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/xml/XmlMetaEntity.java
===================================================================
--- jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/xml/XmlMetaEntity.java 2010-01-29 06:13:23 UTC (rev 18671)
+++ jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/xml/XmlMetaEntity.java 2010-01-29 20:07:40 UTC (rev 18672)
@@ -25,12 +25,15 @@
import javax.lang.model.element.Name;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.DeclaredType;
+import javax.lang.model.type.TypeMirror;
+import javax.tools.Diagnostic;
import org.hibernate.jpamodelgen.Context;
import org.hibernate.jpamodelgen.ImportContext;
import org.hibernate.jpamodelgen.ImportContextImpl;
import org.hibernate.jpamodelgen.MetaAttribute;
import org.hibernate.jpamodelgen.MetaEntity;
+import org.hibernate.jpamodelgen.MetaModelGenerationException;
import org.hibernate.jpamodelgen.util.TypeUtils;
import org.hibernate.jpamodelgen.xml.jaxb.Attributes;
import org.hibernate.jpamodelgen.xml.jaxb.Basic;
@@ -142,8 +145,14 @@
for ( Element elem : element.getEnclosedElements() ) {
if ( elem.getSimpleName().toString().equals( propertyName ) ) {
DeclaredType type = ( ( DeclaredType ) elem.asType() );
+ List<? extends TypeMirror> typeArguments = type.getTypeArguments();
+
+ if ( typeArguments.size() == 0 && explicitTargetEntity == null ) {
+ throw new MetaModelGenerationException( "Unable to determine target entity type for " + clazzName + "." + propertyName + "." );
+ }
+
if ( explicitTargetEntity == null ) {
- types[0] = TypeUtils.extractClosestRealTypeAsString( type.getTypeArguments().get( 0 ), context );
+ types[0] = TypeUtils.extractClosestRealTypeAsString( typeArguments.get( 0 ), context );
}
else {
types[0] = explicitTargetEntity;
@@ -240,25 +249,58 @@
}
XmlMetaCollection metaCollection;
+ String[] types;
for ( ManyToMany manyToMany : attributes.getManyToMany() ) {
- String[] types = getCollectionType( manyToMany.getName(), manyToMany.getTargetEntity() );
+ try {
+ types = getCollectionType( manyToMany.getName(), manyToMany.getTargetEntity() );
+ }
+ catch ( MetaModelGenerationException e ) {
+ logMetaModelException( manyToMany.getName(), e );
+ break;
+ }
metaCollection = new XmlMetaCollection( this, manyToMany.getName(), types[0], types[1] );
members.add( metaCollection );
}
for ( OneToMany oneToMany : attributes.getOneToMany() ) {
- String[] types = getCollectionType( oneToMany.getName(), oneToMany.getTargetEntity() );
+ try {
+ types = getCollectionType( oneToMany.getName(), oneToMany.getTargetEntity() );
+ }
+ catch ( MetaModelGenerationException e ) {
+ logMetaModelException( oneToMany.getName(), e );
+ break;
+ }
metaCollection = new XmlMetaCollection( this, oneToMany.getName(), types[0], types[1] );
members.add( metaCollection );
}
for ( ElementCollection collection : attributes.getElementCollection() ) {
- String[] types = getCollectionType( collection.getName(), collection.getTargetClass() );
+ try {
+ types = getCollectionType( collection.getName(), collection.getTargetClass() );
+ }
+ catch ( MetaModelGenerationException e ) {
+ logMetaModelException( collection.getName(), e );
+ break;
+ }
metaCollection = new XmlMetaCollection( this, collection.getName(), types[0], types[1] );
members.add( metaCollection );
}
}
+ private void logMetaModelException(String name, MetaModelGenerationException e) {
+ StringBuilder builder = new StringBuilder();
+ builder.append( "Error processing xml for " );
+ builder.append( clazzName );
+ builder.append( "." );
+ builder.append( name );
+ builder.append( ". Error message: " );
+ builder.append( e.getMessage() );
+ context.logMessage(
+ Diagnostic.Kind.WARNING,
+ builder.toString()
+ );
+ }
+
private void parseEmbeddableAttributes(EmbeddableAttributes attributes) {
XmlMetaSingleAttribute attribute;
for ( Basic basic : attributes.getBasic() ) {
Modified: jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/accesstype/AccessTypeTest.java
===================================================================
--- jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/accesstype/AccessTypeTest.java 2010-01-29 06:13:23 UTC (rev 18671)
+++ jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/accesstype/AccessTypeTest.java 2010-01-29 20:07:40 UTC (rev 18672)
@@ -23,7 +23,7 @@
import org.hibernate.jpamodelgen.test.util.TestUtil;
import static org.hibernate.jpamodelgen.test.util.TestUtil.assertAbsenceOfFieldInMetamodelFor;
-import static org.hibernate.jpamodelgen.test.util.TestUtil.assertFieldTypeInMetaModelFor;
+import static org.hibernate.jpamodelgen.test.util.TestUtil.assertAttributeTypeInMetaModelFor;
import static org.hibernate.jpamodelgen.test.util.TestUtil.assertPresenceOfFieldInMetamodelFor;
/**
@@ -84,7 +84,7 @@
@Test
public void testMemberAccessType() {
assertPresenceOfFieldInMetamodelFor( Customer.class, "goodPayer", "access type overriding" );
- assertFieldTypeInMetaModelFor( Customer.class, "goodPayer", Boolean.class, "access type overriding" );
+ assertAttributeTypeInMetaModelFor( Customer.class, "goodPayer", Boolean.class, "access type overriding" );
}
@Override
Modified: jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/arraytype/ArrayTest.java
===================================================================
--- jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/arraytype/ArrayTest.java 2010-01-29 06:13:23 UTC (rev 18671)
+++ jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/arraytype/ArrayTest.java 2010-01-29 20:07:40 UTC (rev 18672)
@@ -21,7 +21,7 @@
import org.hibernate.jpamodelgen.test.util.CompilationTest;
-import static org.hibernate.jpamodelgen.test.util.TestUtil.assertFieldTypeInMetaModelFor;
+import static org.hibernate.jpamodelgen.test.util.TestUtil.assertAttributeTypeInMetaModelFor;
/**
* @author Hardy Ferentschik
@@ -33,7 +33,7 @@
*/
@Test
public void testPrimitiveArray() {
- assertFieldTypeInMetaModelFor( Image.class, "data", byte[].class, "Wrong type for field." );
+ assertAttributeTypeInMetaModelFor( Image.class, "data", byte[].class, "Wrong type for field." );
}
/**
@@ -41,7 +41,7 @@
*/
@Test
public void testIntegerArray() {
- assertFieldTypeInMetaModelFor(
+ assertAttributeTypeInMetaModelFor(
TemperatureSamples.class, "samples", Integer[].class, "Wrong type for field."
);
}
Copied: jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/elementcollection/Cleaner.java (from rev 18664, jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/elementcollection/Room.java)
===================================================================
--- jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/elementcollection/Cleaner.java (rev 0)
+++ jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/elementcollection/Cleaner.java 2010-01-29 20:07:40 UTC (rev 18672)
@@ -0,0 +1,46 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.jpamodelgen.test.elementcollection;
+
+import javax.persistence.Entity;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class Cleaner {
+ private int id;
+
+ private String name;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
\ No newline at end of file
Modified: jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/elementcollection/ElementCollectionTest.java
===================================================================
--- jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/elementcollection/ElementCollectionTest.java 2010-01-29 06:13:23 UTC (rev 18671)
+++ jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/elementcollection/ElementCollectionTest.java 2010-01-29 20:07:40 UTC (rev 18672)
@@ -21,6 +21,7 @@
import org.hibernate.jpamodelgen.test.util.CompilationTest;
+import static org.hibernate.jpamodelgen.test.util.TestUtil.assertMapAttributesInMetaModelFor;
import static org.hibernate.jpamodelgen.test.util.TestUtil.assertMetamodelClassGeneratedFor;
import static org.hibernate.jpamodelgen.test.util.TestUtil.assertNoSourceFileGeneratedFor;
@@ -34,11 +35,26 @@
@Test
public void testElementCollectionOnMap() {
assertMetamodelClassGeneratedFor( House.class );
- assertMetamodelClassGeneratedFor( House.class );
+ assertMetamodelClassGeneratedFor( Room.class );
// side effect of METAGEN-8 was that a meta class for String was created!
assertNoSourceFileGeneratedFor( String.class );
}
+ /**
+ * METAGEN-19
+ */
+ @Test
+ public void testMapKeyClass() {
+ assertMetamodelClassGeneratedFor( Hotel.class );
+ assertMapAttributesInMetaModelFor(
+ Hotel.class, "roomsByName", String.class, Room.class, "Wrong type in map attribute."
+ );
+
+ assertMapAttributesInMetaModelFor(
+ Hotel.class, "cleaners", Room.class, Cleaner.class, "Wrong type in map attribute."
+ );
+ }
+
@Override
protected String getTestPackage() {
return House.class.getPackage().getName();
Copied: jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/elementcollection/Hotel.java (from rev 18664, jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/elementcollection/House.java)
===================================================================
--- jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/elementcollection/Hotel.java (rev 0)
+++ jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/elementcollection/Hotel.java 2010-01-29 20:07:40 UTC (rev 18672)
@@ -0,0 +1,55 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.jpamodelgen.test.elementcollection;
+
+import java.util.Map;
+import javax.persistence.ElementCollection;
+import javax.persistence.Entity;
+import javax.persistence.MapKeyClass;
+import javax.persistence.OneToMany;
+
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class Hotel {
+ private Map roomsByName;
+
+ private Map cleaners;
+
+ @ElementCollection(targetClass = Room.class)
+ @MapKeyClass(String.class)
+ public Map getRoomsByName() {
+ return roomsByName;
+ }
+
+ public void setRoomsByName(Map roomsByName) {
+ this.roomsByName = roomsByName;
+ }
+
+ @OneToMany(targetEntity = Cleaner.class)
+ @MapKeyClass(Room.class)
+ public Map getCleaners() {
+ return cleaners;
+ }
+
+ public void setCleaners(Map cleaners) {
+ this.cleaners = cleaners;
+ }
+}
\ No newline at end of file
Modified: jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/util/TestUtil.java
===================================================================
--- jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/util/TestUtil.java 2010-01-29 06:13:23 UTC (rev 18671)
+++ jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/util/TestUtil.java 2010-01-29 20:07:40 UTC (rev 18672)
@@ -96,7 +96,7 @@
Assert.assertTrue( hasFieldInMetamodelFor( clazz, fieldName ), errorString );
}
- public static void assertFieldTypeInMetaModelFor(Class<?> clazz, String fieldName, Class expectedType, String errorString) {
+ public static void assertAttributeTypeInMetaModelFor(Class<?> clazz, String fieldName, Class<?> expectedType, String errorString) {
Field field = getFieldFromMetamodelFor( clazz, fieldName );
assertNotNull( field );
ParameterizedType type = ( ParameterizedType ) field.getGenericType();
@@ -108,6 +108,18 @@
assertEquals( actualType, expectedType, errorString );
}
+ public static void assertMapAttributesInMetaModelFor(Class<?> clazz, String fieldName, Class<?> expectedMapKey, Class<?> expectedMapValue, String errorString) {
+ Field field = getFieldFromMetamodelFor( clazz, fieldName );
+ assertNotNull( field );
+ ParameterizedType type = ( ParameterizedType ) field.getGenericType();
+ Type actualMapKeyType = type.getActualTypeArguments()[1];
+ assertEquals( actualMapKeyType, expectedMapKey, errorString );
+
+ Type actualMapKeyValue = type.getActualTypeArguments()[2];
+ assertEquals( actualMapKeyValue, expectedMapValue, errorString );
+ }
+
+
public static void assertSuperClassRelationShipInMetamodel(Class<?> entityClass, Class<?> superEntityClass) {
String entityModelClassName = entityClass.getName() + META_MODEL_CLASS_POSTFIX;
String superEntityModelClassName = superEntityClass.getName() + META_MODEL_CLASS_POSTFIX;
Modified: jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/xmlmapped/Boy.java
===================================================================
--- jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/xmlmapped/Boy.java 2010-01-29 06:13:23 UTC (rev 18671)
+++ jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/xmlmapped/Boy.java 2010-01-29 20:07:40 UTC (rev 18672)
@@ -27,11 +27,7 @@
private String name;
- /*
- * The mapping in boy.xml specifies as target-class for the element collection java.lang.Integer. This makes no
- * sense from a mapping point, but makes it easy to test.
- */
- private List<String> nickNames;
+ private List nickNames;
private Superhero favoriteSuperhero;
Modified: jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/xmlmapped/XmlMappingTest.java
===================================================================
--- jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/xmlmapped/XmlMappingTest.java 2010-01-29 06:13:23 UTC (rev 18671)
+++ jpamodelgen/trunk/src/test/java/org/hibernate/jpamodelgen/test/xmlmapped/XmlMappingTest.java 2010-01-29 20:07:40 UTC (rev 18672)
@@ -21,7 +21,7 @@
import org.hibernate.jpamodelgen.test.util.CompilationTest;
-import static org.hibernate.jpamodelgen.test.util.TestUtil.assertFieldTypeInMetaModelFor;
+import static org.hibernate.jpamodelgen.test.util.TestUtil.assertAttributeTypeInMetaModelFor;
import static org.hibernate.jpamodelgen.test.util.TestUtil.assertMetamodelClassGeneratedFor;
import static org.hibernate.jpamodelgen.test.util.TestUtil.assertPresenceOfFieldInMetamodelFor;
import static org.hibernate.jpamodelgen.test.util.TestUtil.assertSuperClassRelationShipInMetamodel;
@@ -48,7 +48,7 @@
public void testTargetEntityOnOneToOne() {
assertMetamodelClassGeneratedFor( Boy.class );
assertPresenceOfFieldInMetamodelFor( Boy.class, "favoriteSuperhero", "favoriteSuperhero field should exist" );
- assertFieldTypeInMetaModelFor(
+ assertAttributeTypeInMetaModelFor(
Boy.class, "favoriteSuperhero", FakeHero.class, "target entity overridden in xml"
);
}
@@ -60,7 +60,7 @@
public void testTargetEntityOnOneToMany() {
assertMetamodelClassGeneratedFor( Boy.class );
assertPresenceOfFieldInMetamodelFor( Boy.class, "knowsHeros", "knowsHeros field should exist" );
- assertFieldTypeInMetaModelFor(
+ assertAttributeTypeInMetaModelFor(
Boy.class, "knowsHeros", FakeHero.class, "target entity overridden in xml"
);
}
@@ -72,7 +72,7 @@
public void testTargetEntityOnManyToMany() {
assertMetamodelClassGeneratedFor( Boy.class );
assertPresenceOfFieldInMetamodelFor( Boy.class, "savedBy", "savedBy field should exist" );
- assertFieldTypeInMetaModelFor(
+ assertAttributeTypeInMetaModelFor(
Boy.class, "savedBy", FakeHero.class, "target entity overridden in xml"
);
}
@@ -81,7 +81,7 @@
public void testXmlConfiguredElementCollection() {
assertMetamodelClassGeneratedFor( Boy.class );
assertPresenceOfFieldInMetamodelFor( Boy.class, "nickNames", "nickNames field should exist" );
- assertFieldTypeInMetaModelFor( Boy.class, "nickNames", Integer.class, "target class overridden in xml" );
+ assertAttributeTypeInMetaModelFor( Boy.class, "nickNames", String.class, "target class overridden in xml" );
}
Modified: jpamodelgen/trunk/src/test/resources/org/hibernate/jpamodelgen/test/xmlmapped/boy.xml
===================================================================
--- jpamodelgen/trunk/src/test/resources/org/hibernate/jpamodelgen/test/xmlmapped/boy.xml 2010-01-29 06:13:23 UTC (rev 18671)
+++ jpamodelgen/trunk/src/test/resources/org/hibernate/jpamodelgen/test/xmlmapped/boy.xml 2010-01-29 20:07:40 UTC (rev 18672)
@@ -13,7 +13,7 @@
<one-to-many name="knowsHeros" target-entity="org.hibernate.jpamodelgen.test.xmlmapped.FakeHero"/>
<one-to-one name="favoriteSuperhero" target-entity="org.hibernate.jpamodelgen.test.xmlmapped.FakeHero"/>
<many-to-many name="savedBy" target-entity="org.hibernate.jpamodelgen.test.xmlmapped.FakeHero"/>
- <element-collection name="nickNames" target-class="java.lang.Integer"/>
+ <element-collection name="nickNames" target-class="java.lang.String"/>
</attributes>
</entity>
</entity-mappings>
14 years, 9 months
Hibernate SVN: r18671 - core/branches/Branch_3_3/parent.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-01-29 01:13:23 -0500 (Fri, 29 Jan 2010)
New Revision: 18671
Modified:
core/branches/Branch_3_3/parent/pom.xml
Log:
Reverted to using the file based deployments for releases. the scm:svn approach is garbage
Modified: core/branches/Branch_3_3/parent/pom.xml
===================================================================
--- core/branches/Branch_3_3/parent/pom.xml 2010-01-29 06:12:23 UTC (rev 18670)
+++ core/branches/Branch_3_3/parent/pom.xml 2010-01-29 06:13:23 UTC (rev 18671)
@@ -369,9 +369,11 @@
<distributionManagement>
<repository>
+ <!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
+ <!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
+ <!-- todo : replace this with direct svn access once the svnkit providers are available -->
<id>repository.jboss.org</id>
- <name>JBoss Release Repository</name>
- <url>scm:svn:https://svn.jboss.org/repos/repository.jboss.org/maven2</url>
+ <url>file://${maven.repository.root}</url>
</repository>
<snapshotRepository>
<id>snapshots.jboss.org</id>
14 years, 10 months
Hibernate SVN: r18670 - core/trunk/parent.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-01-29 01:12:23 -0500 (Fri, 29 Jan 2010)
New Revision: 18670
Modified:
core/trunk/parent/pom.xml
Log:
Reverted to using the file based deployments for releases. the scm:svn approach is garbage
Modified: core/trunk/parent/pom.xml
===================================================================
--- core/trunk/parent/pom.xml 2010-01-29 04:07:52 UTC (rev 18669)
+++ core/trunk/parent/pom.xml 2010-01-29 06:12:23 UTC (rev 18670)
@@ -524,9 +524,11 @@
<distributionManagement>
<repository>
+ <!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
+ <!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
+ <!-- todo : replace this with direct svn access once the svnkit providers are available -->
<id>repository.jboss.org</id>
- <name>JBoss Release Repository</name>
- <url>scm:svn:https://svn.jboss.org/repos/repository.jboss.org/maven2</url>
+ <url>file://${maven.repository.root}</url>
</repository>
<snapshotRepository>
<id>snapshots.jboss.org</id>
14 years, 10 months
Hibernate SVN: r18669 - core/tags/hibernate-3.5.0-Beta-4/parent.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-01-28 23:07:52 -0500 (Thu, 28 Jan 2010)
New Revision: 18669
Modified:
core/tags/hibernate-3.5.0-Beta-4/parent/pom.xml
Log:
changed distributionManagement url
Modified: core/tags/hibernate-3.5.0-Beta-4/parent/pom.xml
===================================================================
--- core/tags/hibernate-3.5.0-Beta-4/parent/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
+++ core/tags/hibernate-3.5.0-Beta-4/parent/pom.xml 2010-01-29 04:07:52 UTC (rev 18669)
@@ -526,7 +526,7 @@
<repository>
<id>repository.jboss.org</id>
<name>JBoss Release Repository</name>
- <url>scm:svn:https://svn.jboss.org/repos/repository.jboss.org/maven2</url>
+ <url>file://${maven.repository.root}</url>
</repository>
<snapshotRepository>
<id>snapshots.jboss.org</id>
14 years, 10 months
Hibernate SVN: r18668 - in core/trunk: annotations and 25 other directories.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-01-28 19:57:52 -0500 (Thu, 28 Jan 2010)
New Revision: 18668
Modified:
core/trunk/annotations/pom.xml
core/trunk/cache-ehcache/pom.xml
core/trunk/cache-infinispan/pom.xml
core/trunk/cache-jbosscache/pom.xml
core/trunk/cache-oscache/pom.xml
core/trunk/cache-swarmcache/pom.xml
core/trunk/connection-c3p0/pom.xml
core/trunk/connection-proxool/pom.xml
core/trunk/core/pom.xml
core/trunk/distribution/pom.xml
core/trunk/documentation/envers/pom.xml
core/trunk/documentation/jbosscache2/pom.xml
core/trunk/documentation/manual/pom.xml
core/trunk/documentation/pom.xml
core/trunk/entitymanager/pom.xml
core/trunk/envers/pom.xml
core/trunk/hibernate-maven-plugin/pom.xml
core/trunk/jdbc3-testing/pom.xml
core/trunk/jdbc4-testing/pom.xml
core/trunk/jmx/pom.xml
core/trunk/parent/pom.xml
core/trunk/pom.xml
core/trunk/testing/pom.xml
core/trunk/testsuite/pom.xml
core/trunk/tutorials/eg/pom.xml
core/trunk/tutorials/pom.xml
core/trunk/tutorials/web/pom.xml
Log:
setting the version number on trunk back to 3.5.0-SNAPSHOT
Modified: core/trunk/annotations/pom.xml
===================================================================
--- core/trunk/annotations/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/annotations/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -31,7 +31,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-ehcache/pom.xml
===================================================================
--- core/trunk/cache-ehcache/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/cache-ehcache/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-infinispan/pom.xml
===================================================================
--- core/trunk/cache-infinispan/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/cache-infinispan/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-jbosscache/pom.xml
===================================================================
--- core/trunk/cache-jbosscache/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/cache-jbosscache/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -26,7 +26,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-oscache/pom.xml
===================================================================
--- core/trunk/cache-oscache/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/cache-oscache/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-swarmcache/pom.xml
===================================================================
--- core/trunk/cache-swarmcache/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/cache-swarmcache/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/connection-c3p0/pom.xml
===================================================================
--- core/trunk/connection-c3p0/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/connection-c3p0/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/connection-proxool/pom.xml
===================================================================
--- core/trunk/connection-proxool/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/connection-proxool/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/core/pom.xml
===================================================================
--- core/trunk/core/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/core/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/distribution/pom.xml
===================================================================
--- core/trunk/distribution/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/distribution/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -32,7 +32,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/documentation/envers/pom.xml
===================================================================
--- core/trunk/documentation/envers/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/documentation/envers/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/documentation/jbosscache2/pom.xml
===================================================================
--- core/trunk/documentation/jbosscache2/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/documentation/jbosscache2/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -34,7 +34,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/documentation/manual/pom.xml
===================================================================
--- core/trunk/documentation/manual/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/documentation/manual/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/documentation/pom.xml
===================================================================
--- core/trunk/documentation/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/documentation/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/entitymanager/pom.xml
===================================================================
--- core/trunk/entitymanager/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/entitymanager/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -7,7 +7,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/envers/pom.xml
===================================================================
--- core/trunk/envers/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/envers/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/hibernate-maven-plugin/pom.xml
===================================================================
--- core/trunk/hibernate-maven-plugin/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/hibernate-maven-plugin/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -27,7 +27,7 @@
<parent>
<artifactId>hibernate-parent</artifactId>
<groupId>org.hibernate</groupId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/jdbc3-testing/pom.xml
===================================================================
--- core/trunk/jdbc3-testing/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/jdbc3-testing/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/jdbc4-testing/pom.xml
===================================================================
--- core/trunk/jdbc4-testing/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/jdbc4-testing/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/jmx/pom.xml
===================================================================
--- core/trunk/jmx/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/jmx/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -29,7 +29,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/parent/pom.xml
===================================================================
--- core/trunk/parent/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/parent/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -31,7 +31,7 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
<packaging>pom</packaging>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<name>Hibernate Core Parent POM</name>
<description>The base POM for all Hibernate Core modules.</description>
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/testing/pom.xml
===================================================================
--- core/trunk/testing/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/testing/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -7,7 +7,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/testsuite/pom.xml
===================================================================
--- core/trunk/testsuite/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/testsuite/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/tutorials/eg/pom.xml
===================================================================
--- core/trunk/tutorials/eg/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/tutorials/eg/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -32,7 +32,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-tutorials</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: core/trunk/tutorials/pom.xml
===================================================================
--- core/trunk/tutorials/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/tutorials/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -31,7 +31,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/tutorials/web/pom.xml
===================================================================
--- core/trunk/tutorials/web/pom.xml 2010-01-29 00:53:55 UTC (rev 18667)
+++ core/trunk/tutorials/web/pom.xml 2010-01-29 00:57:52 UTC (rev 18668)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-tutorials</artifactId>
- <version>3.5.0-Beta-4</version>
+ <version>3.5.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
14 years, 10 months
Hibernate SVN: r18667 - core/tags.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-01-28 19:53:55 -0500 (Thu, 28 Jan 2010)
New Revision: 18667
Added:
core/tags/hibernate-3.5.0-Beta-4/
Log:
Creating tag for 3.5.0-Beta-4 release
Copied: core/tags/hibernate-3.5.0-Beta-4 (from rev 18666, core/trunk)
14 years, 10 months
Hibernate SVN: r18666 - in core/trunk: annotations and 25 other directories.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-01-28 19:46:30 -0500 (Thu, 28 Jan 2010)
New Revision: 18666
Modified:
core/trunk/annotations/pom.xml
core/trunk/cache-ehcache/pom.xml
core/trunk/cache-infinispan/pom.xml
core/trunk/cache-jbosscache/pom.xml
core/trunk/cache-oscache/pom.xml
core/trunk/cache-swarmcache/pom.xml
core/trunk/changelog.txt
core/trunk/connection-c3p0/pom.xml
core/trunk/connection-proxool/pom.xml
core/trunk/core/pom.xml
core/trunk/distribution/pom.xml
core/trunk/documentation/envers/pom.xml
core/trunk/documentation/jbosscache2/pom.xml
core/trunk/documentation/manual/pom.xml
core/trunk/documentation/pom.xml
core/trunk/entitymanager/pom.xml
core/trunk/envers/pom.xml
core/trunk/hibernate-maven-plugin/pom.xml
core/trunk/jdbc3-testing/pom.xml
core/trunk/jdbc4-testing/pom.xml
core/trunk/jmx/pom.xml
core/trunk/parent/pom.xml
core/trunk/pom.xml
core/trunk/testing/pom.xml
core/trunk/testsuite/pom.xml
core/trunk/tutorials/eg/pom.xml
core/trunk/tutorials/pom.xml
core/trunk/tutorials/web/pom.xml
Log:
prep 3.5.0-Beta-4
Modified: core/trunk/annotations/pom.xml
===================================================================
--- core/trunk/annotations/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/annotations/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -31,7 +31,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-ehcache/pom.xml
===================================================================
--- core/trunk/cache-ehcache/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/cache-ehcache/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-infinispan/pom.xml
===================================================================
--- core/trunk/cache-infinispan/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/cache-infinispan/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-jbosscache/pom.xml
===================================================================
--- core/trunk/cache-jbosscache/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/cache-jbosscache/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -26,7 +26,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-oscache/pom.xml
===================================================================
--- core/trunk/cache-oscache/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/cache-oscache/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/cache-swarmcache/pom.xml
===================================================================
--- core/trunk/cache-swarmcache/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/cache-swarmcache/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/changelog.txt
===================================================================
--- core/trunk/changelog.txt 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/changelog.txt 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,67 @@
refer to the particular case on JIRA using the issue tracking number to learn
more about each case.
+Changes in version 3.5.0-Beta-4 (2010.01.28)
+-------------------------------------------
+- http://opensource.atlassian.com/projects/hibernate/browse/HHH/fixforversi...
+** Sub-task
+ * [HHH-4529] - Partial support for derived identity (including @MapsId)
+ * [HHH-4651] - Add support for EntityManager properties
+ * [HHH-4659] - Add support for standard declarative cache (@Cacheable)
+ * [HHH-4660] - Support Cache Retrieve Mode and Cache Store Mode Properties
+ * [HHH-4669] - Implement JDBC driver properties support
+ * [HHH-4677] - implement PersistenceUnitInfo#getPersistenceXMLSchemaVersion(); and the same in PersistenceMetadata
+ * [HHH-4678] - Apply PersistenceUnitInfo#getSharedCacheMode and #getValidationMode
+ * [HHH-4690] - Consider adding a flag for legacy/new generators
+ * [HHH-4725] - implement orphanRemoval for OneToOne
+ * [HHH-4849] - Derived Identity: default @JoinColumn is not honored for properties linked to @MapsId
+
+** Bug
+ * [HHH-3828] - Criteria: Restriction whith class does not work
+ * [HHH-4736] - Cannot pass ValidatorFactory into PersistenceProvider.createContainerEntityManagerFactory(PersistenceUnitInfo, Map)
+ * [HHH-4781] - When a read-only entity is refreshed it is changed to modifiable
+ * [HHH-4789] - Check annotations and entitymanager poms for consistent plugin configuration
+ * [HHH-4796] - NullPointerException when an @AssociationOverride joinColumn is set but no @AssociationOverride joinTable is on a given property
+ * [HHH-4797] - Backref properties should be ignored when building the JPA 2 metamodel (leading atm to java.lang.IllegalArgumentException: Cannot determine java-type from given member [null])
+ * [HHH-4804] - Entities in non-lazy associations loaded by a read-only HQL Query are not read-only
+ * [HHH-4805] - JPA 2 metamodel impl ignores nested generics
+ * [HHH-4806] - em.getTransaction.commit() does not always wrap in a RollbackException
+ * [HHH-4807] - not-null checking no longer applied even if Bean Validation is not present
+ * [HHH-4828] - Entities returned by Query...setReadOnly(true)...iterate() should be read-only
+ * [HHH-4834] - Exception in the metamodel population when raw types are used in collections
+ * [HHH-4843] - org.hibernate.ejb.util.LogHelper assumes javax.persistence.spi.PersistenceUnitInfo#getProperties is never null
+ * [HHH-4846] - NPE in AbstractIdentifiableType.checkDeclaredVersion
+ * [HHH-4847] - In nested id generators, use the context aka idObject for set operation and the raw entity as input for generation
+ * [HHH-4850] - Transaction commit throws RollbackException instead of PessimisticLockException
+ * [HHH-4851] - OneToOneSecondPass Metadata is mistakenly interpreted
+ * [HHH-4853] - 3.4.4.3 Lock Mode Properties and Uses, "Vendor-specific hints must be ignored if they are not understood. "
+ * [HHH-4855] - Incorrectly tries to search a secondary table when globally quoted identifiers are used
+ * [HHH-4858] - Implicitly add a cascade PERSIST when @MapsId is used
+ * [HHH-4859] - NPE when the entity uses a core-style "embedded" id (ie not an @IdClass nor an explicit @EmbeddedId)
+ * [HHH-4862] - quoted column/alias names not properly handled in org.hibernate.loader.EntityAliases
+
+** Improvement
+ * [HHH-4552] - Support generated value within composite keys
+ * [HHH-4813] - annotation and entitymanager module should use the maven-injection-plugin to generate version string
+ * [HHH-4816] - Cleanup JPA setting name constants
+
+** New Feature
+ * [HHH-2501] - Add capability to set a default read-only/modifiable setting for a session
+ * [HHH-2762] - SessionImplementor.getNonFlushedChanges()/applyNonFlushedChanges() API and initial implementation
+ * [HHH-4616] - Configure global/cache level JMX statistics from Hibernate configuration file
+ * [HHH-4726] - Add support for delete-orphan cascading to <one-to-one/>
+ * [HHH-4840] - Support embedded id properties like core
+
+** Task
+ * [HHH-4792] - Validate fix for HHH-4791
+ * [HHH-4793] - Revert disabling of VersionsJoinTableRangeComponentNamingTest and fix underlying issue
+ * [HHH-4799] - Create a *unit* test that asserts SerializationHelper's ability to deser a class using an "isolated classloader" (aka a TCCL)
+ * [HHH-4822] - Add @FailureExpected annotation to annotations and entitymananger modules to allow the skipping of tests
+ * [HHH-4823] - Reorder modules in top level pom so that testsuite runs directly after core
+ * [HHH-4856] - Upgrade dependency to jpa metamodel generator
+
+
Changes in version 3.5.0-Beta-3 (2010.01.13)
-------------------------------------------
- http://opensource.atlassian.com/projects/hibernate/browse/HHH/fixforversi...
Modified: core/trunk/connection-c3p0/pom.xml
===================================================================
--- core/trunk/connection-c3p0/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/connection-c3p0/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/connection-proxool/pom.xml
===================================================================
--- core/trunk/connection-proxool/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/connection-proxool/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/core/pom.xml
===================================================================
--- core/trunk/core/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/core/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/distribution/pom.xml
===================================================================
--- core/trunk/distribution/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/distribution/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -32,7 +32,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/documentation/envers/pom.xml
===================================================================
--- core/trunk/documentation/envers/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/documentation/envers/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/documentation/jbosscache2/pom.xml
===================================================================
--- core/trunk/documentation/jbosscache2/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/documentation/jbosscache2/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -34,7 +34,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/documentation/manual/pom.xml
===================================================================
--- core/trunk/documentation/manual/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/documentation/manual/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/documentation/pom.xml
===================================================================
--- core/trunk/documentation/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/documentation/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/entitymanager/pom.xml
===================================================================
--- core/trunk/entitymanager/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/entitymanager/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -7,7 +7,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/envers/pom.xml
===================================================================
--- core/trunk/envers/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/envers/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/hibernate-maven-plugin/pom.xml
===================================================================
--- core/trunk/hibernate-maven-plugin/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/hibernate-maven-plugin/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -27,7 +27,7 @@
<parent>
<artifactId>hibernate-parent</artifactId>
<groupId>org.hibernate</groupId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/jdbc3-testing/pom.xml
===================================================================
--- core/trunk/jdbc3-testing/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/jdbc3-testing/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/jdbc4-testing/pom.xml
===================================================================
--- core/trunk/jdbc4-testing/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/jdbc4-testing/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/jmx/pom.xml
===================================================================
--- core/trunk/jmx/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/jmx/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -29,7 +29,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/parent/pom.xml
===================================================================
--- core/trunk/parent/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/parent/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -31,7 +31,7 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
<packaging>pom</packaging>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<name>Hibernate Core Parent POM</name>
<description>The base POM for all Hibernate Core modules.</description>
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/testing/pom.xml
===================================================================
--- core/trunk/testing/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/testing/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -7,7 +7,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/testsuite/pom.xml
===================================================================
--- core/trunk/testsuite/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/testsuite/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/tutorials/eg/pom.xml
===================================================================
--- core/trunk/tutorials/eg/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/tutorials/eg/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -32,7 +32,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-tutorials</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: core/trunk/tutorials/pom.xml
===================================================================
--- core/trunk/tutorials/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/tutorials/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -31,7 +31,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
Modified: core/trunk/tutorials/web/pom.xml
===================================================================
--- core/trunk/tutorials/web/pom.xml 2010-01-28 22:04:20 UTC (rev 18665)
+++ core/trunk/tutorials/web/pom.xml 2010-01-29 00:46:30 UTC (rev 18666)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-tutorials</artifactId>
- <version>3.5.0-SNAPSHOT</version>
+ <version>3.5.0-Beta-4</version>
<relativePath>../pom.xml</relativePath>
</parent>
14 years, 10 months
Hibernate SVN: r18665 - in core/trunk: core/src/main/java/org/hibernate/impl and 5 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-01-28 17:04:20 -0500 (Thu, 28 Jan 2010)
New Revision: 18665
Added:
core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/
core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/Mappings.hbm.xml
core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/NativeSqlAndQuotedIdentifiersTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/Person.java
Modified:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/quote/resultsetmappings/ExplicitSqlResultSetMappingTest.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/quote/resultsetmappings/MyEntity.java
core/trunk/core/src/main/java/org/hibernate/impl/SQLQueryImpl.java
core/trunk/core/src/main/java/org/hibernate/loader/ColumnEntityAliases.java
core/trunk/core/src/main/java/org/hibernate/loader/DefaultEntityAliases.java
core/trunk/core/src/main/java/org/hibernate/loader/custom/CustomLoader.java
core/trunk/core/src/main/java/org/hibernate/util/StringHelper.java
Log:
HHH-4862 - quoted column/alias names not properly handled in org.hibernate.loader.EntityAliases
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/quote/resultsetmappings/ExplicitSqlResultSetMappingTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/quote/resultsetmappings/ExplicitSqlResultSetMappingTest.java 2010-01-28 16:56:51 UTC (rev 18664)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/quote/resultsetmappings/ExplicitSqlResultSetMappingTest.java 2010-01-28 22:04:20 UTC (rev 18665)
@@ -24,6 +24,8 @@
package org.hibernate.test.annotations.quote.resultsetmappings;
import org.hibernate.Session;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.Environment;
import org.hibernate.test.annotations.TestCase;
/**
@@ -32,29 +34,58 @@
* @author Steve Ebersole
*/
public class ExplicitSqlResultSetMappingTest extends TestCase {
- private String queryString = "select t.\"NAME\" as \"QuotEd_nAMe\" from \"MY_ENTITY_TABLE_NAME\" t";
+ private String queryString = "select t.\"NAME\" as \"QuotEd_nAMe\" from \"MY_ENTITY_TABLE\" t";
@Override
protected Class<?>[] getAnnotatedClasses() {
return new Class<?>[] { MyEntity.class };
}
- public void testCompleteAutoDiscovery() {
+ @Override
+ protected void configure(Configuration cfg) {
+ cfg.setProperty( Environment.GLOBALLY_QUOTED_IDENTIFIERS, "true" );
+ }
+
+ private void prepareTestData() {
+ Session s = sfi().openSession();
+ s.beginTransaction();
+ s.save( new MyEntity( "mine" ) );
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ private void cleanupTestData() {
+ Session s = sfi().openSession();
+ s.beginTransaction();
+ s.createQuery( "delete MyEntity" ).executeUpdate();
+ s.getTransaction().commit();
+ s.close();
+ }
+
+ public void testCompleteScalarAutoDiscovery() {
+ prepareTestData();
+
Session s = openSession();
s.beginTransaction();
s.createSQLQuery( queryString )
.list();
s.getTransaction().commit();
s.close();
+
+ cleanupTestData();
}
- public void testPartialAutoDiscovery() {
+ public void testPartialScalarAutoDiscovery() {
+ prepareTestData();
+
Session s = openSession();
s.beginTransaction();
s.createSQLQuery( queryString )
- .setResultSetMapping( "explicitResultSetMapping" )
+ .setResultSetMapping( "explicitScalarResultSetMapping" )
.list();
s.getTransaction().commit();
s.close();
+
+ cleanupTestData();
}
}
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/quote/resultsetmappings/MyEntity.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/quote/resultsetmappings/MyEntity.java 2010-01-28 16:56:51 UTC (rev 18664)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/quote/resultsetmappings/MyEntity.java 2010-01-28 22:04:20 UTC (rev 18665)
@@ -26,9 +26,12 @@
import javax.persistence.Column;
import javax.persistence.ColumnResult;
import javax.persistence.Entity;
+import javax.persistence.EntityResult;
+import javax.persistence.FieldResult;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SqlResultSetMapping;
+import javax.persistence.SqlResultSetMappings;
import javax.persistence.Table;
/**
@@ -36,16 +39,41 @@
*
* @author Steve Ebersole
*/
-@SqlResultSetMapping(
- name="explicitResultSetMapping",
- columns={ @ColumnResult(name="`QuotEd_nAMe`") }
-)
+@SqlResultSetMappings({
+ @SqlResultSetMapping(
+ name="explicitScalarResultSetMapping",
+ columns={ @ColumnResult(name="QuotEd_nAMe") }
+ )
+ ,
+ @SqlResultSetMapping(
+ name="basicEntityResultSetMapping",
+ entities = @EntityResult( entityClass = MyEntity.class )
+ )
+ ,
+ @SqlResultSetMapping(
+ name="expandedEntityResultSetMapping",
+ entities = @EntityResult(
+ entityClass = MyEntity.class,
+ fields = {
+ @FieldResult( name = "id", column = "eId" ),
+ @FieldResult( name = "name", column = "eName" )
+ }
+ )
+ )
+})
@Entity
-@Table( name = "MY_ENTITY_TABLE_NAME" )
+@Table( name = "MY_ENTITY_TABLE" )
public class MyEntity {
private Long id;
private String name;
+ public MyEntity() {
+ }
+
+ public MyEntity(String name) {
+ this.name = name;
+ }
+
@Id
@GeneratedValue
public Long getId() {
Modified: core/trunk/core/src/main/java/org/hibernate/impl/SQLQueryImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/impl/SQLQueryImpl.java 2010-01-28 16:56:51 UTC (rev 18664)
+++ core/trunk/core/src/main/java/org/hibernate/impl/SQLQueryImpl.java 2010-01-28 22:04:20 UTC (rev 18665)
@@ -96,9 +96,12 @@
}
this.queryReturns = Arrays.asList( definition.getQueryReturns() );
}
- else {
+ else if ( queryDef.getQueryReturns() != null && queryDef.getQueryReturns().length > 0 ) {
this.queryReturns = Arrays.asList( queryDef.getQueryReturns() );
}
+ else {
+ this.queryReturns = new ArrayList();
+ }
this.querySpaces = queryDef.getQuerySpaces();
this.callable = queryDef.isCallable();
Modified: core/trunk/core/src/main/java/org/hibernate/loader/ColumnEntityAliases.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/loader/ColumnEntityAliases.java 2010-01-28 16:56:51 UTC (rev 18664)
+++ core/trunk/core/src/main/java/org/hibernate/loader/ColumnEntityAliases.java 2010-01-28 22:04:20 UTC (rev 18665)
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. 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.
+ * distributed under license by Red Hat Inc.
*
* 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
@@ -20,24 +20,29 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.loader;
import java.util.Map;
+import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.persister.entity.Loadable;
/**
- * EntityAliases that chooses the column names over the alias names.
+ * EntityAliases that chooses the column names over the alias names. This strategy is used
+ * when the result-set mapping did not give specific aliases to use in extracting from the
+ * result set. We use the column names from the underlying persister.
*
* @author max
- *
+ * @author Steve Ebersole
*/
public class ColumnEntityAliases extends DefaultEntityAliases {
- public ColumnEntityAliases(Map returnProperties, Loadable persister, String suffix) {
- super(returnProperties, persister, suffix);
+ public ColumnEntityAliases(
+ Map returnProperties,
+ Loadable persister,
+ String suffix) {
+ super( returnProperties, persister, suffix );
}
protected String[] getIdentifierAliases(Loadable persister, String suffix) {
@@ -51,6 +56,4 @@
protected String[] getPropertyAliases(Loadable persister, int j) {
return persister.getPropertyColumnNames(j);
}
-
-
}
Modified: core/trunk/core/src/main/java/org/hibernate/loader/DefaultEntityAliases.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/loader/DefaultEntityAliases.java 2010-01-28 16:56:51 UTC (rev 18664)
+++ core/trunk/core/src/main/java/org/hibernate/loader/DefaultEntityAliases.java 2010-01-28 22:04:20 UTC (rev 18665)
@@ -28,6 +28,7 @@
import org.hibernate.persister.entity.Loadable;
import org.hibernate.util.CollectionHelper;
+import org.hibernate.util.StringHelper;
/**
* EntityAliases which handles the logic of selecting user provided aliases (via return-property),
@@ -46,47 +47,63 @@
private final String rowIdAlias;
private final Map userProvidedAliases;
- public DefaultEntityAliases(Loadable persister, String suffix) {
- this(CollectionHelper.EMPTY_MAP, persister, suffix);
- }
-
/**
- * Calculate and cache select-clause suffixes.
- * @param map
+ * Calculate and cache select-clause aliases
+ *
+ * @param userProvidedAliases The explicit aliases provided in a result-set mapping.
+ * @param persister The persister for which we are generating select aliases
+ * @param suffix The calculated suffix.
*/
- public DefaultEntityAliases(Map userProvidedAliases, Loadable persister, String suffix) {
+ public DefaultEntityAliases(
+ Map userProvidedAliases,
+ Loadable persister,
+ String suffix) {
this.suffix = suffix;
this.userProvidedAliases = userProvidedAliases;
-
- String[] keyColumnsCandidates = getUserProvidedAliases(
- persister.getIdentifierPropertyName(),
- (String[]) null
- );
- if (keyColumnsCandidates==null) {
- suffixedKeyColumns = getUserProvidedAliases(
- "id",
+
+ suffixedKeyColumns = determineKeyAlias( persister, suffix );
+ suffixedPropertyColumns = determinePropertyAliases( persister );
+ suffixedDiscriminatorColumn = determineDiscriminatorAlias( persister, suffix );
+ suffixedVersionColumn = determineVersionAlias( persister );
+ rowIdAlias = Loadable.ROWID_ALIAS + suffix; // TODO: not visible to the user!
+ }
+
+ public DefaultEntityAliases(Loadable persister, String suffix) {
+ this( CollectionHelper.EMPTY_MAP, persister, suffix );
+ }
+
+ private String[] determineKeyAlias(Loadable persister, String suffix) {
+ final String[] aliases;
+ final String[] keyColumnsCandidates = getUserProvidedAliases( persister.getIdentifierPropertyName(), null );
+ if ( keyColumnsCandidates == null ) {
+ aliases = getUserProvidedAliases(
+ "id",
getIdentifierAliases(persister, suffix)
- );
- }
- else {
- suffixedKeyColumns = keyColumnsCandidates;
- }
- intern(suffixedKeyColumns);
-
- suffixedPropertyColumns = getSuffixedPropertyAliases(persister);
- suffixedDiscriminatorColumn = getUserProvidedAlias(
- "class",
- getDiscriminatorAlias(persister, suffix)
);
- if ( persister.isVersioned() ) {
- suffixedVersionColumn = suffixedPropertyColumns[ persister.getVersionProperty() ];
}
else {
- suffixedVersionColumn = null;
+ aliases = keyColumnsCandidates;
}
- rowIdAlias = Loadable.ROWID_ALIAS + suffix; // TODO: not visible to the user!
+ final String[] rtn = StringHelper.unquote( aliases, persister.getFactory().getDialect() );
+ intern( rtn );
+ return rtn;
}
+ private String[][] determinePropertyAliases(Loadable persister) {
+ return getSuffixedPropertyAliases( persister );
+ }
+
+ private String determineDiscriminatorAlias(Loadable persister, String suffix) {
+ String alias = getUserProvidedAlias( "class", getDiscriminatorAlias( persister, suffix ) );
+ return StringHelper.unquote( alias, persister.getFactory().getDialect() );
+ }
+
+ private String[] determineVersionAlias(Loadable persister) {
+ return persister.isVersioned()
+ ? suffixedPropertyColumns[ persister.getVersionProperty() ]
+ : null;
+ }
+
protected String getDiscriminatorAlias(Loadable persister, String suffix) {
return persister.getDiscriminatorAlias(suffix);
}
@@ -118,36 +135,55 @@
return columns[0];
}
}
-
+
+ /**
+ * {@inheritDoc}
+ */
public String[][] getSuffixedPropertyAliases(Loadable persister) {
- int size = persister.getPropertyNames().length;
- String[][] suffixedPropertyAliases = new String[size][];
+ final int size = persister.getPropertyNames().length;
+ final String[][] suffixedPropertyAliases = new String[size][];
for ( int j = 0; j < size; j++ ) {
suffixedPropertyAliases[j] = getUserProvidedAliases(
persister.getPropertyNames()[j],
- getPropertyAliases(persister, j)
- );
+ getPropertyAliases( persister, j )
+ );
+ suffixedPropertyAliases[j] = StringHelper.unquote( suffixedPropertyAliases[j], persister.getFactory().getDialect() );
intern( suffixedPropertyAliases[j] );
}
return suffixedPropertyAliases;
}
+ /**
+ * {@inheritDoc}
+ */
public String[] getSuffixedVersionAliases() {
return suffixedVersionColumn;
}
+ /**
+ * {@inheritDoc}
+ */
public String[][] getSuffixedPropertyAliases() {
return suffixedPropertyColumns;
}
+ /**
+ * {@inheritDoc}
+ */
public String getSuffixedDiscriminatorAlias() {
return suffixedDiscriminatorColumn;
}
+ /**
+ * {@inheritDoc}
+ */
public String[] getSuffixedKeyAliases() {
return suffixedKeyColumns;
}
+ /**
+ * {@inheritDoc}
+ */
public String getRowIdAlias() {
return rowIdAlias;
}
@@ -157,5 +193,4 @@
strings[i] = strings[i].intern();
}
}
-
}
Modified: core/trunk/core/src/main/java/org/hibernate/loader/custom/CustomLoader.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/loader/custom/CustomLoader.java 2010-01-28 16:56:51 UTC (rev 18664)
+++ core/trunk/core/src/main/java/org/hibernate/loader/custom/CustomLoader.java 2010-01-28 22:04:20 UTC (rev 18665)
@@ -58,6 +58,7 @@
import org.hibernate.util.ArrayHelper;
import org.hibernate.util.StringHelper;
+
/**
* Extension point for loaders which use a SQL result set with "unexpected" column aliases.
*
@@ -126,7 +127,7 @@
specifiedAliases.add( scalarRtn.getColumnAlias() );
resultColumnProcessors.add(
new ScalarResultColumnProcessor(
- StringHelper.unquote( scalarRtn.getColumnAlias() ),
+ StringHelper.unquote( scalarRtn.getColumnAlias(), factory.getDialect() ),
scalarRtn.getType()
)
);
Modified: core/trunk/core/src/main/java/org/hibernate/util/StringHelper.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/util/StringHelper.java 2010-01-28 16:56:51 UTC (rev 18664)
+++ core/trunk/core/src/main/java/org/hibernate/util/StringHelper.java 2010-01-28 22:04:20 UTC (rev 18665)
@@ -29,6 +29,8 @@
import java.util.ArrayList;
import java.util.Arrays;
+import org.hibernate.dialect.Dialect;
+
public final class StringHelper {
private static final int ALIAS_TRUNCATE_LENGTH = 10;
@@ -541,4 +543,59 @@
return name;
}
}
+
+ /**
+ * Determine if the given name is quoted. It is considered quoted if either:
+ * <ol>
+ * <li>starts AND ends with backticks (`)</li>
+ * <li>starts with dialect-specified {@link org.hibernate.dialect.Dialect#openQuote() open-quote}
+ * AND ends with dialect-specified {@link org.hibernate.dialect.Dialect#closeQuote() close-quote}</li>
+ * </ol>
+ *
+ * @param name The name to check
+ * @param dialect The dialect (to determine the "real" quoting chars).
+ *
+ * @return True if quoted, false otherwise
+ */
+ public static boolean isQuoted(String name, Dialect dialect) {
+ return name != null && name.length() != 0
+ && ( name.charAt( 0 ) == '`' && name.charAt( name.length() - 1 ) == '`'
+ || name.charAt( 0 ) == dialect.openQuote() && name.charAt( name.length() - 1 ) == dialect.closeQuote() );
+ }
+
+ /**
+ * Return the unquoted version of name stripping the start and end quote characters.
+ *
+ * @param name The name to be unquoted.
+ * @param dialect The dialect (to determine the "real" quoting chars).
+ *
+ * @return The unquoted version.
+ */
+ public static String unquote(String name, Dialect dialect) {
+ if ( isQuoted( name, dialect ) ) {
+ return name.substring( 1, name.length() - 1 );
+ }
+ else {
+ return name;
+ }
+ }
+
+ /**
+ * Return the unquoted version of name stripping the start and end quote characters.
+ *
+ * @param names The names to be unquoted.
+ * @param dialect The dialect (to determine the "real" quoting chars).
+ *
+ * @return The unquoted versions.
+ */
+ public static String[] unquote(String[] names, Dialect dialect) {
+ if ( names == null ) {
+ return null;
+ }
+ String[] unquoted = new String[ names.length ];
+ for ( int i = 0; i < names.length; i++ ) {
+ unquoted[i] = unquote( names[i], dialect );
+ }
+ return unquoted;
+ }
}
Copied: core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/Mappings.hbm.xml (from rev 18636, core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml)
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/Mappings.hbm.xml (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/Mappings.hbm.xml 2010-01-28 22:04:20 UTC (rev 18665)
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<!--
+ ~ Hibernate, Relational Persistence for Idiomatic Java
+ ~
+ ~ Copyright (c) 2010, Red Hat Inc. 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 Inc.
+ ~
+ ~ 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 hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="org.hibernate.test.sql.hand.quotedidentifiers">
+
+ <class name="Person" table="`Person`">
+ <id name="id" unsaved-value="0" column="`pId`">
+ <generator class="increment"/>
+ </id>
+ <property name="name" column="`pName`" not-null="true"/>
+ </class>
+
+ <resultset name="person-scalar">
+ <return-scalar column="`pId`"/>
+ <return-scalar column="`pName`"/>
+ </resultset>
+
+ <resultset name="person-entity-basic">
+ <return alias="p" class="Person"/>
+ </resultset>
+
+ <resultset name="person-entity-expanded">
+ <return alias="p" class="Person">
+ <return-property name="id" column="`pId`"/>
+ <return-property name="name" column="`pName`"/>
+ </return>
+ </resultset>
+
+ <sql-query name="query-person">
+ select p."pId", p."pName" from "Person" p
+ </sql-query>
+
+</hibernate-mapping>
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/NativeSqlAndQuotedIdentifiersTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/NativeSqlAndQuotedIdentifiersTest.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/NativeSqlAndQuotedIdentifiersTest.java 2010-01-28 22:04:20 UTC (rev 18665)
@@ -0,0 +1,105 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Inc. 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 Inc.
+ *
+ * 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.sql.hand.quotedidentifiers;
+
+import org.hibernate.SQLQuery;
+import org.hibernate.Session;
+import org.hibernate.dialect.Dialect;
+import org.hibernate.junit.functional.DatabaseSpecificFunctionalTestCase;
+
+/**
+ * Test of various situations with native-sql queries and quoted identifiers
+ *
+ * @author Steve Ebersole
+ */
+public class NativeSqlAndQuotedIdentifiersTest extends DatabaseSpecificFunctionalTestCase {
+ public NativeSqlAndQuotedIdentifiersTest(String string) {
+ super( string );
+ }
+
+ public String[] getMappings() {
+ return new String[] { "sql/hand/quotedidentifiers/Mappings.hbm.xml" };
+ }
+
+ @Override
+ public boolean appliesTo(Dialect dialect) {
+ return '\"' == dialect.openQuote();
+ }
+
+ @Override
+ protected void prepareTest() throws Exception {
+ Session session = sfi().openSession();
+ session.beginTransaction();
+ session.save( new Person( "me" ) );
+ session.getTransaction().commit();
+ session.close();
+ }
+
+ @Override
+ protected void cleanupTest() throws Exception {
+ Session session = sfi().openSession();
+ session.beginTransaction();
+ session.createQuery( "delete Person" ).executeUpdate();
+ session.getTransaction().commit();
+ session.close();
+ }
+
+ public void testCompleteScalarDiscovery() {
+ Session session = openSession();
+ session.beginTransaction();
+ session.getNamedQuery( "query-person" ).list();
+ session.getTransaction().commit();
+ session.close();
+ }
+
+ public void testPartialScalarDiscovery() {
+ Session session = openSession();
+ session.beginTransaction();
+ SQLQuery query = (SQLQuery) session.getNamedQuery( "query-person" );
+ query.setResultSetMapping( "person-scalar" );
+ query.list();
+ session.getTransaction().commit();
+ session.close();
+ }
+
+ public void testBasicEntityMapping() {
+ Session session = openSession();
+ session.beginTransaction();
+ SQLQuery query = (SQLQuery) session.getNamedQuery( "query-person" );
+ query.setResultSetMapping( "person-entity-basic" );
+ query.list();
+ session.getTransaction().commit();
+ session.close();
+ }
+
+ public void testExpandedEntityMapping() {
+ Session session = openSession();
+ session.beginTransaction();
+ SQLQuery query = (SQLQuery) session.getNamedQuery( "query-person" );
+ query.setResultSetMapping( "person-entity-expanded" );
+ query.list();
+ session.getTransaction().commit();
+ session.close();
+ }
+}
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/Person.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/Person.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/Person.java 2010-01-28 22:04:20 UTC (rev 18665)
@@ -0,0 +1,57 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Inc. 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 Inc.
+ *
+ * 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.sql.hand.quotedidentifiers;
+
+/**
+ * TODO : javadoc
+ *
+ * @author Steve Ebersole
+ */
+public class Person {
+ private Long id;
+ private String name;
+
+ public Person() {
+ }
+
+ public Person(String name) {
+ this.name = name;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
14 years, 10 months