Hibernate SVN: r16674 - core/tags.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-06-03 10:20:58 -0400 (Wed, 03 Jun 2009)
New Revision: 16674
Added:
core/tags/v327/
Log:
prep 3.2.7 release
15 years, 7 months
Hibernate SVN: r16673 - in core/branches/Branch_3_2: doc/reference/en and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-06-03 10:18:00 -0400 (Wed, 03 Jun 2009)
New Revision: 16673
Modified:
core/branches/Branch_3_2/build.xml
core/branches/Branch_3_2/changelog.txt
core/branches/Branch_3_2/doc/reference/en/master.xml
core/branches/Branch_3_2/readme.txt
core/branches/Branch_3_2/src/org/hibernate/cfg/Environment.java
Log:
prep 3.2.7 release
Modified: core/branches/Branch_3_2/build.xml
===================================================================
--- core/branches/Branch_3_2/build.xml 2009-06-03 13:53:36 UTC (rev 16672)
+++ core/branches/Branch_3_2/build.xml 2009-06-03 14:18:00 UTC (rev 16673)
@@ -22,7 +22,7 @@
<property name="name2" value="hibernate3"/>
<property name="version.major" value="3"/>
<property name="version.minor" value="2"/>
- <property name="version.micro" value="6"/>
+ <property name="version.micro" value="7"/>
<property name="version.qualifier" value="ga"/>
<property name="version.full" value="${version.major}.${version.minor}.${version.micro}.${version.qualifier}"/>
<property name="version.major_minor" value="${version.major}.${version.minor}"/>
Modified: core/branches/Branch_3_2/changelog.txt
===================================================================
--- core/branches/Branch_3_2/changelog.txt 2009-06-03 13:53:36 UTC (rev 16672)
+++ core/branches/Branch_3_2/changelog.txt 2009-06-03 14:18:00 UTC (rev 16673)
@@ -6,6 +6,93 @@
more about each case.
+Changes in version 3.2.7 (2009.06.03)
+-------------------------------------------
+
+** Bug
+ * [HHH-1930] - QuerySyntaxException "with-clause expressions did not reference from-clause element to which the with-clause was associated"
+ * [HHH-2021] - org.hibernate.cache.QueryKey has a fragile equals() method
+ * [HHH-2146] - NullpointerException in DefaultDeleteEventListener.deleteTransientEntity
+ * [HHH-2604] - Isolator.JdbcDelegate masks the exception if it isn't possible to open a connection.
+ * [HHH-2694] - create-drop with c3p0 causes SQLException
+ * [HHH-2745] - NullPointerException when eager fetching joined many-to-many with native SQL query
+ * [HHH-3006] - ConcurrentModificationException in AbstractBatcher results in infinite loop
+ * [HHH-3046] - Merge fails on complicated data structure because of cycle references
+ * [HHH-3111] - WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter.getStatus() implemented incorrect
+ * [HHH-3216] - Incorrect parse result in ParameterParser
+ * [HHH-3229] - Merge can fail when there is a transient entity reachable by multiple paths and at least one path does not cascade on merge
+ * [HHH-3231] - org.hibernate.id.enhanced.TableGenerator throws "IllegalArgumentException: alias not found: tbl" under Oracle
+ * [HHH-3282] - DB2Dialect should report supportsLobValueChangePropogation() == false
+ * [HHH-3309] - Serialize/Deserialize problem in AbstractLazyInitializer with entitymode.MAP.
+ * [HHH-3378] - DB2CustomSQLTest fails, need "RESULT SETS 1" in proc definitions
+ * [HHH-3409] - ResultTransformers need smarter equals() and hashCode() impls
+ * [HHH-3481] - JTATransactionFactory bug when Transaction cannot be found in JNDI
+ * [HHH-3483] - org.hibernate.test.hql.ScrollableCollectionFetchingTest#testScrollingJoinFetchesForward unsupported by DB2
+ * [HHH-3496] - DB2 hanging on JPALockTest and CMTTest
+ * [HHH-3501] - ASTParserLoadingTest testing unsupported queries for DB2
+ * [HHH-3506] - enabled filters should apply to HQL update/delete statements
+ * [HHH-3508] - Sybase Dialect - Override supportsCascadeDelete to return "false"
+ * [HHH-3519] - account for parameters in select clause of INSERT-SELECT for DB2
+ * [HHH-3584] - Generate SQL when Dynamic Update is true is including version field even when marked as updateable=false
+ * [HHH-3621] - Assertion failure in MigrationTest
+ * [HHH-3636] - Attempt to read invalid column when loading collection of subclasses mapped with table-per-subclass with discriminator
+ * [HHH-3640] - Some standard SQL functions are not implemented in Sybase
+ * [HHH-3662] - Merging read-only entities causes AssertionError("Merged entity does not have status set to MANAGED...")
+ * [HHH-3668] - Sybase does not support implicit conversion from character types to numeric types causes failing unit tests
+ * [HHH-3670] - Invalid test for str() for SQL Server and Sybase
+ * [HHH-3672] - Sybase - second(), minute(), hour(), and extract() cause GenericJDBCException
+ * [HHH-3675] - Limitations on Sybase ResultSet implementation cause unit test failures
+ * [HHH-3679] - Sybase conversion of Java byte to tinyint fails with 8-bit values causing unit test failures
+ * [HHH-3680] - Sybase - composite primary key in unit test exceeds maximum for index causing failure
+ * [HHH-3693] - Implicit Polymorphic query + pagination returning zero result
+ * [HHH-3696] - Sybase - unit tests fail when numeric values overflow in precision or scale on insert
+ * [HHH-3698] - Problem with HQL parameter bindings as indexed collection selectors
+ * [HHH-3699] - Problem with HQL parameter bindings for parameters in WITH join clause
+ * [HHH-3701] - SQL function "trim" is not available in Sybase Dialect
+ * [HHH-3749] - Only reuse FromElements originating from from-clause if their aliases match
+ * [HHH-3810] - Transient entities can be inserted twice on merge
+ * [HHH-3912] - Change for HHH-3159 causes InstantiationException
+
+** Improvement
+ * [HHH-1234] - allow tuplizers the opportunity to influence getSubclassEntityPersister() processing
+ * [HHH-2686] - Include a primary key in the sequence table used by id.enhanced.TableGenerator
+ * [HHH-3131] - Add a method to ActionQueue to tell whether there are currently entries in the executions collection
+ * [HHH-3159] - Oracle 11g - desupport of oracle.jdbc.driver
+ * [HHH-3249] - Make o.h.id.enhanced.TableGenerator more extension-friendly
+ * [HHH-3275] - Allow pluggable tuplizers for composite elements
+ * [HHH-3283] - protect BulkManipulationTest#testInsertWithGeneratedTimestampVersion where Dialect#supportsParametersInInsertSelect == false
+ * [HHH-3357] - improve performance of session.clear()
+ * [HHH-3358] - Enable JTATransactionFactory and JTATransaction factory to work without JNDI
+ * [HHH-3383] - QueryKey is storing references to entities instead of identifiers
+ * [HHH-3424] - concat() with param binding fails function on derby
+ * [HHH-3454] - Allow enhanced.TableGenerator to segment itself per entity as default
+ * [HHH-3456] - Make o.h.id.enhanced.SequenceStyleGenerator more extension-friendly
+ * [HHH-3471] - Provide true-false type that maps to int values
+ * [HHH-3515] - Introduce EntityNameResolver interface
+ * [HHH-3517] - Allow definition of the default tuplizer class to use
+ * [HHH-3518] - Remove Suite classes from testsuite module
+ * [HHH-3532] - schema update task should look for foreign key signature
+ * [HHH-3712] - Reorganize the Sybase dialect class hierarchy, add SybaseASE15Dialect, and mark SybaseDialect as deprecated
+ * [HHH-3750] - Allow dialects to handle difference in how Query.setFirstResult() should be interpreted
+ * [HHH-3751] - Enable Antlr tree parser tracing for HqlSqlWalker and SqlGenerator (tree parsers)
+ * [HHH-3886] - Update database credentials for QA Lab
+
+** New Feature
+ * [HHH-3343] - Postgres Plus Dialect
+
+** Patch
+ * [HHH-530] - Allow application of filters on subqueries
+ * [HHH-3294] - Version incorrectly incremented for unchanged persistent entity that is parent of a one to many relationship
+ * [HHH-3401] - H2 Database Dialect Fixes
+ * [HHH-3450] - Include SingletonEhCacheProvider as an additional caching provider (Greg Luck)
+ * [HHH-3650] - TableGenerator doesn't marks the "primary key" as not null, causing errors in some RDBMS's which expects the PK to be not-null
+
+** Task
+ * [HHH-3214] - Update unit tests and config files to use non-depracated Oracle dialects
+ * [HHH-3760] - Document EntityNameResolver
+
+
+
Changes in version 3.2.6 (2008.02.07)
-------------------------------------------
Modified: core/branches/Branch_3_2/doc/reference/en/master.xml
===================================================================
--- core/branches/Branch_3_2/doc/reference/en/master.xml 2009-06-03 13:53:36 UTC (rev 16672)
+++ core/branches/Branch_3_2/doc/reference/en/master.xml 2009-06-03 14:18:00 UTC (rev 16673)
@@ -33,7 +33,7 @@
<bookinfo>
<title>HIBERNATE - Relational Persistence for Idiomatic Java</title>
<subtitle>Hibernate Reference Documentation</subtitle>
- <releaseinfo>3.2.6</releaseinfo>
+ <releaseinfo>3.2.7</releaseinfo>
</bookinfo>
<toc/>
Modified: core/branches/Branch_3_2/readme.txt
===================================================================
--- core/branches/Branch_3_2/readme.txt 2009-06-03 13:53:36 UTC (rev 16672)
+++ core/branches/Branch_3_2/readme.txt 2009-06-03 14:18:00 UTC (rev 16673)
@@ -1,6 +1,6 @@
Hibernate - Relational Persistence for Idiomatic Java
=====================================================
-version 3.2.6, Feb 7, 2008
+version 3.2.7, June 3, 2009
Instructions
------------
Modified: core/branches/Branch_3_2/src/org/hibernate/cfg/Environment.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/cfg/Environment.java 2009-06-03 13:53:36 UTC (rev 16672)
+++ core/branches/Branch_3_2/src/org/hibernate/cfg/Environment.java 2009-06-03 14:18:00 UTC (rev 16673)
@@ -153,7 +153,7 @@
*/
public final class Environment {
- public static final String VERSION = "3.2.6";
+ public static final String VERSION = "3.2.7";
/**
* <tt>ConnectionProvider</tt> implementor to use when obtaining connections
15 years, 7 months
Hibernate SVN: r16672 - in beanvalidation/trunk/validation-tck/src: test/resources and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-06-03 09:53:36 -0400 (Wed, 03 Jun 2009)
New Revision: 16672
Removed:
beanvalidation/trunk/validation-tck/src/test/resources/META-INF/
Modified:
beanvalidation/trunk/validation-tck/src/main/resources/tck-tests.xml
Log:
Updated tck tests configuration and removed obsolete properties file
Modified: beanvalidation/trunk/validation-tck/src/main/resources/tck-tests.xml
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/resources/tck-tests.xml 2009-06-03 13:14:28 UTC (rev 16671)
+++ beanvalidation/trunk/validation-tck/src/main/resources/tck-tests.xml 2009-06-03 13:53:36 UTC (rev 16672)
@@ -4,15 +4,22 @@
<test name="JSR-303-TCK">
<method-selectors>
<method-selector>
- <selector-class name="org.jboss.testharness.impl.testng.DisableIntegrationTestsMethodSelector" />
+ <selector-class
+ name="org.jboss.testharness.impl.testng.DisableIntegrationTestsMethodSelector"/>
</method-selector>
<method-selector>
- <selector-class name="org.jboss.testharness.impl.testng.ExcludeIncontainerUnderInvestigationMethodSelector" />
+ <selector-class
+ name="org.jboss.testharness.impl.testng.ExcludeIncontainerUnderInvestigationMethodSelector"
+ />
</method-selector>
</method-selectors>
+ <groups>
+ <run>
+ <exclude name="underInvestigation"/>
+ </run>
+ </groups>
<packages>
- <package name="org.hibernate.jsr303.tck.tests.bootstrap.defaultprovider"/>
- <package name="org.hibernate.jsr303.tck.tests.bootstrap.validationxml"/>
+ <package name="org.hibernate.jsr303.tck.tests"/>
</packages>
</test>
-</suite>
\ No newline at end of file
+</suite>
15 years, 7 months
Hibernate SVN: r16671 - validator/trunk/hibernate-validator-tck-runner.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-06-03 09:14:28 -0400 (Wed, 03 Jun 2009)
New Revision: 16671
Modified:
validator/trunk/hibernate-validator-tck-runner/pom.xml
Log:
Made sure that the testng suite file is not overwritten on each run. This allows to modify the xml file and just run selected tests.
Modified: validator/trunk/hibernate-validator-tck-runner/pom.xml
===================================================================
--- validator/trunk/hibernate-validator-tck-runner/pom.xml 2009-06-03 12:25:37 UTC (rev 16670)
+++ validator/trunk/hibernate-validator-tck-runner/pom.xml 2009-06-03 13:14:28 UTC (rev 16671)
@@ -61,7 +61,7 @@
<artifactId>jsr303-tck</artifactId>
<type>xml</type>
<classifier>suite</classifier>
- <overWrite>true</overWrite>
+ <overWrite>false</overWrite>
</artifactItem>
<artifactItem>
<groupId>javax.validation</groupId>
15 years, 7 months
Hibernate SVN: r16670 - in validator/trunk: hibernate-validator/src/test/java/org/hibernate/validation/engine and 4 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-06-03 08:25:37 -0400 (Wed, 03 Jun 2009)
New Revision: 16670
Added:
validator/trunk/hibernate-validator-tck-runner/src/jboss-as/maven-ant-tasks.jar
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/Bar.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/Foo.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/InheritanceTest.java
Modified:
validator/trunk/hibernate-validator-tck-runner/pom.xml
validator/trunk/hibernate-validator-tck-runner/src/jboss-as/
validator/trunk/hibernate-validator-tck-runner/src/jboss-as/build.xml
validator/trunk/hibernate-validator-tck-runner/src/main/java/org/hibernate/validation/test/StandaloneContainersImpl.java
validator/trunk/pom.xml
Log:
Getting ready for test refactoring for tck
Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/Bar.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/Bar.java (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/Bar.java 2009-06-03 12:25:37 UTC (rev 16670)
@@ -0,0 +1,24 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, 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.validation.engine.inheritance;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public class Bar extends Foo {
+}
Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/Bar.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/Foo.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/Foo.java (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/Foo.java 2009-06-03 12:25:37 UTC (rev 16670)
@@ -0,0 +1,36 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, 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.validation.engine.inheritance;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public class Foo {
+ @NotNull
+ private String foo;
+
+ public String getFoo() {
+ return foo;
+ }
+
+ public void setFoo(String foo) {
+ this.foo = foo;
+ }
+}
Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/Foo.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/InheritanceTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/InheritanceTest.java (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/InheritanceTest.java 2009-06-03 12:25:37 UTC (rev 16670)
@@ -0,0 +1,58 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, 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.validation.engine.inheritance;
+
+import java.lang.annotation.Annotation;
+import javax.validation.BeanDescriptor;
+import javax.validation.PropertyDescriptor;
+import javax.validation.Validator;
+import javax.validation.constraints.NotNull;
+
+import org.slf4j.Logger;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+
+import org.hibernate.validation.util.LoggerFactory;
+import org.hibernate.validation.util.TestUtil;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public class InheritanceTest {
+
+ private static final Logger log = LoggerFactory.make();
+
+ @Test
+ public void testIsBeanConstrained() {
+ Validator validator = TestUtil.getValidator();
+ BeanDescriptor beanDescriptor = validator.getConstraintsForClass( Bar.class );
+
+ assertFalse( beanDescriptor.hasConstraints(), "There should be no direct constraints on the specified bean." );
+ assertTrue( beanDescriptor.isBeanConstrained(), "Bean should be constrainted " );
+
+ assertTrue( beanDescriptor.getConstraintsForProperty( "foo" ) != null );
+ PropertyDescriptor propDescriptor = beanDescriptor.getConstraintsForProperty( "foo" );
+ Annotation constraintAnnotation = (Annotation) propDescriptor.getConstraintDescriptors()
+ .iterator()
+ .next().getAnnotation();
+ assertTrue(
+ constraintAnnotation.annotationType() == NotNull.class
+ );
+ }
+}
Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/inheritance/InheritanceTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: validator/trunk/hibernate-validator-tck-runner/pom.xml
===================================================================
--- validator/trunk/hibernate-validator-tck-runner/pom.xml 2009-06-03 12:19:14 UTC (rev 16669)
+++ validator/trunk/hibernate-validator-tck-runner/pom.xml 2009-06-03 12:25:37 UTC (rev 16670)
@@ -37,7 +37,7 @@
<dependency>
<groupId>org.jboss.test-harness</groupId>
<artifactId>jboss-test-harness-jboss-as-50</artifactId>
- <version>1.0.0.BETA2</version>
+ <version>1.0.0.BETA3-SNAPSHOT</version>
</dependency>
</dependencies>
Property changes on: validator/trunk/hibernate-validator-tck-runner/src/jboss-as
___________________________________________________________________
Name: svn:ignore
+ target
Modified: validator/trunk/hibernate-validator-tck-runner/src/jboss-as/build.xml
===================================================================
--- validator/trunk/hibernate-validator-tck-runner/src/jboss-as/build.xml 2009-06-03 12:19:14 UTC (rev 16669)
+++ validator/trunk/hibernate-validator-tck-runner/src/jboss-as/build.xml 2009-06-03 12:25:37 UTC (rev 16670)
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<project name="JBoss5DeployerInstall" default="update" basedir="." xmlns:artifact="urn:maven-artifact-ant">
- <path id="maven-ant-tasks.classpath" path="../lib/maven-ant-tasks.jar" />
+ <path id="maven-ant-tasks.classpath" path="./maven-ant-tasks.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
<property name="maven.dir" location="${basedir}/lib/maven" />
Added: validator/trunk/hibernate-validator-tck-runner/src/jboss-as/maven-ant-tasks.jar
===================================================================
(Binary files differ)
Property changes on: validator/trunk/hibernate-validator-tck-runner/src/jboss-as/maven-ant-tasks.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: validator/trunk/hibernate-validator-tck-runner/src/main/java/org/hibernate/validation/test/StandaloneContainersImpl.java
===================================================================
--- validator/trunk/hibernate-validator-tck-runner/src/main/java/org/hibernate/validation/test/StandaloneContainersImpl.java 2009-06-03 12:19:14 UTC (rev 16669)
+++ validator/trunk/hibernate-validator-tck-runner/src/main/java/org/hibernate/validation/test/StandaloneContainersImpl.java 2009-06-03 12:25:37 UTC (rev 16670)
@@ -1,28 +1,97 @@
package org.hibernate.validation.test;
+import java.io.BufferedInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
import java.net.URL;
import org.jboss.testharness.api.DeploymentException;
import org.jboss.testharness.spi.StandaloneContainers;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class StandaloneContainersImpl implements StandaloneContainers {
+ private static Logger log = LoggerFactory.getLogger( StandaloneContainersImpl.class );
+
public void deploy(Iterable<Class<?>> classes) throws DeploymentException {
- //To change body of implemented methods use File | Settings | File Templates.
}
public void undeploy() {
- //To change body of implemented methods use File | Settings | File Templates.
}
public void setup() {
- //To change body of implemented methods use File | Settings | File Templates.
}
public void cleanup() {
- //To change body of implemented methods use File | Settings | File Templates.
}
- public void deploy(Iterable<Class<?>> classes, Iterable<URL> beansXmls) throws DeploymentException {
- //To change body of implemented methods use File | Settings | File Templates.
+ public void deploy(Iterable<Class<?>> classes, Iterable<URL> validationXmls) throws DeploymentException {
+ if ( validationXmls == null || !validationXmls.iterator().hasNext() ) {
+ Thread.currentThread()
+ .setContextClassLoader( new IgnoringValidationXmlClassLoader() );
+ return;
+ }
+
+ URL validationXmlUrl = validationXmls.iterator().next();
+ log.info( "Using {} as validation.xml", validationXmlUrl.toString() );
+ Thread.currentThread()
+ .setContextClassLoader( new CustomValidationXmlClassLoader( validationXmlUrl.getPath() ) );
}
+
+
+ private static class CustomValidationXmlClassLoader extends ClassLoader {
+ private final String customValidationXmlPath;
+
+ CustomValidationXmlClassLoader(String pathToCustomValidationXml) {
+ super( CustomValidationXmlClassLoader.class.getClassLoader() );
+ customValidationXmlPath = pathToCustomValidationXml;
+ }
+
+ public InputStream getResourceAsStream(String path) {
+ InputStream in;
+ if ( "META-INF/validation.xml".equals( path ) ) {
+ log.info( "Using {} as validation.xml", customValidationXmlPath );
+ if ( customValidationXmlPath.contains( ".jar!" ) ) {
+ path = customValidationXmlPath.substring( customValidationXmlPath.indexOf( "!" ) + 2 );
+ in = super.getResourceAsStream( path );
+ }
+ else {
+ in = loadFromDisk();
+ }
+ }
+ else {
+ in = super.getResourceAsStream( path );
+ }
+ return in;
+ }
+
+ private InputStream loadFromDisk() {
+ InputStream in;
+ try {
+ in = new BufferedInputStream( new FileInputStream( customValidationXmlPath ) );
+ }
+ catch ( IOException ioe ) {
+ String msg = "Unble to load " + customValidationXmlPath + " from disk";
+ log.error( msg );
+ throw new RuntimeException( msg );
+ }
+ return in;
+ }
+ }
+
+ private static class IgnoringValidationXmlClassLoader extends ClassLoader {
+ IgnoringValidationXmlClassLoader() {
+ super( IgnoringValidationXmlClassLoader.class.getClassLoader() );
+ }
+
+ public InputStream getResourceAsStream(String path) {
+ if ( "META-INF/validation.xml".equals( path ) ) {
+ log.info( "Ignoring call to load validation.xml" );
+ return null;
+ }
+ return super.getResourceAsStream( path );
+ }
+ }
}
+
Modified: validator/trunk/pom.xml
===================================================================
--- validator/trunk/pom.xml 2009-06-03 12:19:14 UTC (rev 16669)
+++ validator/trunk/pom.xml 2009-06-03 12:25:37 UTC (rev 16670)
@@ -23,7 +23,7 @@
<id>hardy.ferentschik</id>
<name>Hardy Ferentschik</name>
<email>hferents(a)redhat.com</email>
- <organization>JBoss, a division of Red Hat</organization>
+ <organization>JBoss, a division of Red Hat</organization>
<url>http://in.relation.to/Bloggers/Hardy</url>
</developer>
</developers>
15 years, 7 months
Hibernate SVN: r16669 - in beanvalidation/trunk/validation-tck: src/main/java/org/hibernate/jsr303/tck/tests/bootstrap/defaultprovider and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-06-03 08:19:14 -0400 (Wed, 03 Jun 2009)
New Revision: 16669
Modified:
beanvalidation/trunk/validation-tck/pom.xml
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/bootstrap/defaultprovider/DefaultBootstrapTest.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/bootstrap/validationxml/ValidationXmlBootstrapTest.java
Log:
Now the tck module depends on the refactored jboss test harness
Modified: beanvalidation/trunk/validation-tck/pom.xml
===================================================================
--- beanvalidation/trunk/validation-tck/pom.xml 2009-06-02 15:40:10 UTC (rev 16668)
+++ beanvalidation/trunk/validation-tck/pom.xml 2009-06-03 12:19:14 UTC (rev 16669)
@@ -56,12 +56,12 @@
<dependency>
<groupId>org.jboss.test-harness</groupId>
<artifactId>jboss-test-harness-api</artifactId>
- <version>1.0.0.BETA2</version>
+ <version>1.0.0.BETA3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jboss.test-harness</groupId>
<artifactId>jboss-test-harness</artifactId>
- <version>1.0.0.BETA2</version>
+ <version>1.0.0.BETA3-SNAPSHOT</version>
</dependency>
</dependencies>
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/bootstrap/defaultprovider/DefaultBootstrapTest.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/bootstrap/defaultprovider/DefaultBootstrapTest.java 2009-06-02 15:40:10 UTC (rev 16668)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/bootstrap/defaultprovider/DefaultBootstrapTest.java 2009-06-03 12:19:14 UTC (rev 16669)
@@ -25,6 +25,7 @@
import org.jboss.testharness.AbstractTest;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ArtifactType;
import org.jboss.testharness.impl.packaging.Classes;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
@@ -35,7 +36,7 @@
/**
* @author Hardy Ferentschik
*/
-@Artifact
+@Artifact(artifactType = ArtifactType.JSR303)
@Classes(Person.class)
public class DefaultBootstrapTest extends AbstractTest {
@Test
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/bootstrap/validationxml/ValidationXmlBootstrapTest.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/bootstrap/validationxml/ValidationXmlBootstrapTest.java 2009-06-02 15:40:10 UTC (rev 16668)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/bootstrap/validationxml/ValidationXmlBootstrapTest.java 2009-06-03 12:19:14 UTC (rev 16669)
@@ -17,24 +17,15 @@
*/
package org.hibernate.jsr303.tck.tests.bootstrap.validationxml;
-import java.util.Set;
-import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.ValidationException;
-import javax.validation.Validator;
-import javax.validation.ValidatorFactory;
+import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.testharness.AbstractTest;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ArtifactType;
import org.jboss.testharness.impl.packaging.Classes;
-import org.jboss.testharness.impl.packaging.Resource;
-import org.jboss.testharness.impl.packaging.Resources;
-import org.jboss.testharness.impl.packaging.Packaging;
-import org.jboss.testharness.impl.packaging.PackagingType;
-import org.jboss.testharness.impl.packaging.IntegrationTest;
-import org.jboss.test.audit.annotations.SpecAssertion;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
+import org.jboss.testharness.impl.packaging.jsr303.ValidationXml;
import static org.testng.Assert.fail;
import org.testng.annotations.Test;
@@ -43,22 +34,20 @@
/**
* @author Hardy Ferentschik
*/
-@Artifact
-@IntegrationTest
-(a)Packaging(PackagingType.WAR)
-@Resources({
- @Resource(destination = "WEB-INF/classes/META-INF/validation.xml", source = "validation.xml")
-})
+@Artifact(artifactType = ArtifactType.JSR303)
+@ValidationXml(value = "validation.xml")
@Classes(Person.class)
public class ValidationXmlBootstrapTest extends AbstractTest {
+
@Test
- @SpecAssertion( section = "8", id = "a")
+ @SpecAssertion(section = "8", id = "a")
public void testWrongProviderConfiguredInValidationXml() {
try {
Validation.buildDefaultValidatorFactory();
- fail();
- } catch (ValidationException e) {
-
+ fail( "valiation.xml contains a invalid provider. Validation.buildDefaultValidatorFactory() should have failed." );
}
+ catch ( ValidationException e ) {
+ // success
+ }
}
}
\ No newline at end of file
15 years, 7 months
Hibernate SVN: r16668 - in core/trunk: testsuite/src/test/java/org/hibernate/test/hql and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-06-02 11:40:10 -0400 (Tue, 02 Jun 2009)
New Revision: 16668
Modified:
core/trunk/core/src/main/java/org/hibernate/hql/ast/HqlSqlWalker.java
core/trunk/testsuite/src/test/java/org/hibernate/test/hql/WithClauseTest.java
Log:
HHH-1930 - QuerySyntaxException "with-clause expressions did not reference from-clause element to which the with-clause was associated"
Modified: core/trunk/core/src/main/java/org/hibernate/hql/ast/HqlSqlWalker.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/hql/ast/HqlSqlWalker.java 2009-06-02 15:39:48 UTC (rev 16667)
+++ core/trunk/core/src/main/java/org/hibernate/hql/ast/HqlSqlWalker.java 2009-06-02 15:40:10 UTC (rev 16668)
@@ -33,6 +33,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -66,7 +67,6 @@
import org.hibernate.hql.ast.tree.SelectClause;
import org.hibernate.hql.ast.tree.SelectExpression;
import org.hibernate.hql.ast.tree.UpdateStatement;
-import org.hibernate.hql.ast.tree.Node;
import org.hibernate.hql.ast.tree.OperatorNode;
import org.hibernate.hql.ast.tree.ParameterContainer;
import org.hibernate.hql.ast.util.ASTPrinter;
@@ -347,9 +347,7 @@
log.debug( "createFromJoinElement() : " + getASTPrinter().showAsString( fromElement, "-- join tree --" ) );
}
}
-
- private void handleWithFragment(FromElement fromElement, AST hqlWithNode) throws SemanticException
- {
+ private void handleWithFragment(FromElement fromElement, AST hqlWithNode) throws SemanticException {
try {
withClause( hqlWithNode );
AST hqlSqlWithNode = returnAST;
@@ -359,14 +357,22 @@
WithClauseVisitor visitor = new WithClauseVisitor( fromElement );
NodeTraverser traverser = new NodeTraverser( visitor );
traverser.traverseDepthFirst( hqlSqlWithNode );
- FromElement referencedFromElement = visitor.getReferencedFromElement();
- if ( referencedFromElement != fromElement ) {
- throw new InvalidWithClauseException( "with-clause expressions did not reference from-clause element to which the with-clause was associated" );
+
+ String withClauseJoinAlias = visitor.getJoinAlias();
+ if ( withClauseJoinAlias == null ) {
+ withClauseJoinAlias = fromElement.getCollectionTableAlias();
}
+ else {
+ FromElement referencedFromElement = visitor.getReferencedFromElement();
+ if ( referencedFromElement != fromElement ) {
+ throw new InvalidWithClauseException( "with-clause expressions did not reference from-clause element to which the with-clause was associated" );
+ }
+ }
+
SqlGenerator sql = new SqlGenerator( getSessionFactoryHelper().getFactory() );
sql.whereExpr( hqlSqlWithNode.getFirstChild() );
- fromElement.setWithClauseFragment( visitor.getJoinAlias(), "(" + sql.getSQL() + ")" );
+ fromElement.setWithClauseFragment( withClauseJoinAlias, "(" + sql.getSQL() + ")" );
}
catch( SemanticException e ) {
throw e;
@@ -854,8 +860,8 @@
}
ParameterNode parameter = ( ParameterNode ) astFactory.create( PARAM, "?" );
PositionalParameterSpecification paramSpec = new PositionalParameterSpecification(
- ( ( Node ) inputNode ).getLine(),
- ( ( Node ) inputNode ).getColumn(),
+ inputNode.getLine(),
+ inputNode.getColumn(),
positionalParameterCount++
);
parameter.setHqlParameterSpecification( paramSpec );
@@ -873,8 +879,8 @@
parameter.setText( "?" );
NamedParameterSpecification paramSpec = new NamedParameterSpecification(
- ( ( Node ) delimiterNode ).getLine(),
- ( ( Node ) delimiterNode ).getColumn(),
+ delimiterNode.getLine(),
+ delimiterNode.getColumn(),
name
);
parameter.setHqlParameterSpecification( paramSpec );
@@ -949,9 +955,7 @@
}
public void addQuerySpaces(Serializable[] spaces) {
- for ( int i = 0; i < spaces.length; i++ ) {
- querySpaces.add( spaces[i] );
- }
+ querySpaces.addAll( Arrays.asList( spaces ) );
}
public Type[] getReturnTypes() {
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/hql/WithClauseTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/hql/WithClauseTest.java 2009-06-02 15:39:48 UTC (rev 16667)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/hql/WithClauseTest.java 2009-06-02 15:40:10 UTC (rev 16668)
@@ -123,6 +123,11 @@
.list();
assertTrue( "ad-hoc on did not take effect", list.isEmpty() );
+ // http://opensource.atlassian.com/projects/hibernate/browse/HHH-1930
+ list = s.createQuery( "from Human h inner join h.nickNames as nicknames with nicknames = 'abc'" )
+ .list();
+ assertTrue( "ad-hoc on did not take effect", list.isEmpty() );
+
txn.commit();
s.close();
15 years, 7 months
Hibernate SVN: r16667 - in core/branches/Branch_3_2: test/org/hibernate/test/hql and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-06-02 11:39:48 -0400 (Tue, 02 Jun 2009)
New Revision: 16667
Modified:
core/branches/Branch_3_2/src/org/hibernate/hql/ast/HqlSqlWalker.java
core/branches/Branch_3_2/test/org/hibernate/test/hql/WithClauseTest.java
Log:
HHH-1930 - QuerySyntaxException "with-clause expressions did not reference from-clause element to which the with-clause was associated"
Modified: core/branches/Branch_3_2/src/org/hibernate/hql/ast/HqlSqlWalker.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/hql/ast/HqlSqlWalker.java 2009-06-02 15:39:21 UTC (rev 16666)
+++ core/branches/Branch_3_2/src/org/hibernate/hql/ast/HqlSqlWalker.java 2009-06-02 15:39:48 UTC (rev 16667)
@@ -10,6 +10,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.Arrays;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -43,7 +44,6 @@
import org.hibernate.hql.ast.tree.SelectClause;
import org.hibernate.hql.ast.tree.SelectExpression;
import org.hibernate.hql.ast.tree.UpdateStatement;
-import org.hibernate.hql.ast.tree.Node;
import org.hibernate.hql.ast.tree.OperatorNode;
import org.hibernate.hql.ast.tree.ParameterContainer;
import org.hibernate.hql.ast.util.ASTPrinter;
@@ -361,8 +361,7 @@
}
}
- private void handleWithFragment(FromElement fromElement, AST hqlWithNode) throws SemanticException
- {
+ private void handleWithFragment(FromElement fromElement, AST hqlWithNode) throws SemanticException {
try {
withClause( hqlWithNode );
AST hqlSqlWithNode = returnAST;
@@ -372,13 +371,22 @@
WithClauseVisitor visitor = new WithClauseVisitor( fromElement );
NodeTraverser traverser = new NodeTraverser( visitor );
traverser.traverseDepthFirst( hqlSqlWithNode );
- FromElement referencedFromElement = visitor.getReferencedFromElement();
- if ( referencedFromElement != fromElement ) {
- throw new InvalidWithClauseException( "with-clause expressions did not reference from-clause element to which the with-clause was associated" );
+
+ String withClauseJoinAlias = visitor.getJoinAlias();
+ if ( withClauseJoinAlias == null ) {
+ withClauseJoinAlias = fromElement.getCollectionTableAlias();
}
+ else {
+ FromElement referencedFromElement = visitor.getReferencedFromElement();
+ if ( referencedFromElement != fromElement ) {
+ throw new InvalidWithClauseException( "with-clause expressions did not reference from-clause element to which the with-clause was associated" );
+ }
+ }
+
SqlGenerator sql = new SqlGenerator( getSessionFactoryHelper().getFactory() );
sql.whereExpr( hqlSqlWithNode.getFirstChild() );
- fromElement.setWithClauseFragment( visitor.getJoinAlias(), "(" + sql.getSQL() + ")" );
+
+ fromElement.setWithClauseFragment( withClauseJoinAlias, "(" + sql.getSQL() + ")" );
}
catch( SemanticException e ) {
throw e;
@@ -866,8 +874,8 @@
}
ParameterNode parameter = ( ParameterNode ) astFactory.create( PARAM, "?" );
PositionalParameterSpecification paramSpec = new PositionalParameterSpecification(
- ( ( Node ) inputNode ).getLine(),
- ( ( Node ) inputNode ).getColumn(),
+ inputNode.getLine(),
+ inputNode.getColumn(),
positionalParameterCount++
);
parameter.setHqlParameterSpecification( paramSpec );
@@ -885,8 +893,8 @@
parameter.setText( "?" );
NamedParameterSpecification paramSpec = new NamedParameterSpecification(
- ( ( Node ) delimiterNode ).getLine(),
- ( ( Node ) delimiterNode ).getColumn(),
+ delimiterNode.getLine(),
+ delimiterNode.getColumn(),
name
);
parameter.setHqlParameterSpecification( paramSpec );
@@ -961,9 +969,7 @@
}
public void addQuerySpaces(Serializable[] spaces) {
- for ( int i = 0; i < spaces.length; i++ ) {
- querySpaces.add( spaces[i] );
- }
+ querySpaces.addAll( Arrays.asList( spaces ) );
}
public Type[] getReturnTypes() {
Modified: core/branches/Branch_3_2/test/org/hibernate/test/hql/WithClauseTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/hql/WithClauseTest.java 2009-06-02 15:39:21 UTC (rev 16666)
+++ core/branches/Branch_3_2/test/org/hibernate/test/hql/WithClauseTest.java 2009-06-02 15:39:48 UTC (rev 16667)
@@ -125,6 +125,11 @@
.list();
assertTrue( "ad-hoc on did not take effect", list.isEmpty() );
+ // http://opensource.atlassian.com/projects/hibernate/browse/HHH-1930
+ list = s.createQuery( "from Human h inner join h.nickNames as nicknames with nicknames = 'abc'" )
+ .list();
+ assertTrue( "ad-hoc on did not take effect", list.isEmpty() );
+
txn.commit();
s.close();
15 years, 7 months
Hibernate SVN: r16666 - in core/branches/Branch_3_3: testsuite/src/test/java/org/hibernate/test/hql and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-06-02 11:39:21 -0400 (Tue, 02 Jun 2009)
New Revision: 16666
Modified:
core/branches/Branch_3_3/core/src/main/java/org/hibernate/hql/ast/HqlSqlWalker.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/WithClauseTest.java
Log:
HHH-1930 - QuerySyntaxException "with-clause expressions did not reference from-clause element to which the with-clause was associated"
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/hql/ast/HqlSqlWalker.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/hql/ast/HqlSqlWalker.java 2009-06-02 09:30:14 UTC (rev 16665)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/hql/ast/HqlSqlWalker.java 2009-06-02 15:39:21 UTC (rev 16666)
@@ -66,7 +66,6 @@
import org.hibernate.hql.ast.tree.SelectClause;
import org.hibernate.hql.ast.tree.SelectExpression;
import org.hibernate.hql.ast.tree.UpdateStatement;
-import org.hibernate.hql.ast.tree.Node;
import org.hibernate.hql.ast.tree.OperatorNode;
import org.hibernate.hql.ast.tree.ParameterContainer;
import org.hibernate.hql.ast.util.ASTPrinter;
@@ -382,9 +381,7 @@
log.debug( "createFromJoinElement() : " + getASTPrinter().showAsString( fromElement, "-- join tree --" ) );
}
}
-
- private void handleWithFragment(FromElement fromElement, AST hqlWithNode) throws SemanticException
- {
+ private void handleWithFragment(FromElement fromElement, AST hqlWithNode) throws SemanticException {
try {
withClause( hqlWithNode );
AST hqlSqlWithNode = returnAST;
@@ -394,13 +391,22 @@
WithClauseVisitor visitor = new WithClauseVisitor( fromElement );
NodeTraverser traverser = new NodeTraverser( visitor );
traverser.traverseDepthFirst( hqlSqlWithNode );
- FromElement referencedFromElement = visitor.getReferencedFromElement();
- if ( referencedFromElement != fromElement ) {
- throw new InvalidWithClauseException( "with-clause expressions did not reference from-clause element to which the with-clause was associated" );
+
+ String withClauseJoinAlias = visitor.getJoinAlias();
+ if ( withClauseJoinAlias == null ) {
+ withClauseJoinAlias = fromElement.getCollectionTableAlias();
}
+ else {
+ FromElement referencedFromElement = visitor.getReferencedFromElement();
+ if ( referencedFromElement != fromElement ) {
+ throw new InvalidWithClauseException( "with-clause expressions did not reference from-clause element to which the with-clause was associated" );
+ }
+ }
+
SqlGenerator sql = new SqlGenerator( getSessionFactoryHelper().getFactory() );
sql.whereExpr( hqlSqlWithNode.getFirstChild() );
- fromElement.setWithClauseFragment( visitor.getJoinAlias(), "(" + sql.getSQL() + ")" );
+
+ fromElement.setWithClauseFragment( withClauseJoinAlias, "(" + sql.getSQL() + ")" );
}
catch( SemanticException e ) {
throw e;
@@ -888,8 +894,8 @@
}
ParameterNode parameter = ( ParameterNode ) astFactory.create( PARAM, "?" );
PositionalParameterSpecification paramSpec = new PositionalParameterSpecification(
- ( ( Node ) inputNode ).getLine(),
- ( ( Node ) inputNode ).getColumn(),
+ inputNode.getLine(),
+ inputNode.getColumn(),
positionalParameterCount++
);
parameter.setHqlParameterSpecification( paramSpec );
@@ -907,8 +913,8 @@
parameter.setText( "?" );
NamedParameterSpecification paramSpec = new NamedParameterSpecification(
- ( ( Node ) delimiterNode ).getLine(),
- ( ( Node ) delimiterNode ).getColumn(),
+ delimiterNode.getLine(),
+ delimiterNode.getColumn(),
name
);
parameter.setHqlParameterSpecification( paramSpec );
Modified: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/WithClauseTest.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/WithClauseTest.java 2009-06-02 09:30:14 UTC (rev 16665)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/WithClauseTest.java 2009-06-02 15:39:21 UTC (rev 16666)
@@ -123,6 +123,11 @@
.list();
assertTrue( "ad-hoc on did not take effect", list.isEmpty() );
+ // http://opensource.atlassian.com/projects/hibernate/browse/HHH-1930
+ list = s.createQuery( "from Human h inner join h.nickNames as nicknames with nicknames = 'abc'" )
+ .list();
+ assertTrue( "ad-hoc on did not take effect", list.isEmpty() );
+
txn.commit();
s.close();
15 years, 7 months
Hibernate SVN: r16665 - core/trunk/core/src/main/java/org/hibernate/event/def.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2009-06-02 05:30:14 -0400 (Tue, 02 Jun 2009)
New Revision: 16665
Added:
core/trunk/core/src/main/java/org/hibernate/event/def/EventCache.java
Removed:
core/trunk/core/src/main/java/org/hibernate/event/def/CopyCache.java
Modified:
core/trunk/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java
Log:
HHH-3810 : rename CopyCache to EventCache to be more generic
Deleted: core/trunk/core/src/main/java/org/hibernate/event/def/CopyCache.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/event/def/CopyCache.java 2009-06-02 08:44:49 UTC (rev 16664)
+++ core/trunk/core/src/main/java/org/hibernate/event/def/CopyCache.java 2009-06-02 09:30:14 UTC (rev 16665)
@@ -1,244 +0,0 @@
-//$Id: $
-/*
- * 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.event.def;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.Iterator;
-import java.util.Collection;
-
-import org.hibernate.util.IdentityMap;
-import org.hibernate.AssertionFailure;
-
-/**
- * CopyCache is intended to be the Map implementation used by
- * {@link DefaultMergeEventListener} to keep track of entities and their copies
- * being merged into the session. This implementation also tracks whether a
- * an entity in the CopyCache is included in the merge. This allows a
- * an entity and its copy to be added to a CopyCache before merge has cascaded
- * to that entity.
- *
- * @author Gail Badner
- */
-class CopyCache implements Map {
- private Map entityToCopyMap = IdentityMap.instantiate(10);
- // key is an entity involved with the merge;
- // value can be either a copy of the entity or the entity itself
-
- private Map entityToIncludeInMergeFlagMap = IdentityMap.instantiate(10);
- // key is an entity involved with the merge;
- // value is a flag indicating if the entity is included in the merge
-
- /**
- * Clears the CopyCache.
- */
- public void clear() {
- entityToCopyMap.clear();
- entityToIncludeInMergeFlagMap.clear();
- }
-
- /**
- * Returns true if this CopyCache contains a mapping for the specified entity.
- * @param entity must be non-null
- * @return true if this CopyCache contains a mapping for the specified entity
- * @throws NullPointerException if entity is null
- */
- public boolean containsKey(Object entity) {
- if ( entity == null ) {
- throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
- }
- return entityToCopyMap.containsKey( entity );
- }
-
- /**
- * Returns true if this CopyCache maps one or more entities to the specified copy.
- * @param copy must be non-null
- * @return true if this CopyCache maps one or more entities to the specified copy
- * @throws NullPointerException if copy is null
- */
- public boolean containsValue(Object copy) {
- if ( copy == null ) {
- throw new NullPointerException( "null copies are not supported by " + getClass().getName() );
- }
- return entityToCopyMap.containsValue( copy );
- }
-
- /**
- * Returns a set view of the entity-to-copy mappings contained in this CopyCache.
- * @return set view of the entity-to-copy mappings contained in this CopyCache
- */
- public Set entrySet() {
- return entityToCopyMap.entrySet();
- }
-
- /**
- * Returns the copy to which this CopyCache maps the specified entity.
- * @param entity must be non-null
- * @return the copy to which this CopyCache maps the specified entity
- * @throws NullPointerException if entity is null
- */
- public Object get(Object entity) {
- if ( entity == null ) {
- throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
- }
- return entityToCopyMap.get( entity );
- }
-
- /**
- * Returns true if this CopyCache contains no entity-copy mappings.
- * @return true if this CopyCache contains no entity-copy mappings
- */
- public boolean isEmpty() {
- return entityToCopyMap.isEmpty();
- }
-
- /**
- * Returns a set view of the entities contained in this CopyCache
- * @return a set view of the entities contained in this CopyCache
- */
- public Set keySet() {
- return entityToCopyMap.keySet();
- }
-
- /**
- * Associates the specified entity with the specified copy in this CopyCache;
- * @param entity must be non-null
- * @param copy must be non- null
- * @return previous copy associated with specified entity, or null if
- * there was no mapping for entity.
- * @throws NullPointerException if entity or copy is null
- */
- public Object put(Object entity, Object copy) {
- if ( entity == null || copy == null ) {
- throw new NullPointerException( "null entities and copies are not supported by " + getClass().getName() );
- }
- entityToIncludeInMergeFlagMap.put( entity, Boolean.FALSE );
- return entityToCopyMap.put( entity, copy );
- }
-
- /**
- * Associates the specified entity with the specified copy in this CopyCache;
- * @param entity must be non-null
- * @param copy must be non- null
- * @param isIncludedInMerge indicates if the entity is included in merge
- *
- * @return previous copy associated with specified entity, or null if
- * there was no mapping for entity.
- * @throws NullPointerException if entity or copy is null
- */
- /* package-private */ Object put(Object entity, Object copy, boolean isIncludedInMerge) {
- if ( entity == null || copy == null ) {
- throw new NullPointerException( "null entities and copies are not supported by " + getClass().getName() );
- }
- entityToIncludeInMergeFlagMap.put( entity, Boolean.valueOf( isIncludedInMerge ) );
- return entityToCopyMap.put( entity, copy );
- }
-
- /**
- * Copies all of the mappings from the specified map to this CopyCache
- * @param map keys and values must be non-null
- * @throws NullPointerException if any map keys or values are null
- */
- public void putAll(Map map) {
- for ( Iterator it=map.entrySet().iterator(); it.hasNext(); ) {
- Map.Entry entry = ( Map.Entry ) it.next();
- if ( entry.getKey() == null || entry.getValue() == null ) {
- throw new NullPointerException( "null entities and copies are not supported by " + getClass().getName() );
- }
- entityToCopyMap.put( entry.getKey(), entry.getValue() );
- entityToIncludeInMergeFlagMap.put( entry.getKey(), Boolean.FALSE );
- }
- }
-
- /**
- * Removes the mapping for this entity from this CopyCache if it is present
- * @param entity must be non-null
- * @return previous value associated with specified entity, or null if there was no mapping for entity.
- * @throws NullPointerException if entity is null
- */
- public Object remove(Object entity) {
- if ( entity == null ) {
- throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
- }
- entityToIncludeInMergeFlagMap.remove( entity );
- return entityToCopyMap.remove( entity );
- }
-
- /**
- * Returns the number of entity-copy mappings in this CopyCache
- * @return the number of entity-copy mappings in this CopyCache
- */
- public int size() {
- return entityToCopyMap.size();
- }
-
- /**
- * Returns a collection view of the entity copies contained in this CopyCache.
- * @return a collection view of the entity copies contained in this CopyCache
- */
- public Collection values() {
- return entityToCopyMap.values();
- }
-
- /**
- * Returns true if the specified entity is included in the merge.
- * @param entity must be non-null
- * @return true if the specified entity is included in the merge.
- * @throws NullPointerException if entity is null
- */
- public boolean isIncludedInMerge(Object entity) {
- if ( entity == null ) {
- throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
- }
- return ( ( Boolean ) entityToIncludeInMergeFlagMap.get( entity ) ).booleanValue();
- }
-
- /**
- * Set flag to indicate if an entity is included in the merge.
- * @param entity must be non-null and this CopyCache must contain a mapping for this entity
- * @return true if the specified entity is included in the merge
- * @throws NullPointerException if entity is null
- * @throws AssertionFailure if this CopyCache does not contain a mapping for the specified entity
- */
- /* package-private */ void setIncludedInMerge(Object entity, boolean isIncludedInMerge) {
- if ( entity == null ) {
- throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
- }
- if ( ! entityToIncludeInMergeFlagMap.containsKey( entity ) ||
- ! entityToCopyMap.containsKey( entity ) ) {
- throw new AssertionFailure( "called CopyCache.setInMergeProcess() for entity not found in CopyCache" );
- }
- entityToIncludeInMergeFlagMap.put( entity, Boolean.valueOf( isIncludedInMerge ) );
- }
-
- /**
- * Returns the copy-entity mappings
- * @return the copy-entity mappings
- */
- public Map getMergeMap() {
- return IdentityMap.invert( entityToCopyMap );
- }
-}
\ No newline at end of file
Modified: core/trunk/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java 2009-06-02 08:44:49 UTC (rev 16664)
+++ core/trunk/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java 2009-06-02 09:30:14 UTC (rev 16665)
@@ -70,7 +70,7 @@
private static final Logger log = LoggerFactory.getLogger(DefaultMergeEventListener.class);
protected Map getMergeMap(Object anything) {
- return ( ( CopyCache ) anything ).getMergeMap();
+ return ( ( EventCache ) anything ).invertMap();
}
/**
@@ -80,7 +80,7 @@
* @throws HibernateException
*/
public void onMerge(MergeEvent event) throws HibernateException {
- CopyCache copyCache = new CopyCache();
+ EventCache copyCache = new EventCache();
onMerge( event, copyCache );
// TODO: iteratively get transient entities and retry merge until one of the following conditions:
// 1) transientCopyCache.size() == 0
@@ -110,8 +110,8 @@
copyCache = null;
}
- protected CopyCache getTransientCopyCache(MergeEvent event, CopyCache copyCache) {
- CopyCache transientCopyCache = new CopyCache();
+ protected EventCache getTransientCopyCache(MergeEvent event, EventCache copyCache) {
+ EventCache transientCopyCache = new EventCache();
for ( Iterator it=copyCache.entrySet().iterator(); it.hasNext(); ) {
Map.Entry mapEntry = ( Map.Entry ) it.next();
Object entity = mapEntry.getKey();
@@ -131,7 +131,7 @@
);
}
else if ( copyEntry.getStatus() == Status.SAVING ) {
- transientCopyCache.put( entity, copy, copyCache.isIncludedInMerge( entity ) );
+ transientCopyCache.put( entity, copy, copyCache.isOperatedOn( entity ) );
}
else if ( copyEntry.getStatus() != Status.MANAGED && copyEntry.getStatus() != Status.READ_ONLY ) {
throw new AssertionFailure( "Merged entity does not have status set to MANAGED or READ_ONLY; "+copy+" status="+copyEntry.getStatus() );
@@ -140,7 +140,7 @@
return transientCopyCache;
}
- protected void retryMergeTransientEntities(MergeEvent event, Map transientCopyCache, CopyCache copyCache) {
+ protected void retryMergeTransientEntities(MergeEvent event, Map transientCopyCache, EventCache copyCache) {
// TODO: The order in which entities are saved may matter (e.g., a particular transient entity
// may need to be saved before other transient entities can be saved;
// Keep retrying the batch of transient entities until either:
@@ -169,7 +169,7 @@
*/
public void onMerge(MergeEvent event, Map copiedAlready) throws HibernateException {
- final CopyCache copyCache = ( CopyCache ) copiedAlready;
+ final EventCache copyCache = ( EventCache ) copiedAlready;
final EventSource source = event.getSession();
final Object original = event.getOriginal();
@@ -192,14 +192,14 @@
}
if ( copyCache.containsKey( entity ) &&
- ( copyCache.isIncludedInMerge( entity ) ) ) {
+ ( copyCache.isOperatedOn( entity ) ) ) {
log.trace("already in merge process");
event.setResult( entity );
}
else {
if ( copyCache.containsKey( entity ) ) {
log.trace("already in copyCache; setting in merge process");
- copyCache.setIncludedInMerge( entity, true );
+ copyCache.setOperatedOn( entity, true );
}
event.setEntity( entity );
int entityState = -1;
@@ -261,7 +261,7 @@
final EventSource source = event.getSession();
final EntityPersister persister = source.getEntityPersister( event.getEntityName(), entity );
- ( ( CopyCache ) copyCache ).put( entity, entity, true ); //before cascade!
+ ( ( EventCache ) copyCache ).put( entity, entity, true ); //before cascade!
cascadeOnMerge(source, persister, entity, copyCache);
copyValues(persister, entity, entity, source, copyCache);
@@ -295,7 +295,7 @@
persister.setIdentifier( copyCache.get( entity ), id, source.getEntityMode() );
}
else {
- ( ( CopyCache ) copyCache ).put( entity, persister.instantiate( id, source.getEntityMode() ), true ); //before cascade!
+ ( ( EventCache ) copyCache ).put( entity, persister.instantiate( id, source.getEntityMode() ), true ); //before cascade!
//TODO: should this be Session.instantiate(Persister, ...)?
}
final Object copy = copyCache.get( entity );
@@ -333,7 +333,7 @@
"' from original entity is not in copyCache; " + propertyName + " =["+propertyFromEntity+"]");
throw ex;
}
- if ( ( ( CopyCache ) copyCache ).isIncludedInMerge( propertyFromEntity ) ) {
+ if ( ( ( EventCache ) copyCache ).isOperatedOn( propertyFromEntity ) ) {
log.trace( "property '" + copyEntry.getEntityName() + "." + propertyName +
"' from original entity is in copyCache and is in the process of being merged; " +
propertyName + " =["+propertyFromEntity+"]");
@@ -397,7 +397,7 @@
entityIsTransient(event, copyCache);
}
else {
- ( ( CopyCache ) copyCache ).put( entity, result, true ); //before cascade!
+ ( ( EventCache ) copyCache ).put( entity, result, true ); //before cascade!
final Object target = source.getPersistenceContext().unproxy(result);
if ( target == entity ) {
Copied: core/trunk/core/src/main/java/org/hibernate/event/def/EventCache.java (from rev 16664, core/trunk/core/src/main/java/org/hibernate/event/def/CopyCache.java)
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/event/def/EventCache.java (rev 0)
+++ core/trunk/core/src/main/java/org/hibernate/event/def/EventCache.java 2009-06-02 09:30:14 UTC (rev 16665)
@@ -0,0 +1,253 @@
+//$Id: $
+/*
+ * 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.event.def;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.Iterator;
+import java.util.Collection;
+
+import org.hibernate.util.IdentityMap;
+import org.hibernate.AssertionFailure;
+
+/**
+ * EventCache is a Map implementation that can be used by an event
+ * listener to keep track of entities involved in the operation
+ * being performed. This implementation allows entities to be added
+ * to the EventCache before the operation has cascaded to that
+ * entity.
+ * <p/>
+ * The following methods can be used by event listeners (and other
+ * classes) in the same package to add entities to an EventCache
+ * and indicate if the operation is being performed on the entity:<p/>
+ * {@link EventCache#put(Object entity, Object copy, boolean isOperatedOn)}
+ * <p/>
+ * The following method can be used by event listeners (and other
+ * classes) in the same package to indicate that the operation is being
+ * performed on an entity already in the EventCache:
+ * {@link EventCache#setOperatedOn(Object entity, boolean isOperatedOn)
+ *
+ * @author Gail Badner
+ */
+class EventCache implements Map {
+ private Map entityToCopyMap = IdentityMap.instantiate(10);
+ // key is an entity involved with the operation performed by the listener;
+ // value can be either a copy of the entity or the entity itself
+
+ private Map entityToOperatedOnFlagMap = IdentityMap.instantiate(10);
+ // key is an entity involved with the operation performed by the listener;
+ // value is a flag indicating if the listener explicitly operates on the entity
+
+ /**
+ * Clears the EventCache.
+ */
+ public void clear() {
+ entityToCopyMap.clear();
+ entityToOperatedOnFlagMap.clear();
+ }
+
+ /**
+ * Returns true if this EventCache contains a mapping for the specified entity.
+ * @param entity must be non-null
+ * @return true if this EventCache contains a mapping for the specified entity
+ * @throws NullPointerException if entity is null
+ */
+ public boolean containsKey(Object entity) {
+ if ( entity == null ) {
+ throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
+ }
+ return entityToCopyMap.containsKey( entity );
+ }
+
+ /**
+ * Returns true if this EventCache maps one or more entities to the specified copy.
+ * @param copy must be non-null
+ * @return true if this EventCache maps one or more entities to the specified copy
+ * @throws NullPointerException if copy is null
+ */
+ public boolean containsValue(Object copy) {
+ if ( copy == null ) {
+ throw new NullPointerException( "null copies are not supported by " + getClass().getName() );
+ }
+ return entityToCopyMap.containsValue( copy );
+ }
+
+ /**
+ * Returns a set view of the entity-to-copy mappings contained in this EventCache.
+ * @return set view of the entity-to-copy mappings contained in this EventCache
+ */
+ public Set entrySet() {
+ return entityToCopyMap.entrySet();
+ }
+
+ /**
+ * Returns the copy to which this EventCache maps the specified entity.
+ * @param entity must be non-null
+ * @return the copy to which this EventCache maps the specified entity
+ * @throws NullPointerException if entity is null
+ */
+ public Object get(Object entity) {
+ if ( entity == null ) {
+ throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
+ }
+ return entityToCopyMap.get( entity );
+ }
+
+ /**
+ * Returns true if this EventCache contains no entity-copy mappings.
+ * @return true if this EventCache contains no entity-copy mappings
+ */
+ public boolean isEmpty() {
+ return entityToCopyMap.isEmpty();
+ }
+
+ /**
+ * Returns a set view of the entities contained in this EventCache
+ * @return a set view of the entities contained in this EventCache
+ */
+ public Set keySet() {
+ return entityToCopyMap.keySet();
+ }
+
+ /**
+ * Associates the specified entity with the specified copy in this EventCache;
+ * @param entity must be non-null
+ * @param copy must be non- null
+ * @return previous copy associated with specified entity, or null if
+ * there was no mapping for entity.
+ * @throws NullPointerException if entity or copy is null
+ */
+ public Object put(Object entity, Object copy) {
+ if ( entity == null || copy == null ) {
+ throw new NullPointerException( "null entities and copies are not supported by " + getClass().getName() );
+ }
+ entityToOperatedOnFlagMap.put( entity, Boolean.FALSE );
+ return entityToCopyMap.put( entity, copy );
+ }
+
+ /**
+ * Associates the specified entity with the specified copy in this EventCache;
+ * @param entity must be non-null
+ * @param copy must be non- null
+ * @param isOperatedOn indicates if the operation is performed on the entity
+ *
+ * @return previous copy associated with specified entity, or null if
+ * there was no mapping for entity.
+ * @throws NullPointerException if entity or copy is null
+ */
+ /* package-private */ Object put(Object entity, Object copy, boolean isOperatedOn) {
+ if ( entity == null || copy == null ) {
+ throw new NullPointerException( "null entities and copies are not supported by " + getClass().getName() );
+ }
+ entityToOperatedOnFlagMap.put( entity, Boolean.valueOf( isOperatedOn ) );
+ return entityToCopyMap.put( entity, copy );
+ }
+
+ /**
+ * Copies all of the mappings from the specified map to this EventCache
+ * @param map keys and values must be non-null
+ * @throws NullPointerException if any map keys or values are null
+ */
+ public void putAll(Map map) {
+ for ( Iterator it=map.entrySet().iterator(); it.hasNext(); ) {
+ Map.Entry entry = ( Map.Entry ) it.next();
+ if ( entry.getKey() == null || entry.getValue() == null ) {
+ throw new NullPointerException( "null entities and copies are not supported by " + getClass().getName() );
+ }
+ entityToCopyMap.put( entry.getKey(), entry.getValue() );
+ entityToOperatedOnFlagMap.put( entry.getKey(), Boolean.FALSE );
+ }
+ }
+
+ /**
+ * Removes the mapping for this entity from this EventCache if it is present
+ * @param entity must be non-null
+ * @return previous value associated with specified entity, or null if there was no mapping for entity.
+ * @throws NullPointerException if entity is null
+ */
+ public Object remove(Object entity) {
+ if ( entity == null ) {
+ throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
+ }
+ entityToOperatedOnFlagMap.remove( entity );
+ return entityToCopyMap.remove( entity );
+ }
+
+ /**
+ * Returns the number of entity-copy mappings in this EventCache
+ * @return the number of entity-copy mappings in this EventCache
+ */
+ public int size() {
+ return entityToCopyMap.size();
+ }
+
+ /**
+ * Returns a collection view of the entity copies contained in this EventCache.
+ * @return a collection view of the entity copies contained in this EventCache
+ */
+ public Collection values() {
+ return entityToCopyMap.values();
+ }
+
+ /**
+ * Returns true if the listener is performing the operation on the specified entity.
+ * @param entity must be non-null
+ * @return true if the listener is performing the operation on the specified entity.
+ * @throws NullPointerException if entity is null
+ */
+ public boolean isOperatedOn(Object entity) {
+ if ( entity == null ) {
+ throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
+ }
+ return ( ( Boolean ) entityToOperatedOnFlagMap.get( entity ) ).booleanValue();
+ }
+
+ /**
+ * Set flag to indicate if the listener is performing the operation on the specified entity.
+ * @param entity must be non-null and this EventCache must contain a mapping for this entity
+ * @return true if the listener is performing the operation on the specified entity
+ * @throws NullPointerException if entity is null
+ * @throws AssertionFailure if this EventCache does not contain a mapping for the specified entity
+ */
+ /* package-private */ void setOperatedOn(Object entity, boolean isOperatedOn) {
+ if ( entity == null ) {
+ throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
+ }
+ if ( ! entityToOperatedOnFlagMap.containsKey( entity ) ||
+ ! entityToCopyMap.containsKey( entity ) ) {
+ throw new AssertionFailure( "called EventCache.setOperatedOn() for entity not found in EventCache" );
+ }
+ entityToOperatedOnFlagMap.put( entity, Boolean.valueOf( isOperatedOn ) );
+ }
+
+ /**
+ * Returns the copy-entity mappings
+ * @return the copy-entity mappings
+ */
+ public Map invertMap() {
+ return IdentityMap.invert( entityToCopyMap );
+ }
+}
\ No newline at end of file
15 years, 7 months