Hibernate SVN: r19229 - core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-04-14 07:59:06 -0400 (Wed, 14 Apr 2010)
New Revision: 19229
Added:
core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/NativeSQLQueryPlanEqualsTest.java
Log:
HHH-2470 : added test case for use of session.createSQLQuery causes memory leak
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/NativeSQLQueryPlanEqualsTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/NativeSQLQueryPlanEqualsTest.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/NativeSQLQueryPlanEqualsTest.java 2010-04-14 11:59:06 UTC (rev 19229)
@@ -0,0 +1,75 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ *
+ */
+package org.hibernate.test.queryplan;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.hibernate.engine.query.QueryPlanCache;
+import org.hibernate.engine.query.NativeSQLQueryPlan;
+import org.hibernate.engine.query.sql.NativeSQLQueryScalarReturn;
+import org.hibernate.engine.query.sql.NativeSQLQueryReturn;
+import org.hibernate.engine.query.sql.NativeSQLQuerySpecification;
+import org.hibernate.junit.functional.FunctionalTestCase;
+import org.hibernate.type.TypeFactory;
+
+/**
+ * Tests equals() for NativeSQLQueryReturn implementations.
+ *
+ * @author Michael Stevens
+ */
+public class NativeSQLQueryPlanEqualsTest extends FunctionalTestCase {
+ public NativeSQLQueryPlanEqualsTest(String string) {
+ super( string );
+ }
+
+ public String[] getMappings() {
+ return new String[] {};
+ }
+
+ public void testNativeSQLQuerySpecEquals() {
+ QueryPlanCache cache = new QueryPlanCache(null);
+ NativeSQLQuerySpecification firstSpec = createSpec();
+
+ NativeSQLQuerySpecification secondSpec = createSpec();
+
+ NativeSQLQueryPlan firstPlan = cache.getNativeSQLQueryPlan(firstSpec);
+ NativeSQLQueryPlan secondPlan = cache.getNativeSQLQueryPlan(secondSpec);
+
+ assertEquals(firstPlan, secondPlan);
+
+ }
+
+ private NativeSQLQuerySpecification createSpec() {
+ String blah = "blah";
+ String select = "select blah from blah";
+ NativeSQLQueryReturn[] queryReturns =
+ new NativeSQLQueryScalarReturn[] {new NativeSQLQueryScalarReturn(blah, TypeFactory.basic( "int" ) ) };
+ NativeSQLQuerySpecification spec = new NativeSQLQuerySpecification(select,
+ queryReturns, null);
+ return spec;
+ }
+}
15 years, 7 months
Hibernate SVN: r19228 - in core/trunk: testsuite/src/test/java/org/hibernate/test and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-04-14 07:12:19 -0400 (Wed, 14 Apr 2010)
New Revision: 19228
Added:
core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/
core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Customer.java
core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Employee.java
core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/GetHqlQueryPlanTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Joined.hbm.xml
core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/NativeSQLQueryReturnEqualsAndHashCodeTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Person.java
core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/User.java
core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/filter-defs.hbm.xml
Modified:
core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryCollectionReturn.java
core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryJoinReturn.java
core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryNonScalarReturn.java
core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryRootReturn.java
core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryScalarReturn.java
Log:
HHH-2470 : Use of session.createSQLQuery causes memory leak
Modified: core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryCollectionReturn.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryCollectionReturn.java 2010-04-13 18:24:16 UTC (rev 19227)
+++ core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryCollectionReturn.java 2010-04-14 11:12:19 UTC (rev 19228)
@@ -40,6 +40,7 @@
public class NativeSQLQueryCollectionReturn extends NativeSQLQueryNonScalarReturn {
private String ownerEntityName;
private String ownerProperty;
+ private final int hashCode;
/**
* Construct a native-sql return representing a collection initializer
@@ -61,6 +62,7 @@
super( alias, propertyResults, lockMode );
this.ownerEntityName = ownerEntityName;
this.ownerProperty = ownerProperty;
+ this.hashCode = determineHashCode();
}
/**
@@ -80,4 +82,38 @@
public String getOwnerProperty() {
return ownerProperty;
}
+
+ public boolean equals(Object o) {
+ if ( this == o ) {
+ return true;
+ }
+ if ( o == null || getClass() != o.getClass() ) {
+ return false;
+ }
+ if ( !super.equals( o ) ) {
+ return false;
+ }
+
+ NativeSQLQueryCollectionReturn that = ( NativeSQLQueryCollectionReturn ) o;
+
+ if ( ownerEntityName != null ? !ownerEntityName.equals( that.ownerEntityName ) : that.ownerEntityName != null ) {
+ return false;
+ }
+ if ( ownerProperty != null ? !ownerProperty.equals( that.ownerProperty ) : that.ownerProperty != null ) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode() {
+ return hashCode;
+ }
+
+ private int determineHashCode() {
+ int result = super.hashCode();
+ result = 31 * result + ( ownerEntityName != null ? ownerEntityName.hashCode() : 0 );
+ result = 31 * result + ( ownerProperty != null ? ownerProperty.hashCode() : 0 );
+ return result;
+ }
}
Modified: core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryJoinReturn.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryJoinReturn.java 2010-04-13 18:24:16 UTC (rev 19227)
+++ core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryJoinReturn.java 2010-04-14 11:12:19 UTC (rev 19228)
@@ -37,7 +37,7 @@
public class NativeSQLQueryJoinReturn extends NativeSQLQueryNonScalarReturn {
private String ownerAlias;
private String ownerProperty;
-
+ private final int hashCode;
/**
* Construct a return descriptor representing some form of fetch.
*
@@ -56,6 +56,7 @@
super( alias, propertyResults, lockMode );
this.ownerAlias = ownerAlias;
this.ownerProperty = ownerProperty;
+ this.hashCode = determineHashCode();
}
/**
@@ -76,4 +77,38 @@
public String getOwnerProperty() {
return ownerProperty;
}
+
+ public boolean equals(Object o) {
+ if ( this == o ) {
+ return true;
+ }
+ if ( o == null || getClass() != o.getClass() ) {
+ return false;
+ }
+ if ( !super.equals( o ) ) {
+ return false;
+ }
+
+ NativeSQLQueryJoinReturn that = ( NativeSQLQueryJoinReturn ) o;
+
+ if ( ownerAlias != null ? !ownerAlias.equals( that.ownerAlias ) : that.ownerAlias != null ) {
+ return false;
+ }
+ if ( ownerProperty != null ? !ownerProperty.equals( that.ownerProperty ) : that.ownerProperty != null ) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode() {
+ return hashCode;
+ }
+
+ private int determineHashCode() {
+ int result = super.hashCode();
+ result = 31 * result + ( ownerAlias != null ? ownerAlias.hashCode() : 0 );
+ result = 31 * result + ( ownerProperty != null ? ownerProperty.hashCode() : 0 );
+ return result;
+ }
}
Modified: core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryNonScalarReturn.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryNonScalarReturn.java 2010-04-13 18:24:16 UTC (rev 19227)
+++ core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryNonScalarReturn.java 2010-04-14 11:12:19 UTC (rev 19228)
@@ -42,6 +42,7 @@
private final String alias;
private final LockMode lockMode;
private final Map propertyResults = new HashMap();
+ private final int hashCode;
/**
* Constructs some form of non-scalar return descriptor
@@ -59,6 +60,7 @@
if ( propertyResults != null ) {
this.propertyResults.putAll( propertyResults );
}
+ this.hashCode = determineHashCode();
}
/**
@@ -87,4 +89,39 @@
public Map getPropertyResultsMap() {
return Collections.unmodifiableMap( propertyResults );
}
+
+ public int hashCode() {
+ return hashCode;
+ }
+
+ private int determineHashCode() {
+ int result = alias != null ? alias.hashCode() : 0;
+ result = 31 * result + ( getClass().getName().hashCode() );
+ result = 31 * result + ( lockMode != null ? lockMode.hashCode() : 0 );
+ result = 31 * result + ( propertyResults != null ? propertyResults.hashCode() : 0 );
+ return result;
+ }
+
+ public boolean equals(Object o) {
+ if ( this == o ) {
+ return true;
+ }
+ if ( o == null || getClass() != o.getClass() ) {
+ return false;
+ }
+
+ NativeSQLQueryNonScalarReturn that = ( NativeSQLQueryNonScalarReturn ) o;
+
+ if ( alias != null ? !alias.equals( that.alias ) : that.alias != null ) {
+ return false;
+ }
+ if ( lockMode != null ? !lockMode.equals( that.lockMode ) : that.lockMode != null ) {
+ return false;
+ }
+ if ( propertyResults != null ? !propertyResults.equals( that.propertyResults ) : that.propertyResults != null ) {
+ return false;
+ }
+
+ return true;
+ }
}
Modified: core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryRootReturn.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryRootReturn.java 2010-04-13 18:24:16 UTC (rev 19227)
+++ core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryRootReturn.java 2010-04-14 11:12:19 UTC (rev 19228)
@@ -37,6 +37,7 @@
*/
public class NativeSQLQueryRootReturn extends NativeSQLQueryNonScalarReturn {
private String returnEntityName;
+ private final int hashCode;
/**
* Construct a return representing an entity returned at the root
@@ -60,7 +61,7 @@
public NativeSQLQueryRootReturn(String alias, String entityName, Map propertyResults, LockMode lockMode) {
super( alias, propertyResults, lockMode );
this.returnEntityName = entityName;
-
+ this.hashCode = determineHashCode();
}
/**
@@ -72,4 +73,33 @@
return returnEntityName;
}
+ public boolean equals(Object o) {
+ if ( this == o ) {
+ return true;
+ }
+ if ( o == null || getClass() != o.getClass() ) {
+ return false;
+ }
+ if ( ! super.equals( o ) ) {
+ return false;
+ }
+
+ NativeSQLQueryRootReturn that = ( NativeSQLQueryRootReturn ) o;
+
+ if ( returnEntityName != null ? !returnEntityName.equals( that.returnEntityName ) : that.returnEntityName != null ) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode() {
+ return hashCode;
+ }
+
+ private int determineHashCode() {
+ int result = super.hashCode();
+ result = 31 * result + ( returnEntityName != null ? returnEntityName.hashCode() : 0 );
+ return result;
+ }
}
Modified: core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryScalarReturn.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryScalarReturn.java 2010-04-13 18:24:16 UTC (rev 19227)
+++ core/trunk/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryScalarReturn.java 2010-04-14 11:12:19 UTC (rev 19228)
@@ -34,10 +34,12 @@
public class NativeSQLQueryScalarReturn implements NativeSQLQueryReturn {
private Type type;
private String columnAlias;
+ private final int hashCode;
public NativeSQLQueryScalarReturn(String alias, Type type) {
this.type = type;
this.columnAlias = alias;
+ this.hashCode = determineHashCode();
}
public String getColumnAlias() {
@@ -48,4 +50,34 @@
return type;
}
+ public boolean equals(Object o) {
+ if ( this == o ) {
+ return true;
+ }
+ if ( o == null || getClass() != o.getClass() ) {
+ return false;
+ }
+
+ NativeSQLQueryScalarReturn that = ( NativeSQLQueryScalarReturn ) o;
+
+ if ( columnAlias != null ? !columnAlias.equals( that.columnAlias ) : that.columnAlias != null ) {
+ return false;
+ }
+ if ( type != null ? !type.equals( that.type ) : that.type != null ) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode() {
+ return hashCode;
+ }
+
+ private int determineHashCode() {
+ int result = type != null ? type.hashCode() : 0;
+ result = 31 * result + ( getClass().getName().hashCode() );
+ result = 31 * result + ( columnAlias != null ? columnAlias.hashCode() : 0 );
+ return result;
+ }
}
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Customer.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Customer.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Customer.java 2010-04-14 11:12:19 UTC (rev 19228)
@@ -0,0 +1,51 @@
+/*
+ * 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.test.queryplan;
+
+/**
+ * Leaf subclass
+ *
+ * @author Steve Ebersole
+ */
+public class Customer extends User {
+ private String company;
+
+ protected Customer() {
+ super();
+ }
+
+ public Customer(String name, char sex, String username, String company) {
+ super( name, sex, username );
+ this.company = company;
+ }
+
+ public String getCompany() {
+ return company;
+ }
+
+ public void setCompany(String company) {
+ this.company = company;
+ }
+}
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Employee.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Employee.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Employee.java 2010-04-14 11:12:19 UTC (rev 19228)
@@ -0,0 +1,53 @@
+/*
+ * 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.test.queryplan;
+
+import java.util.Date;
+
+/**
+ * Leaf subclass
+ *
+ * @author Steve Ebersole
+ */
+public class Employee extends User {
+ private Date hireDate;
+
+ protected Employee() {
+ super();
+ }
+
+ public Employee(String name, char sex, String username, Date hireDate) {
+ super( name, sex, username );
+ this.hireDate = hireDate;
+ }
+
+ public Date getHireDate() {
+ return hireDate;
+ }
+
+ public void setHireDate(Date hireDate) {
+ this.hireDate = hireDate;
+ }
+}
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/GetHqlQueryPlanTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/GetHqlQueryPlanTest.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/GetHqlQueryPlanTest.java 2010-04-14 11:12:19 UTC (rev 19228)
@@ -0,0 +1,113 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ *
+ */
+package org.hibernate.test.queryplan;
+
+import java.util.Map;
+
+import org.hibernate.engine.SessionImplementor;
+import org.hibernate.engine.query.HQLQueryPlan;
+import org.hibernate.engine.query.QueryPlanCache;
+import org.hibernate.junit.functional.FunctionalTestCase;
+import org.hibernate.Session;
+
+/**
+ * Tests for HQL query plans
+ *
+ * @author Gail Badner
+ */
+public class GetHqlQueryPlanTest extends FunctionalTestCase {
+ public GetHqlQueryPlanTest(String string) {
+ super( string );
+ }
+
+ public String[] getMappings() {
+ return new String[]{
+ "queryplan/filter-defs.hbm.xml",
+ "queryplan/Joined.hbm.xml"
+ };
+ }
+
+ protected Map getEnabledFilters(Session s) {
+ return ( ( SessionImplementor ) s ).getLoadQueryInfluencers().getEnabledFilters();
+ }
+
+ public void testHqlQueryPlan() {
+ Session s = openSession();
+ QueryPlanCache cache = ( ( SessionImplementor ) s ).getFactory().getQueryPlanCache();
+ assertTrue( getEnabledFilters( s ).isEmpty() );
+
+ HQLQueryPlan plan1 = cache.getHQLQueryPlan( "from Person", false, getEnabledFilters( s ) );
+ HQLQueryPlan plan2 = cache.getHQLQueryPlan( "from Person where name is null", false, getEnabledFilters( s ) );
+ HQLQueryPlan plan3 = cache.getHQLQueryPlan( "from Person where name = :name", false, getEnabledFilters( s ) );
+ HQLQueryPlan plan4 = cache.getHQLQueryPlan( "from Person where name = ?", false, getEnabledFilters( s ) );
+
+ assertNotSame( plan1, plan2 );
+ assertNotSame( plan1, plan3 );
+ assertNotSame( plan1, plan4 );
+ assertNotSame( plan2, plan3 );
+ assertNotSame( plan2, plan4 );
+ assertNotSame( plan3, plan4 );
+
+ assertSame( plan1, cache.getHQLQueryPlan( "from Person", false, getEnabledFilters( s ) ) );
+ assertSame( plan2, cache.getHQLQueryPlan( "from Person where name is null", false, getEnabledFilters( s ) ) );
+ assertSame( plan3, cache.getHQLQueryPlan( "from Person where name = :name", false, getEnabledFilters( s ) ) );
+ assertSame( plan4, cache.getHQLQueryPlan( "from Person where name = ?", false, getEnabledFilters( s ) ) );
+
+ s.close();
+ }
+
+ public void testHqlQueryPlanWithEnabledFilter() {
+ Session s = openSession();
+ QueryPlanCache cache = ( ( SessionImplementor ) s ).getFactory().getQueryPlanCache();
+
+ HQLQueryPlan plan1A = cache.getHQLQueryPlan( "from Person", true, getEnabledFilters( s ) );
+ HQLQueryPlan plan1B = cache.getHQLQueryPlan( "from Person", false, getEnabledFilters( s ) );
+
+ s.enableFilter( "sex" ).setParameter( "sexCode", new Character( 'F' ) );
+ HQLQueryPlan plan2A = cache.getHQLQueryPlan( "from Person", true, getEnabledFilters( s ) );
+ HQLQueryPlan plan2B = cache.getHQLQueryPlan( "from Person", false, getEnabledFilters( s ) );
+
+ s.disableFilter( "sex" );
+ HQLQueryPlan plan3A = cache.getHQLQueryPlan( "from Person", true, getEnabledFilters( s ) );
+ HQLQueryPlan plan3B = cache.getHQLQueryPlan( "from Person", false, getEnabledFilters( s ) );
+
+ s.enableFilter( "sex" ).setParameter( "sexCode", new Character( 'M' ) );
+ HQLQueryPlan plan4A = cache.getHQLQueryPlan( "from Person", true, getEnabledFilters( s ) );
+ HQLQueryPlan plan4B = cache.getHQLQueryPlan( "from Person", false, getEnabledFilters( s ) );
+
+ assertSame( plan1A, plan3A );
+ assertSame( plan1B, plan3B );
+ assertSame( plan2A, plan4A );
+ assertSame( plan2B, plan4B );
+
+ assertNotSame( plan1A, plan1B );
+ assertNotSame( plan1A, plan2A );
+ assertNotSame( plan1A, plan2B );
+ assertNotSame( plan1B, plan2A );
+ assertNotSame( plan1B, plan2B );
+
+ s.close();
+ }
+}
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Joined.hbm.xml
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Joined.hbm.xml (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Joined.hbm.xml 2010-04-14 11:12:19 UTC (rev 19228)
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<!--
+ ~ Hibernate, Relational Persistence for Idiomatic Java
+ ~
+ ~ Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ ~ indicated by the @author tags or express copyright attribution
+ ~ statements applied by the authors. All third-party contributions are
+ ~ distributed under license by Red Hat Middleware LLC.
+ ~
+ ~ This copyrighted material is made available to anyone wishing to use, modify,
+ ~ copy, or redistribute it subject to the terms and conditions of the GNU
+ ~ Lesser General Public License, as published by the Free Software Foundation.
+ ~
+ ~ This program is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ ~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ ~ for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public License
+ ~ along with this distribution; if not, write to:
+ ~ Free Software Foundation, Inc.
+ ~ 51 Franklin Street, Fifth Floor
+ ~ Boston, MA 02110-1301 USA
+ ~
+ -->
+
+<!DOCTYPE hibernate-mapping
+ SYSTEM
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+
+<hibernate-mapping package="org.hibernate.test.queryplan">
+ <class name="Person" table="FILTER_HQL_JOINED_PERSON">
+ <id column="ID" name="id" type="long">
+ <generator class="increment"/>
+ </id>
+ <property name="name" type="string"/>
+ <property name="sex" column="SEX_CODE" type="char"/>
+ <joined-subclass name="User" table="FILTER_HQL_JOINED_USER">
+ <key column="USER_ID"/>
+ <property name="username" type="string"/>
+ <joined-subclass name="Employee" table="FILTER_HQL_JOINED_EMP">
+ <key column="EMP_ID"/>
+ <property name="hireDate" type="date"/>
+ </joined-subclass>
+ <joined-subclass name="Customer" table="FILTER_HQL_JOINED_CUST">
+ <key column="CUST_ID"/>
+ <property name="company" type="string"/>
+ </joined-subclass>
+ </joined-subclass>
+ <filter name="sex"/>
+ </class>
+</hibernate-mapping>
\ No newline at end of file
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/NativeSQLQueryReturnEqualsAndHashCodeTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/NativeSQLQueryReturnEqualsAndHashCodeTest.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/NativeSQLQueryReturnEqualsAndHashCodeTest.java 2010-04-14 11:12:19 UTC (rev 19228)
@@ -0,0 +1,277 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ *
+ */
+package org.hibernate.test.queryplan;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.hibernate.LockMode;
+import org.hibernate.Session;
+import org.hibernate.engine.SessionImplementor;
+import org.hibernate.engine.query.HQLQueryPlan;
+import org.hibernate.engine.query.QueryPlanCache;
+import org.hibernate.engine.query.sql.NativeSQLQueryCollectionReturn;
+import org.hibernate.engine.query.sql.NativeSQLQueryJoinReturn;
+import org.hibernate.engine.query.sql.NativeSQLQueryReturn;
+import org.hibernate.engine.query.sql.NativeSQLQueryRootReturn;
+import org.hibernate.engine.query.sql.NativeSQLQueryScalarReturn;
+import org.hibernate.junit.functional.FunctionalTestCase;
+import org.hibernate.type.TypeFactory;
+
+/**
+ * Tests equals() and hashCode() for NativeSQLQueryReturn implementations.
+ *
+ * @author Gail Badner
+ */
+public class NativeSQLQueryReturnEqualsAndHashCodeTest extends FunctionalTestCase {
+ public NativeSQLQueryReturnEqualsAndHashCodeTest(String string) {
+ super( string );
+ }
+
+ public String[] getMappings() {
+ return new String[] {};
+ }
+
+ public void testNativeSQLQueryScalarReturn() {
+ NativeSQLQueryScalarReturn typeNoAlias = new NativeSQLQueryScalarReturn( null, TypeFactory.basic( "int" ) );
+ NativeSQLQueryScalarReturn aliasNoType = new NativeSQLQueryScalarReturn( "abc", null );
+ NativeSQLQueryScalarReturn aliasTypeInt = new NativeSQLQueryScalarReturn( "abc", TypeFactory.basic( "int" ) );
+ NativeSQLQueryScalarReturn aliasTypeLong = new NativeSQLQueryScalarReturn( "abc", TypeFactory.basic( "long" ) );
+ NativeSQLQueryScalarReturn aliasTypeLongClass = new NativeSQLQueryScalarReturn( "abc", TypeFactory.basic( Long.class.getName() ) );
+ NativeSQLQueryScalarReturn aliasTypeString = new NativeSQLQueryScalarReturn( "abc", TypeFactory.basic( "string" ) );
+ NativeSQLQueryScalarReturn aliasTypeStringClass = new NativeSQLQueryScalarReturn( "abc", TypeFactory.basic( String.class.getName() ) );
+
+ check( false, typeNoAlias, aliasNoType );
+ check( false, typeNoAlias, aliasTypeInt );
+ check( false, typeNoAlias, aliasTypeLong );
+ check( false, typeNoAlias, aliasTypeLongClass );
+ check( false, typeNoAlias, aliasTypeString );
+ check( false, typeNoAlias, aliasTypeStringClass );
+
+ check( false, aliasNoType, aliasTypeInt );
+ check( false, aliasNoType, aliasTypeLong );
+ check( false, aliasNoType, aliasTypeLongClass );
+ check( false, aliasNoType, aliasTypeString );
+ check( false, aliasNoType, aliasTypeStringClass );
+
+ check( false, aliasTypeInt, aliasTypeLong );
+ check( false, aliasTypeInt, aliasTypeLongClass );
+ check( false, aliasTypeInt, aliasTypeString );
+ check( false, aliasTypeInt, aliasTypeStringClass );
+
+ check( true, aliasTypeLong, aliasTypeLongClass );
+ check( false, aliasTypeLong, aliasTypeString );
+ check( false, aliasTypeLong, aliasTypeStringClass );
+
+ check( false, aliasTypeLongClass, aliasTypeString );
+ check( false, aliasTypeLongClass, aliasTypeStringClass );
+
+ check( true, aliasTypeString, aliasTypeStringClass );
+
+ check( true, typeNoAlias, new NativeSQLQueryScalarReturn( null, TypeFactory.basic( "int" ) ) );
+ check( true, aliasNoType, new NativeSQLQueryScalarReturn( "abc", null ) );
+ check( true, aliasTypeInt, new NativeSQLQueryScalarReturn( "abc", TypeFactory.basic( "int" ) ) );
+ check( true, aliasTypeLong, new NativeSQLQueryScalarReturn( "abc", TypeFactory.basic( "long" ) ) );
+ check( true, aliasTypeLongClass, new NativeSQLQueryScalarReturn( "abc", TypeFactory.basic( Long.class.getName() ) ) );
+ check( true, aliasTypeString, new NativeSQLQueryScalarReturn( "abc", TypeFactory.basic( "string" ) ) );
+ check( true, aliasTypeStringClass, new NativeSQLQueryScalarReturn( "abc", TypeFactory.basic( String.class.getName() ) ) );
+ }
+
+ public void testNativeSQLQueryRootReturn() {
+ NativeSQLQueryRootReturn alias = new NativeSQLQueryRootReturn( "abc", null, null);
+ NativeSQLQueryRootReturn diffAlias = new NativeSQLQueryRootReturn( "def", null, null);
+ NativeSQLQueryRootReturn aliasEntityName = new NativeSQLQueryRootReturn( "abc", "Person", null);
+ NativeSQLQueryRootReturn aliasDiffEntityName = new NativeSQLQueryRootReturn( "abc", "Customer", null);
+ NativeSQLQueryRootReturn aliasEntityNameLockMode = new NativeSQLQueryRootReturn( "abc", "Person", LockMode.NONE );
+ NativeSQLQueryRootReturn aliasEntityNameDiffLockMode = new NativeSQLQueryRootReturn( "abc", "Person", LockMode.OPTIMISTIC );
+
+ check( false, alias, diffAlias );
+ check( false, alias, aliasEntityName );
+ check( false, alias, aliasDiffEntityName );
+ check( false, alias, aliasEntityNameLockMode );
+ check( false, alias, aliasEntityNameDiffLockMode );
+
+ check( false, diffAlias, aliasEntityName );
+ check( false, diffAlias, aliasDiffEntityName );
+ check( false, diffAlias, aliasEntityNameLockMode );
+ check( false, diffAlias, aliasEntityNameDiffLockMode );
+
+ check( false, aliasEntityName, aliasDiffEntityName );
+ check( false, aliasEntityName, aliasEntityNameLockMode );
+ check( false, aliasEntityName, aliasEntityNameDiffLockMode );
+
+ check( false, aliasDiffEntityName, aliasEntityNameLockMode );
+ check( false, aliasDiffEntityName, aliasEntityNameDiffLockMode );
+
+ check( false, aliasEntityNameLockMode, aliasEntityNameDiffLockMode );
+
+ check( true, alias, new NativeSQLQueryRootReturn( "abc", null, null) );
+ check( true, diffAlias, new NativeSQLQueryRootReturn( "def", null, null) );
+ check( true, aliasEntityName, new NativeSQLQueryRootReturn( "abc", "Person", null) );
+ check( true, aliasDiffEntityName, new NativeSQLQueryRootReturn( "abc", "Customer", null) );
+ check( true, aliasEntityNameLockMode, new NativeSQLQueryRootReturn( "abc", "Person", LockMode.NONE ) );
+ check( true, aliasEntityNameDiffLockMode, new NativeSQLQueryRootReturn( "abc", "Person", LockMode.OPTIMISTIC ) );
+ }
+
+ public void testNativeSQLQueryJoinReturn() {
+ NativeSQLQueryJoinReturn r1 = new NativeSQLQueryJoinReturn( "a", "b", "c", null, null);
+ NativeSQLQueryJoinReturn r2 = new NativeSQLQueryJoinReturn( "a", "c", "b", null, null);
+ NativeSQLQueryJoinReturn r3NullMap = new NativeSQLQueryJoinReturn( "b", "c", "a", null, null);
+ NativeSQLQueryJoinReturn r3EmptyMap= new NativeSQLQueryJoinReturn( "b", "c", "a", new HashMap(), null);
+ NativeSQLQueryJoinReturn r4 = new NativeSQLQueryJoinReturn( "b", "c", "a", Collections.singletonMap( "key", "value" ), null);
+ NativeSQLQueryJoinReturn r5 = new NativeSQLQueryJoinReturn( "b", "c", "a", Collections.singletonMap( "otherkey", "othervalue" ), null);
+ NativeSQLQueryJoinReturn r6 = new NativeSQLQueryJoinReturn( "b", "c", "a", Collections.singletonMap( "key", "value" ), LockMode.NONE );
+ NativeSQLQueryJoinReturn r7 = new NativeSQLQueryJoinReturn( "b", "c", "a", null, LockMode.NONE );
+
+ check( false, r1, r2 );
+ check( false, r1, r3NullMap );
+ check( false, r1, r3EmptyMap );
+ check( false, r1, r4 );
+ check( false, r1, r5 );
+ check( false, r1, r6 );
+ check( false, r1, r7 );
+
+ check( false, r2, r3NullMap );
+ check( false, r2, r3EmptyMap );
+ check( false, r2, r4 );
+ check( false, r2, r5 );
+ check( false, r2, r6 );
+ check( false, r2, r7 );
+
+ check( true, r3NullMap, r3EmptyMap );
+ check( false, r3NullMap, r4 );
+ check( false, r3NullMap, r5 );
+ check( false, r3NullMap, r6 );
+ check( false, r3NullMap, r7 );
+
+ check( false, r3EmptyMap, r4 );
+ check( false, r3EmptyMap, r5 );
+ check( false, r3EmptyMap, r6 );
+ check( false, r3EmptyMap, r7 );
+
+ check( false, r4, r5 );
+ check( false, r4, r6 );
+ check( false, r4, r7 );
+
+ check( false, r5, r6 );
+ check( false, r5, r7 );
+
+ check( false, r6, r7 );
+
+ check( true, r1, new NativeSQLQueryJoinReturn( "a", "b", "c", null, null) );
+ check( true, r2, new NativeSQLQueryJoinReturn( "a", "c", "b", null, null) );
+ check( true, r3NullMap, new NativeSQLQueryJoinReturn( "b", "c", "a", null, null) );
+ check( true, r3EmptyMap, new NativeSQLQueryJoinReturn( "b", "c", "a", new HashMap(), null) );
+ check( true, r4, new NativeSQLQueryJoinReturn( "b", "c", "a", Collections.singletonMap( "key", "value" ), null) );
+ check( true, r5, new NativeSQLQueryJoinReturn( "b", "c", "a", Collections.singletonMap( "otherkey", "othervalue" ), null) );
+ check( true, r6, new NativeSQLQueryJoinReturn( "b", "c", "a", Collections.singletonMap( "key", "value" ), LockMode.NONE ) );
+ check( true, r7, new NativeSQLQueryJoinReturn( "b", "c", "a", null, LockMode.NONE ) );
+ }
+
+ public void testNativeSQLQueryCollectionReturn() {
+ NativeSQLQueryCollectionReturn r1 = new NativeSQLQueryCollectionReturn( "a", "b", "c", null, null);
+ NativeSQLQueryCollectionReturn r2 = new NativeSQLQueryCollectionReturn( "a", "c", "b", null, null);
+ NativeSQLQueryCollectionReturn r3NullMap = new NativeSQLQueryCollectionReturn( "b", "c", "a", null, null);
+ NativeSQLQueryCollectionReturn r3EmptyMap= new NativeSQLQueryCollectionReturn( "b", "c", "a", new HashMap(), null);
+ NativeSQLQueryCollectionReturn r4 = new NativeSQLQueryCollectionReturn( "b", "c", "a", Collections.singletonMap( "key", "value" ), null);
+ NativeSQLQueryCollectionReturn r5 = new NativeSQLQueryCollectionReturn( "b", "c", "a", Collections.singletonMap( "otherkey", "othervalue" ), null);
+ NativeSQLQueryCollectionReturn r6 = new NativeSQLQueryCollectionReturn( "b", "c", "a", Collections.singletonMap( "key", "value" ), LockMode.NONE );
+ NativeSQLQueryCollectionReturn r7 = new NativeSQLQueryCollectionReturn( "b", "c", "a", null, LockMode.NONE );
+
+ check( false, r1, r2 );
+ check( false, r1, r3NullMap );
+ check( false, r1, r3EmptyMap );
+ check( false, r1, r4 );
+ check( false, r1, r5 );
+ check( false, r1, r6 );
+ check( false, r1, r7 );
+
+ check( false, r2, r3NullMap );
+ check( false, r2, r3EmptyMap );
+ check( false, r2, r4 );
+ check( false, r2, r5 );
+ check( false, r2, r6 );
+ check( false, r2, r7 );
+
+ check( true, r3NullMap, r3EmptyMap );
+ check( false, r3NullMap, r4 );
+ check( false, r3NullMap, r5 );
+ check( false, r3NullMap, r6 );
+ check( false, r3NullMap, r7 );
+
+ check( false, r3EmptyMap, r4 );
+ check( false, r3EmptyMap, r5 );
+ check( false, r3EmptyMap, r6 );
+ check( false, r3EmptyMap, r7 );
+
+ check( false, r4, r5 );
+ check( false, r4, r6 );
+ check( false, r4, r7 );
+
+ check( false, r5, r6 );
+ check( false, r5, r7 );
+
+ check( false, r6, r7 );
+
+ check( true, r1, new NativeSQLQueryCollectionReturn( "a", "b", "c", null, null) );
+ check( true, r2, new NativeSQLQueryCollectionReturn( "a", "c", "b", null, null) );
+ check( true, r3NullMap, new NativeSQLQueryCollectionReturn( "b", "c", "a", null, null) );
+ check( true, r3EmptyMap, new NativeSQLQueryCollectionReturn( "b", "c", "a", new HashMap(), null) );
+ check( true, r4, new NativeSQLQueryCollectionReturn( "b", "c", "a", Collections.singletonMap( "key", "value" ), null) );
+ check( true, r5, new NativeSQLQueryCollectionReturn( "b", "c", "a", Collections.singletonMap( "otherkey", "othervalue" ), null) );
+ check( true, r6, new NativeSQLQueryCollectionReturn( "b", "c", "a", Collections.singletonMap( "key", "value" ), LockMode.NONE ) );
+ check( true, r7, new NativeSQLQueryCollectionReturn( "b", "c", "a", null, LockMode.NONE ) );
+ }
+
+ public void testNativeSQLQueryReturnTypes() {
+ NativeSQLQueryScalarReturn r1 = new NativeSQLQueryScalarReturn( "a", TypeFactory.basic( "int" ) );
+ NativeSQLQueryRootReturn r2 = new NativeSQLQueryRootReturn( "a", "b", LockMode.NONE );
+ NativeSQLQueryJoinReturn r3 = new NativeSQLQueryJoinReturn( "a", "b", "c", Collections.singletonMap( "key", "value" ), LockMode.NONE );
+ NativeSQLQueryCollectionReturn r4 = new NativeSQLQueryCollectionReturn( "a", "b", "c", Collections.singletonMap( "key", "value" ), LockMode.NONE);
+
+ check( false, r1, r2 );
+ check( false, r1, r3 );
+ check( false, r1, r4 );
+
+ check( false, r2, r3 );
+ check( false, r2, r4 );
+
+ check( false, r3, r4 );
+ }
+
+ private void check(boolean expectedEquals, NativeSQLQueryReturn queryReturn1, NativeSQLQueryReturn queryReturn2) {
+ if ( expectedEquals ) {
+ assertTrue( queryReturn1.equals( queryReturn2 ) );
+ assertTrue( queryReturn2.equals( queryReturn1 ) );
+ assertTrue( queryReturn1.hashCode() == queryReturn2.hashCode() );
+ }
+ else {
+ assertFalse( queryReturn1.equals( queryReturn2 ) );
+ assertFalse( queryReturn2.equals( queryReturn1 ) );
+ assertFalse( queryReturn1.hashCode() == queryReturn2.hashCode() );
+ }
+ }
+}
\ No newline at end of file
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Person.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Person.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/Person.java 2010-04-14 11:12:19 UTC (rev 19228)
@@ -0,0 +1,71 @@
+/*
+ * 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.test.queryplan;
+
+/**
+ * Base of inheritence hierarchy
+ *
+ * @author Steve Ebersole
+ */
+public class Person {
+ private Long id;
+ private String name;
+ private char sex;
+
+ /**
+ * Used by persistence
+ */
+ protected Person() {
+ }
+
+ public Person(String name, char sex) {
+ this.name = name;
+ this.sex = sex;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ private void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public char getSex() {
+ return sex;
+ }
+
+ public void setSex(char sex) {
+ this.sex = sex;
+ }
+}
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/User.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/User.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/User.java 2010-04-14 11:12:19 UTC (rev 19228)
@@ -0,0 +1,51 @@
+/*
+ * 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.test.queryplan;
+
+/**
+ * Non-leaf subclass
+ *
+ * @author Steve Ebersole
+ */
+public class User extends Person {
+ private String username;
+
+ protected User() {
+ super();
+ }
+
+ public User(String name, char sex, String username) {
+ super( name, sex );
+ this.username = username;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+}
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/filter-defs.hbm.xml
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/filter-defs.hbm.xml (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/queryplan/filter-defs.hbm.xml 2010-04-14 11:12:19 UTC (rev 19228)
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--
+ ~ Hibernate, Relational Persistence for Idiomatic Java
+ ~
+ ~ Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ ~ indicated by the @author tags or express copyright attribution
+ ~ statements applied by the authors. All third-party contributions are
+ ~ distributed under license by Red Hat Middleware LLC.
+ ~
+ ~ This copyrighted material is made available to anyone wishing to use, modify,
+ ~ copy, or redistribute it subject to the terms and conditions of the GNU
+ ~ Lesser General Public License, as published by the Free Software Foundation.
+ ~
+ ~ This program is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ ~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ ~ for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public License
+ ~ along with this distribution; if not, write to:
+ ~ Free Software Foundation, Inc.
+ ~ 51 Franklin Street, Fifth Floor
+ ~ Boston, MA 02110-1301 USA
+ ~
+ -->
+
+<!DOCTYPE hibernate-mapping
+ SYSTEM
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+
+<hibernate-mapping package="org.hibernate.test.queryplan">
+ <filter-def name="sex" condition="SEX_CODE = :sexCode">
+ <filter-param name="sexCode" type="char"/>
+ </filter-def>
+</hibernate-mapping>
\ No newline at end of file
15 years, 7 months
Hibernate SVN: r19227 - core/trunk/core/src/main/java/org/hibernate/type.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-04-13 14:24:16 -0400 (Tue, 13 Apr 2010)
New Revision: 19227
Modified:
core/trunk/core/src/main/java/org/hibernate/type/EntityType.java
Log:
HHH-5104 : EntityType.isEqual() tests x equals x; should test x equals y (Thierry-Dimitri Roy)
Modified: core/trunk/core/src/main/java/org/hibernate/type/EntityType.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/type/EntityType.java 2010-04-13 18:16:23 UTC (rev 19226)
+++ core/trunk/core/src/main/java/org/hibernate/type/EntityType.java 2010-04-13 18:24:16 UTC (rev 19227)
@@ -350,7 +350,7 @@
}
else {
if ( mappedClass.isAssignableFrom( y.getClass() ) ) {
- yid = persister.getIdentifier(x, entityMode);
+ yid = persister.getIdentifier(y, entityMode);
}
else {
//JPA 2 case where @IdClass contains the id and not the associated entity
15 years, 7 months
Hibernate SVN: r19226 - in core/trunk: core/src/main/javadoc/images and 4 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-04-13 14:16:23 -0400 (Tue, 13 Apr 2010)
New Revision: 19226
Added:
core/trunk/core/src/main/javadoc/images/
core/trunk/core/src/main/javadoc/images/bkg_blkheader.png
core/trunk/core/src/main/javadoc/images/bkg_gradient.gif
core/trunk/core/src/main/javadoc/images/bkgheader.png
core/trunk/core/src/main/javadoc/images/h1_hdr.png
core/trunk/distribution/src/javadoc/
core/trunk/distribution/src/javadoc/images/
core/trunk/distribution/src/javadoc/images/bkg_blkheader.png
core/trunk/distribution/src/javadoc/images/bkg_gradient.gif
core/trunk/distribution/src/javadoc/images/bkgheader.png
core/trunk/distribution/src/javadoc/images/h1_hdr.png
core/trunk/distribution/src/javadoc/package.html
core/trunk/distribution/src/javadoc/stylesheet.css
Modified:
core/trunk/core/src/main/javadoc/package.html
core/trunk/core/src/main/javadoc/stylesheet.css
core/trunk/distribution/pom.xml
Log:
HHH-5083 - Align javadoc styles better with docbook / website
Added: core/trunk/core/src/main/javadoc/images/bkg_blkheader.png
===================================================================
(Binary files differ)
Property changes on: core/trunk/core/src/main/javadoc/images/bkg_blkheader.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: core/trunk/core/src/main/javadoc/images/bkg_gradient.gif
===================================================================
(Binary files differ)
Property changes on: core/trunk/core/src/main/javadoc/images/bkg_gradient.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: core/trunk/core/src/main/javadoc/images/bkgheader.png
===================================================================
(Binary files differ)
Property changes on: core/trunk/core/src/main/javadoc/images/bkgheader.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: core/trunk/core/src/main/javadoc/images/h1_hdr.png
===================================================================
(Binary files differ)
Property changes on: core/trunk/core/src/main/javadoc/images/h1_hdr.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: core/trunk/core/src/main/javadoc/package.html
===================================================================
--- core/trunk/core/src/main/javadoc/package.html 2010-04-13 16:31:21 UTC (rev 19225)
+++ core/trunk/core/src/main/javadoc/package.html 2010-04-13 18:16:23 UTC (rev 19226)
@@ -1,31 +1,54 @@
<body>
-Hibernate JavaDoc documentation.
-<br>
+<h2>Hibernate Core (native API) JavaDocs</h2>
-The following are considered to define the "core API" of Hibernate, meaning it is fully intended that they
-be exposed to application code:
-<ul>
+In addition to {@link org.hibernate.SessionFactory} and {@link org.hibernate.Session}, applications using the
+Hibernate native API will often need to utilize the following interfaces:<ul>
+ <li>{@link org.hibernate.cfg.Configuration}</li>
<li>{@link org.hibernate.Hibernate}</li>
- <li>{@link org.hibernate.Session}</li>
- <li>{@link org.hibernate.SessionFactory}</li>
<li>{@link org.hibernate.Transaction}</li>
<li>{@link org.hibernate.Query}</li>
<li>{@link org.hibernate.Criteria}</li>
- <li>{@link org.hibernate.ScrollableResults}</li>
- <li>{@link org.hibernate.cfg.Configuration}</li>
+ <li>{@link org.hibernate.criterion.Projection}</li>
+ <li>{@link org.hibernate.criterion.Projections}</li>
+ <li>{@link org.hibernate.criterion.Criterion}</li>
<li>{@link org.hibernate.criterion.Restrictions}</li>
<li>{@link org.hibernate.criterion.Order}</li>
<li>{@link org.hibernate.criterion.Example}</li>
</ul>
-<br>
+These interfaces are fully intended to be exposed to application code.
+<hr/>
-The <b>Extension SPIs</b> are intended to be used by application programmers
-to extend Hibernate functionality. None of these interfaces are intended
-to be called by the application - they are called internally by Hibernate.
-These contracts are less stable than the Core API. The safest way to extend
-functionality is to contribute extensions back to the project.<br>
-<br>
+<h3>Extensions</h3>
+Hibernate defines a number of interfaces that are completely intended to be extendable by application programmers and/or
+integrators. Listed below is a (not necessarily exhaustive) list of the most commonly utilized extension points:<ul>
+ <li>{@link org.hibernate.EntityNameResolver}</li>
+ <li>{@link org.hibernate.Interceptor} / {@link org.hibernate.EmptyInterceptor}</li>
+ <li>{@link org.hibernate.Transaction} / {@link org.hibernate.transaction.TransactionFactory}</li>
+ <li>{@link org.hibernate.context.CurrentSessionContext}</li>
+ <li>{@link org.hibernate.dialect.Dialect}</li>
+ <li>{@link org.hibernate.dialect.resolver.DialectResolver}</li>
+ <li>{@link org.hibernate.event event listener} interfaces</li>
+ <li>{@link org.hibernate.id.IdentifierGenerator}</li>
+ <li>{@link org.hibernate.tuple.entity.EntityTuplizer} / {@link org.hibernate.tuple.component.ComponentTuplizer}</li>
+ <li>{@link org.hibernate.type.Type} / {@link org.hibernate.usertype}</li>
+</ul>
+Note that there is a large degree of crossover between the notion of extension points and that of an integration SPI (below).
+<hr/>
-You can find all the Hibernate documentation at <a href="http://docs.jboss.org/hibernate"></a>.
-</body>
+<h3>Integration SPI</h3>
+Hibernate provides a number of SPIs intended to integrate itself with various third party frameworks or application code to provide
+additional capabilities. The SPIs fall mainly into 2 categories:<ul>
+ <li>Caching - {@link org.hibernate.cache.RegionFactory}</li>
+ <li>JDBC Connection management - {@link org.hibernate.connection.ConnectionProvider}
+</ul>
+Certainly {@link org.hibernate.dialect.Dialect} could fit in here as well, though we chose to list it under extensions since application
+developers tend to provide extended dialects rather frequently for various reasons.
+<br/>
+Another SPI that is not yet exposed but is planned for such is the <em>bytecode provider</em> SPI. See {@link org.hibernate.bytecode}
+for details.
+<hr/>
+
+Complete Hibernate documentation may be found online at <a href="http://docs.jboss.org/hibernate/">http://docs.jboss.org/hibernate/</a>.
+
+</body>
\ No newline at end of file
Modified: core/trunk/core/src/main/javadoc/stylesheet.css
===================================================================
--- core/trunk/core/src/main/javadoc/stylesheet.css 2010-04-13 16:31:21 UTC (rev 19225)
+++ core/trunk/core/src/main/javadoc/stylesheet.css 2010-04-13 18:16:23 UTC (rev 19226)
@@ -28,91 +28,147 @@
/* Page background color */
body {
- font-family: Arial;
- background-color: white;
- font-size: 10pt;
-}
-td {
- font-family: Arial;
- font-size: 10pt;
-}
+ background: #FFFFFF url(images/bkg_gradient.gif) repeat-x;
+ margin:0 auto;
+ font-family:'Lucida Grande', Geneva, Verdana, Arial, sans-serif;
+ font-size:12px;
+ padding:0 2em;
+ color:#333;
-/* Table colors */
-.TableHeadingColor { background: #F4F4F4 }
-.TableSubHeadingColor { background: #F4F4F4 }
-.TableRowColor { background: #FFFFFF }
+ }
-/* Font used in left-hand frame lists */
-.FrameTitleFont { font-size: normal; font-family: Arial }
-.FrameHeadingFont { font-size: normal; font-family: Arial }
-.FrameItemFont { font-size: normal; font-family: Arial }
+/* Common elements */
-/* Navigation bar fonts and colors */
-.NavBarCell1 { background-color:#F4F4F4;}
-.NavBarCell1Rev { background-color:silver;}
-.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;}
-.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;}
-.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
-.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
+font {
+ font-family: inherit, sans-serif;
+ font-size: inherit;
+ color: inherit;
+ font-weight: inherit;
+}
+hr {
+ border-style: none;
+ border-bottom: 1px solid #CCCCCC;
+}
+
/* Links */
-A { color: #003399; }
-A:active { color: #003399; }
-A:visited { color: #888888; }
+a:link {
+ color:#003399;
+}
+a:visited {
+ color:#888888;
+}
+a:hover {
+ color:#6699cc;
+}
+a:active {
+ color: #003399;
+}
+/* Headings */
+h1 {
+ background: url(images/h1_hdr.png) no-repeat;
+ line-height:1.2em;
+ color:#586464;
+ font-size:2em;
+ padding:1.5em;
+ margin-top: 0;
+ text-align:left;
+}
-P, OL, UL, LI, DL, DT, DD, BLOCKQUOTE {
- color: #000000;
+h2 {
+ color:#586464;
}
-TD, TH, SPAN {
- color: #000000;
+
+/* Default Table elements and colors */
+
+th, table {
+ border-collapse:collapse;
+ border-color: #E6E7E8;
}
-BLOCKQUOTE {
- margin-right: 0px;
+
+.TableHeadingColor {
+ background:#000000 url(images/bkg_blkheader.png) repeat-x scroll left top;
+ color:#FFFFFF;
+ font-size:12px;
+ font-weight:bold;
+ height:31px;
+ text-align:left;
+ padding:1.5em;
}
-TT {
-font-size: 90%;
- font-family: "Courier New", Courier, monospace;
- color: #000000;
+.TableHeadingColor th {
+ padding-left: 10px;
}
-PRE {
-font-size: 90%;
- padding: 5px;
- border-style: solid;
- border-width: 1px;
- border-color: #CCCCCC;
- background-color: #F4F4F4;
+
+.TableSubHeadingColor {
+ background: #ebe7d7;
}
+.TableRowColor {
+ background: #FFFFFF;
+ border-color: #E6E7E8;
+}
+.TableRowColor td {
+ line-height: 175%;
+ padding-left: 10px;
+}
-UL, OL, LI {
- list-style: disc;
+/* Font used in left-hand frame lists */
+.FrameTitleFont {
+ font-size: 125%;
+ font-family: Helvetica, Arial, sans-serif;
+ font-weight: bold;
+ margin-top: 1em;
+ display: block;
}
+.FrameHeadingFont {
+ font-size: 125%;
+ font-family: 'Lucida Grande', Geneva, Verdana, Arial, sans-serif;
+ font-weight: bold;
+ margin-top: 1em;
+ display: block;
+ color:#586464;
+ border-bottom:1px dotted #CCCCCC;
+}
+.FrameItemFont {
+ font-size: 100%;
+ font-family: Helvetica, Arial, sans-serif
+}
-HR {
- width: 100%;
- height: 1px;
- background-color: #CCCCCC;
- border-width: 0px;
- padding: 0px;
- color: #CCCCCC;
+/* Navigation bar fonts and colors */
+
+.NavBarCell1 {
+ background: #ffffff url(images/bkgheader.png) repeat-x;
+ line-height:3em;
+ padding-left:10px;
+ padding-right:10px;
}
-.variablelist {
- padding-top: 10;
- padding-bottom:10;
- margin:0;
+.NavBarFont1 {
+ color: white;
}
+.NavBarCell1 a {
+ color: white;
+}
-.itemizedlist, UL {
- padding-top: 0;
- padding-bottom:0;
- margin:0;
+.NavBarCell1Rev {
+ background-color:#FFFFFF;
+ padding-left:6px;
+ padding-right:6px;
}
+.NavBarFont1 {
+ color:#FFFFFF;
+}
+.NavBarFont1Rev {
+ color:#243446;
+}
-.term {
- font-weight:bold;
+.NavBarCell2 {
+ background-color:#FFFFFF;
}
+.NavBarCell3 {
+ background-color:#FFFFFF;
+}
Modified: core/trunk/distribution/pom.xml
===================================================================
--- core/trunk/distribution/pom.xml 2010-04-13 16:31:21 UTC (rev 19225)
+++ core/trunk/distribution/pom.xml 2010-04-13 18:16:23 UTC (rev 19226)
@@ -77,14 +77,16 @@
classPath.createPathElement().path = element
}
+ targetDir = 'target/javadocs';
+
ant.javadoc(
executable: '${jdk16_home}/bin/javadoc',
maxmemory: '512m',
- destdir: 'target/javadocs',
+ destdir: targetDir ,
sourcepathref: sourcePathName,
classpathref: classPathName,
- overview: '../core/src/main/javadoc/package.html',
- stylesheetfile: '../core/src/main/javadoc/stylesheet.css',
+ overview: 'src/javadoc/package.html',
+ stylesheetfile: 'src/javadoc/stylesheet.css',
windowtitle: 'Hibernate JavaDocs',
doctitle: 'Hibernate JavaDoc (${project.version})',
bottom: 'Copyright © 2001-2010 <a href="http://redhat.com">Red Hat, Inc.</a> All Rights Reserved.',
@@ -135,6 +137,12 @@
ant.package( name: 'org.hibernate.junit*' )
}
}
+
+ imagesDir = targetDir + '/images'
+ ant.mkdir( dir: imagesDir )
+ ant.copy( toDir: imagesDir ) {
+ fileset( dir: "src/javadoc/images" )
+ }
]]>
</source>
</configuration>
Added: core/trunk/distribution/src/javadoc/images/bkg_blkheader.png
===================================================================
(Binary files differ)
Property changes on: core/trunk/distribution/src/javadoc/images/bkg_blkheader.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: core/trunk/distribution/src/javadoc/images/bkg_gradient.gif
===================================================================
(Binary files differ)
Property changes on: core/trunk/distribution/src/javadoc/images/bkg_gradient.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: core/trunk/distribution/src/javadoc/images/bkgheader.png
===================================================================
(Binary files differ)
Property changes on: core/trunk/distribution/src/javadoc/images/bkgheader.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: core/trunk/distribution/src/javadoc/images/h1_hdr.png
===================================================================
(Binary files differ)
Property changes on: core/trunk/distribution/src/javadoc/images/h1_hdr.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: core/trunk/distribution/src/javadoc/package.html
===================================================================
--- core/trunk/distribution/src/javadoc/package.html (rev 0)
+++ core/trunk/distribution/src/javadoc/package.html 2010-04-13 18:16:23 UTC (rev 19226)
@@ -0,0 +1,93 @@
+<!--
+ ~ 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
+ -->
+<body>
+
+<h2>Aggregated Hibernate Core JavaDocs</h2>
+
+Hibernate provides both<ul>
+ <li>
+ a native API comprised mainly of {@link org.hibernate.SessionFactory} and {@link org.hibernate.Session}
+ </li>
+ <li>
+ an implementation of the <a href="">JSR-317</a> Java Persistence API (JPA) specification comprised mainly of
+ {@link org.hibernate.ejb.EntityManagerFactoryImpl} and {@link org.hibernate.ejb.EntityManagerImpl}
+ </li>
+</ul>
+<hr/>
+
+<h3>Native API</h3>
+In addition to {@link org.hibernate.SessionFactory} and {@link org.hibernate.Session}, applications using the
+native API will often need to utilize the following interfaces:<ul>
+ <li>{@link org.hibernate.cfg.Configuration}</li>
+ <li>{@link org.hibernate.Hibernate}</li>
+ <li>{@link org.hibernate.Transaction}</li>
+ <li>{@link org.hibernate.Query}</li>
+ <li>{@link org.hibernate.Criteria}</li>
+ <li>{@link org.hibernate.criterion.Projection}</li>
+ <li>{@link org.hibernate.criterion.Projections}</li>
+ <li>{@link org.hibernate.criterion.Criterion}</li>
+ <li>{@link org.hibernate.criterion.Restrictions}</li>
+ <li>{@link org.hibernate.criterion.Order}</li>
+ <li>{@link org.hibernate.criterion.Example}</li>
+</ul>
+These interfaces are fully intended to be exposed to application code.
+<hr/>
+
+<h3>JPA</h3>
+The JPA interfaces are all defined by the JPA specification. For details see {@link javax.persistence}
+<hr/>
+
+<h3>Extensions</h3>
+Hibernate defines a number of interfaces that are completely intended to be extendable by application programmers and/or
+integrators. Listed below is a (not necessarily exhaustive) list of the most commonly utilized extension points:<ul>
+ <li>{@link org.hibernate.EntityNameResolver}</li>
+ <li>{@link org.hibernate.Interceptor} / {@link org.hibernate.EmptyInterceptor}</li>
+ <li>{@link org.hibernate.Transaction} / {@link org.hibernate.transaction.TransactionFactory}</li>
+ <li>{@link org.hibernate.context.CurrentSessionContext}</li>
+ <li>{@link org.hibernate.dialect.Dialect}</li>
+ <li>{@link org.hibernate.dialect.resolver.DialectResolver}</li>
+ <li>{@link org.hibernate.event event listener} interfaces</li>
+ <li>{@link org.hibernate.id.IdentifierGenerator}</li>
+ <li>{@link org.hibernate.tuple.entity.EntityTuplizer} / {@link org.hibernate.tuple.component.ComponentTuplizer}</li>
+ <li>{@link org.hibernate.type.Type} / {@link org.hibernate.usertype}</li>
+</ul>
+Note that there is a large degree of crossover between the notion of extension points and that of an integration SPI (below).
+<hr/>
+
+<h3>Integration SPI</h3>
+Hibernate provides a number of SPIs intended to integrate itself with various third party frameworks or application code to provide
+additional capabilities. The SPIs fall mainly into 2 categories:<ul>
+ <li>Caching - {@link org.hibernate.cache.RegionFactory}</li>
+ <li>JDBC Connection management - {@link org.hibernate.connection.ConnectionProvider}
+</ul>
+Certainly {@link org.hibernate.dialect.Dialect} could fit in here as well, though we chose to list it under extensions since application
+developers tend to provide extended dialects rather frequently for various reasons.
+<br/>
+Another SPI that is not yet exposed but is planned for such is the <em>bytecode provider</em> SPI. See {@link org.hibernate.bytecode}
+for details.
+<hr/>
+
+Complete Hibernate documentation may be found online at <a href="http://docs.jboss.org/hibernate/">http://docs.jboss.org/hibernate/</a>.
+
+</body>
\ No newline at end of file
Added: core/trunk/distribution/src/javadoc/stylesheet.css
===================================================================
--- core/trunk/distribution/src/javadoc/stylesheet.css (rev 0)
+++ core/trunk/distribution/src/javadoc/stylesheet.css 2010-04-13 18:16:23 UTC (rev 19226)
@@ -0,0 +1,174 @@
+/*
+ * 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
+ */
+
+/*
+ * Custom Hibernate javadoc style sheet
+ */
+
+/* Page background color */
+body {
+ background: #FFFFFF url(images/bkg_gradient.gif) repeat-x;
+ margin:0 auto;
+ font-family:'Lucida Grande', Geneva, Verdana, Arial, sans-serif;
+ font-size:12px;
+ padding:0 2em;
+ color:#333;
+
+ }
+
+/* Common elements */
+
+font {
+ font-family: inherit, sans-serif;
+ font-size: inherit;
+ color: inherit;
+ font-weight: inherit;
+}
+
+hr {
+ border-style: none;
+ border-bottom: 1px solid #CCCCCC;
+}
+
+/* Links */
+a:link {
+ color:#003399;
+}
+a:visited {
+ color:#888888;
+}
+a:hover {
+ color:#6699cc;
+}
+a:active {
+ color: #003399;
+}
+
+/* Headings */
+h1 {
+ background: url(images/h1_hdr.png) no-repeat;
+ line-height:1.2em;
+ color:#586464;
+ font-size:2em;
+ padding:1.5em;
+ margin-top: 0;
+ text-align:left;
+}
+
+h2 {
+ color:#586464;
+}
+
+
+/* Default Table elements and colors */
+
+th, table {
+ border-collapse:collapse;
+ border-color: #E6E7E8;
+}
+
+
+.TableHeadingColor {
+ background:#000000 url(images/bkg_blkheader.png) repeat-x scroll left top;
+ color:#FFFFFF;
+ font-size:12px;
+ font-weight:bold;
+ height:31px;
+ text-align:left;
+ padding:1.5em;
+}
+
+.TableHeadingColor th {
+ padding-left: 10px;
+}
+
+
+.TableSubHeadingColor {
+ background: #ebe7d7;
+}
+.TableRowColor {
+ background: #FFFFFF;
+ border-color: #E6E7E8;
+}
+.TableRowColor td {
+ line-height: 175%;
+ padding-left: 10px;
+}
+
+/* Font used in left-hand frame lists */
+.FrameTitleFont {
+ font-size: 125%;
+ font-family: Helvetica, Arial, sans-serif;
+ font-weight: bold;
+ margin-top: 1em;
+ display: block;
+}
+.FrameHeadingFont {
+ font-size: 125%;
+ font-family: 'Lucida Grande', Geneva, Verdana, Arial, sans-serif;
+ font-weight: bold;
+ margin-top: 1em;
+ display: block;
+ color:#586464;
+ border-bottom:1px dotted #CCCCCC;
+}
+.FrameItemFont {
+ font-size: 100%;
+ font-family: Helvetica, Arial, sans-serif
+}
+
+/* Navigation bar fonts and colors */
+
+.NavBarCell1 {
+ background: #ffffff url(images/bkgheader.png) repeat-x;
+ line-height:3em;
+ padding-left:10px;
+ padding-right:10px;
+}
+
+.NavBarFont1 {
+ color: white;
+}
+.NavBarCell1 a {
+ color: white;
+}
+
+.NavBarCell1Rev {
+ background-color:#FFFFFF;
+ padding-left:6px;
+ padding-right:6px;
+}
+.NavBarFont1 {
+ color:#FFFFFF;
+}
+.NavBarFont1Rev {
+ color:#243446;
+}
+
+.NavBarCell2 {
+ background-color:#FFFFFF;
+}
+.NavBarCell3 {
+ background-color:#FFFFFF;
+}
15 years, 7 months
Hibernate SVN: r19225 - in core/trunk/testsuite/src/test/java/org/hibernate/test: namingstrategy and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2010-04-13 12:31:21 -0400 (Tue, 13 Apr 2010)
New Revision: 19225
Added:
core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/
core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/Customers.hbm.xml
core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/Customers.java
core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/NamingStrategyTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/TestNamingStrategy.java
Log:
HHH-4077 add test for naming strategy in hbm files
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/Customers.hbm.xml
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/Customers.hbm.xml (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/Customers.hbm.xml 2010-04-13 16:31:21 UTC (rev 19225)
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!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.namingstrategy">
+ <class name="Customers">
+ <id name="id" column="id" type="int"/>
+ <property name="specified_column" column="specified_column"/>
+ </class>
+</hibernate-mapping>
\ No newline at end of file
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/Customers.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/Customers.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/Customers.java 2010-04-13 16:31:21 UTC (rev 19225)
@@ -0,0 +1,25 @@
+package org.hibernate.test.namingstrategy;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class Customers implements java.io.Serializable {
+ private int id;
+ private String specified_column;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getSpecified_column() {
+ return specified_column;
+ }
+
+ public void setSpecified_column(String specified_column) {
+ this.specified_column = specified_column;
+ }
+}
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/NamingStrategyTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/NamingStrategyTest.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/NamingStrategyTest.java 2010-04-13 16:31:21 UTC (rev 19225)
@@ -0,0 +1,34 @@
+package org.hibernate.test.namingstrategy;
+
+import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.Environment;
+import org.hibernate.junit.functional.FunctionalTestCase;
+import org.hibernate.mapping.Column;
+import org.hibernate.mapping.PersistentClass;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class NamingStrategyTest extends FunctionalTestCase {
+ public void testCorrectDatabase() {
+ PersistentClass classMapping = getCfg().getClassMapping( Customers.class.getName() );
+ Column stateColumn = (Column) classMapping.getProperty( "specified_column" ).getColumnIterator().next();
+ assertEquals( "CN_specified_column", stateColumn.getName() );
+ }
+
+ @Override
+ public void configure(Configuration cfg) {
+ super.configure( cfg );
+ cfg.setNamingStrategy( new TestNamingStrategy() );
+ }
+
+ public NamingStrategyTest(String string) {
+ super( string );
+ }
+
+ public String[] getMappings() {
+ return new String[] {
+ "namingstrategy/Customers.hbm.xml"
+ };
+ }
+}
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/TestNamingStrategy.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/TestNamingStrategy.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/namingstrategy/TestNamingStrategy.java 2010-04-13 16:31:21 UTC (rev 19225)
@@ -0,0 +1,21 @@
+package org.hibernate.test.namingstrategy;
+
+import org.hibernate.cfg.DefaultNamingStrategy;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class TestNamingStrategy extends DefaultNamingStrategy {
+ public String propertyToColumnName(String propertyName) {
+ return "PTCN_" + propertyName;
+ }
+
+ public String columnName(String columnName) {
+ return "CN_" + columnName;
+ }
+
+ public String logicalColumnName(String columnName, String
+ propertyName) {
+ return "LCN_" + super.logicalColumnName( columnName, propertyName );
+ }
+}
15 years, 7 months
Hibernate SVN: r19224 - core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/hql.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-04-13 12:02:56 -0400 (Tue, 13 Apr 2010)
New Revision: 19224
Modified:
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java
Log:
JBPAPP-4095 HHH-5096 FetchingScrollableResultsImpl.last() does not move to the last result if cursor is after the last result
Modified: core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java 2010-04-13 16:02:13 UTC (rev 19223)
+++ core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java 2010-04-13 16:02:56 UTC (rev 19224)
@@ -46,7 +46,195 @@
txn.commit();
s.close();
}
+ public void testScrollingJoinFetchesEmptyResultSet() {
+ Session s = openSession();
+ Transaction txn = s.beginTransaction();
+ assertTrue(s
+ .createQuery( "from Animal a left join fetch a.offspring where a.description like :desc order by a.id" )
+ .setString( "desc", "root%" )
+ .list()
+ .isEmpty() );
+
+ ScrollableResults results = s
+ .createQuery( "from Animal a left join fetch a.offspring where a.description like :desc order by a.id" )
+ .setString( "desc", "root%" )
+ .scroll();
+
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertFalse( results.next() );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertFalse( results.previous() );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ results.beforeFirst();
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ assertFalse( results.next() );
+
+ assertFalse( results.first() );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ assertFalse( results.next() );
+
+ results.afterLast();
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ assertFalse( results.next() );
+
+ assertFalse( results.last() );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ assertFalse( results.next() );
+
+ for ( int i=1; i<3; i++ ) {
+ assertFalse( results.scroll( i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertFalse( results.scroll( - i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertFalse( results.setRowNumber( i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertFalse( results.setRowNumber( - i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ }
+
+ txn.commit();
+ s.close();
+ }
+
+ public void testScrollingJoinFetchesSingleRowResultSet() {
+ Session s = openSession();
+ Transaction txn = s.beginTransaction();
+
+ Animal mother = new Animal();
+ mother.setDescription( "root-1" );
+
+ Animal daughter = new Animal();
+ daughter.setDescription( "daughter" );
+
+ daughter.setMother( mother );
+ mother.addOffspring( daughter );
+
+ s.save( mother );
+ s.save( daughter );
+
+ txn.commit();
+ s.close();
+
+ s = openSession();
+ txn = s.beginTransaction();
+
+ assertNotNull(s
+ .createQuery( "from Animal a left join fetch a.offspring where a.description like :desc order by a.id" )
+ .setString( "desc", "root%" )
+ .uniqueResult() );
+
+ ScrollableResults results = s
+ .createQuery( "from Animal a left join fetch a.offspring where a.description like :desc order by a.id" )
+ .setString( "desc", "root%" )
+ .scroll();
+
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ assertFalse( results.previous() );
+
+ assertTrue( results.next() );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+
+ assertFalse( results.next() );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertTrue( results.previous() );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+
+ assertFalse( results.previous() );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertTrue( results.next() );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+
+ results.beforeFirst();
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ assertFalse( results.previous() );
+
+ assertTrue( results.first() );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+ assertFalse( results.next() );
+
+ results.afterLast();
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ assertFalse( results.next() );
+
+ assertTrue( results.last() );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+ assertFalse( results.next() );
+
+ assertTrue( results.first() );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+
+ for ( int i=1; i<3; i++ ) {
+ assertTrue( results.setRowNumber( 1 ) );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+
+ assertFalse( results.scroll( i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertTrue( results.setRowNumber( 1 ) );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+
+ assertFalse( results.scroll( - i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ if ( i != 1 ) {
+ assertFalse( results.setRowNumber( i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertFalse( results.setRowNumber( - i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ }
+ }
+
+ txn.commit();
+ s.close();
+
+ s = openSession();
+ txn = s.beginTransaction();
+
+ s.createQuery( "delete Animal where not description like 'root%'" ).executeUpdate();
+ s.createQuery( "delete Animal" ).executeUpdate();
+
+ txn.commit();
+ s.close();
+ }
+
public void testScrollingJoinFetchesForward() {
if ( ! supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() ) {
return;
15 years, 7 months
Hibernate SVN: r19223 - core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/impl.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-04-13 12:02:13 -0400 (Tue, 13 Apr 2010)
New Revision: 19223
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/impl/FetchingScrollableResultsImpl.java
Log:
JBPAPP-4095 HHH-5096 FetchingScrollableResultsImpl.last() does not move to the last result if cursor is after the last result
Modified: core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/impl/FetchingScrollableResultsImpl.java
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/impl/FetchingScrollableResultsImpl.java 2010-04-13 16:01:56 UTC (rev 19222)
+++ core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/impl/FetchingScrollableResultsImpl.java 2010-04-13 16:02:13 UTC (rev 19223)
@@ -24,6 +24,7 @@
*/
package org.hibernate.impl;
+import org.apache.tools.ant.taskdefs.condition.IsReference;
import org.hibernate.HibernateException;
import org.hibernate.MappingException;
import org.hibernate.exception.JDBCExceptionHelper;
@@ -74,7 +75,11 @@
currentPosition = maxPosition.intValue() + 1;
return false;
}
-
+ if ( isResultSetEmpty() ) {
+ currentRow = null;
+ currentPosition = 0;
+ return false;
+ }
Object row = getLoader().loadSequentialRowsForward(
getResultSet(),
getSession(),
@@ -183,13 +188,16 @@
public boolean last() throws HibernateException {
boolean more = false;
if ( maxPosition != null ) {
+ if ( currentPosition > maxPosition.intValue() ) {
+ more = previous();
+ }
for ( int i = currentPosition; i < maxPosition.intValue(); i++ ) {
more = next();
}
}
else {
try {
- if ( getResultSet().isAfterLast() ) {
+ if ( isResultSetEmpty() || getResultSet().isAfterLast() ) {
// should not be able to reach last without maxPosition being set
// unless there are no results
return false;
@@ -313,4 +321,15 @@
}
return scroll( rowNumber - currentPosition );
}
+
+ private boolean isResultSetEmpty() {
+ try {
+ return currentPosition == 0 && !getResultSet().isBeforeFirst()
+ && !getResultSet().isAfterLast();
+ } catch ( SQLException e ) {
+ throw JDBCExceptionHelper
+ .convert( getSession().getFactory().getSQLExceptionConverter(), e,
+ "Could not determine if resultset is empty due to exception calling isBeforeFirst or isAfterLast()" );
+ }
+ }
}
15 years, 7 months
Hibernate SVN: r19222 - in core/branches/Branch_3_2_4_SP1_CP: test/org/hibernate/test/hql and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-04-13 12:01:56 -0400 (Tue, 13 Apr 2010)
New Revision: 19222
Modified:
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/impl/FetchingScrollableResultsImpl.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java
Log:
JBPAPP-4095 HHH-5096 FetchingScrollableResultsImpl.last() does not move to the last result if cursor is after the last result
Modified: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/impl/FetchingScrollableResultsImpl.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/impl/FetchingScrollableResultsImpl.java 2010-04-13 14:58:16 UTC (rev 19221)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/impl/FetchingScrollableResultsImpl.java 2010-04-13 16:01:56 UTC (rev 19222)
@@ -51,6 +51,12 @@
currentPosition = maxPosition.intValue() + 1;
return false;
}
+
+ if ( isResultSetEmpty() ) {
+ currentRow = null;
+ currentPosition = 0;
+ return false;
+ }
Object row = getLoader().loadSequentialRowsForward(
getResultSet(),
@@ -160,13 +166,16 @@
public boolean last() throws HibernateException {
boolean more = false;
if ( maxPosition != null ) {
+ if ( currentPosition > maxPosition.intValue() ) {
+ more = previous();
+ }
for ( int i = currentPosition; i < maxPosition.intValue(); i++ ) {
more = next();
}
}
else {
try {
- if ( getResultSet().isAfterLast() ) {
+ if ( isResultSetEmpty() || getResultSet().isAfterLast() ) {
// should not be able to reach last without maxPosition being set
// unless there are no results
return false;
@@ -290,4 +299,14 @@
}
return scroll( rowNumber - currentPosition );
}
+ private boolean isResultSetEmpty() {
+ try {
+ return currentPosition == 0 && !getResultSet().isBeforeFirst()
+ && !getResultSet().isAfterLast();
+ } catch ( SQLException e ) {
+ throw JDBCExceptionHelper
+ .convert( getSession().getFactory().getSQLExceptionConverter(), e,
+ "Could not determine if resultset is empty due to exception calling isBeforeFirst or isAfterLast()" );
+ }
+ }
}
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java 2010-04-13 14:58:16 UTC (rev 19221)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java 2010-04-13 16:01:56 UTC (rev 19222)
@@ -46,7 +46,195 @@
txn.commit();
s.close();
}
+ public void testScrollingJoinFetchesEmptyResultSet() {
+ Session s = openSession();
+ Transaction txn = s.beginTransaction();
+ assertTrue(s
+ .createQuery( "from Animal a left join fetch a.offspring where a.description like :desc order by a.id" )
+ .setString( "desc", "root%" )
+ .list()
+ .isEmpty() );
+
+ ScrollableResults results = s
+ .createQuery( "from Animal a left join fetch a.offspring where a.description like :desc order by a.id" )
+ .setString( "desc", "root%" )
+ .scroll();
+
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertFalse( results.next() );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertFalse( results.previous() );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ results.beforeFirst();
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ assertFalse( results.next() );
+
+ assertFalse( results.first() );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ assertFalse( results.next() );
+
+ results.afterLast();
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ assertFalse( results.next() );
+
+ assertFalse( results.last() );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ assertFalse( results.next() );
+
+ for ( int i=1; i<3; i++ ) {
+ assertFalse( results.scroll( i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertFalse( results.scroll( - i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertFalse( results.setRowNumber( i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertFalse( results.setRowNumber( - i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ }
+
+ txn.commit();
+ s.close();
+ }
+
+ public void testScrollingJoinFetchesSingleRowResultSet() {
+ Session s = openSession();
+ Transaction txn = s.beginTransaction();
+
+ Animal mother = new Animal();
+ mother.setDescription( "root-1" );
+
+ Animal daughter = new Animal();
+ daughter.setDescription( "daughter" );
+
+ daughter.setMother( mother );
+ mother.addOffspring( daughter );
+
+ s.save( mother );
+ s.save( daughter );
+
+ txn.commit();
+ s.close();
+
+ s = openSession();
+ txn = s.beginTransaction();
+
+ assertNotNull(s
+ .createQuery( "from Animal a left join fetch a.offspring where a.description like :desc order by a.id" )
+ .setString( "desc", "root%" )
+ .uniqueResult() );
+
+ ScrollableResults results = s
+ .createQuery( "from Animal a left join fetch a.offspring where a.description like :desc order by a.id" )
+ .setString( "desc", "root%" )
+ .scroll();
+
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ assertFalse( results.previous() );
+
+ assertTrue( results.next() );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+
+ assertFalse( results.next() );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertTrue( results.previous() );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+
+ assertFalse( results.previous() );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertTrue( results.next() );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+
+ results.beforeFirst();
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ assertFalse( results.previous() );
+
+ assertTrue( results.first() );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+ assertFalse( results.next() );
+
+ results.afterLast();
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ assertFalse( results.next() );
+
+ assertTrue( results.last() );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+ assertFalse( results.next() );
+
+ assertTrue( results.first() );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+
+ for ( int i=1; i<3; i++ ) {
+ assertTrue( results.setRowNumber( 1 ) );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+
+ assertFalse( results.scroll( i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertTrue( results.setRowNumber( 1 ) );
+ assertTrue( results.isFirst() );
+ assertTrue( results.isLast() );
+
+ assertFalse( results.scroll( - i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ if ( i != 1 ) {
+ assertFalse( results.setRowNumber( i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+
+ assertFalse( results.setRowNumber( - i ) );
+ assertFalse( results.isFirst() );
+ assertFalse( results.isLast() );
+ }
+ }
+
+ txn.commit();
+ s.close();
+
+ s = openSession();
+ txn = s.beginTransaction();
+
+ s.createQuery( "delete Animal where not description like 'root%'" ).executeUpdate();
+ s.createQuery( "delete Animal" ).executeUpdate();
+
+ txn.commit();
+ s.close();
+ }
+
public void testScrollingJoinFetchesForward() {
if ( ! supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() ) {
return;
15 years, 7 months
Hibernate SVN: r19221 - in core/trunk/annotations/src/test/java/org/hibernate/test/annotations: derivedidentities/e1/b2 and 4 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2010-04-13 10:58:16 -0400 (Tue, 13 Apr 2010)
New Revision: 19221
Modified:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/cid/CompositeIdTest.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b2/IdClassGeneratedValueManyToOneTest.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e5/a/DerivedIdentityIdClassParentSameIdTypeIdClassDepTest.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e5/b/DerivedIdentityIdClassParentSameIdTypeEmbeddedIdDepTest.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/many2one/EmbeddableWithMany2OneTest.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/idclassgeneratedvalue/IdClassGeneratedValueTest.java
Log:
Clean import
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/cid/CompositeIdTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/cid/CompositeIdTest.java 2010-04-13 14:01:54 UTC (rev 19220)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/cid/CompositeIdTest.java 2010-04-13 14:58:16 UTC (rev 19221)
@@ -1,18 +1,16 @@
//$Id$
package org.hibernate.test.annotations.cid;
+import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-import java.util.ArrayList;
+import org.hibernate.Criteria;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.Criteria;
import org.hibernate.criterion.Disjunction;
import org.hibernate.criterion.Restrictions;
-import org.hibernate.junit.FailureExpected;
-import org.hibernate.junit.SkipForDialect;
import org.hibernate.test.annotations.TestCase;
/**
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b2/IdClassGeneratedValueManyToOneTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b2/IdClassGeneratedValueManyToOneTest.java 2010-04-13 14:01:54 UTC (rev 19220)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e1/b2/IdClassGeneratedValueManyToOneTest.java 2010-04-13 14:58:16 UTC (rev 19221)
@@ -30,8 +30,6 @@
import org.hibernate.Transaction;
import org.hibernate.test.annotations.TestCase;
-import org.hibernate.junit.FailureExpected;
-
/**
* A test.
*
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e5/a/DerivedIdentityIdClassParentSameIdTypeIdClassDepTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e5/a/DerivedIdentityIdClassParentSameIdTypeIdClassDepTest.java 2010-04-13 14:01:54 UTC (rev 19220)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e5/a/DerivedIdentityIdClassParentSameIdTypeIdClassDepTest.java 2010-04-13 14:58:16 UTC (rev 19221)
@@ -1,7 +1,6 @@
package org.hibernate.test.annotations.derivedidentities.e5.a;
import org.hibernate.Session;
-import org.hibernate.junit.FailureExpected;
import org.hibernate.test.annotations.TestCase;
import org.hibernate.test.util.SchemaUtil;
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e5/b/DerivedIdentityIdClassParentSameIdTypeEmbeddedIdDepTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e5/b/DerivedIdentityIdClassParentSameIdTypeEmbeddedIdDepTest.java 2010-04-13 14:01:54 UTC (rev 19220)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/e5/b/DerivedIdentityIdClassParentSameIdTypeEmbeddedIdDepTest.java 2010-04-13 14:58:16 UTC (rev 19221)
@@ -1,9 +1,6 @@
package org.hibernate.test.annotations.derivedidentities.e5.b;
-import java.util.Date;
-
import org.hibernate.Session;
-import org.hibernate.junit.FailureExpected;
import org.hibernate.test.annotations.TestCase;
import org.hibernate.test.util.SchemaUtil;
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/many2one/EmbeddableWithMany2OneTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/many2one/EmbeddableWithMany2OneTest.java 2010-04-13 14:01:54 UTC (rev 19220)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/many2one/EmbeddableWithMany2OneTest.java 2010-04-13 14:58:16 UTC (rev 19221)
@@ -26,7 +26,6 @@
import java.util.List;
import org.hibernate.Session;
-import org.hibernate.junit.FailureExpected;
import org.hibernate.test.annotations.TestCase;
/**
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/idclassgeneratedvalue/IdClassGeneratedValueTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/idclassgeneratedvalue/IdClassGeneratedValueTest.java 2010-04-13 14:01:54 UTC (rev 19220)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/idclassgeneratedvalue/IdClassGeneratedValueTest.java 2010-04-13 14:58:16 UTC (rev 19221)
@@ -27,7 +27,6 @@
import java.util.List;
import org.hibernate.Session;
-import org.hibernate.junit.FailureExpected;
import org.hibernate.test.annotations.TestCase;
/**
15 years, 7 months
Hibernate SVN: r19220 - in core/trunk: annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-04-13 10:01:54 -0400 (Tue, 13 Apr 2010)
New Revision: 19220
Added:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/Account.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/AccountBase.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/IntermediateMappedSuperclassTest.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/SavingsAccount.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/SavingsAccountBase.java
Modified:
core/trunk/core/src/main/java/org/hibernate/mapping/Subclass.java
Log:
HHH-5102 - Instances of a subclass can't be loaded
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/Account.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/Account.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/Account.java 2010-04-13 14:01:54 UTC (rev 19220)
@@ -0,0 +1,46 @@
+/*
+ * 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.annotations.mappedsuperclass.intermediate;
+
+import javax.persistence.Entity;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.Table;
+
+/**
+ * The intermediate entity in the hierarchy
+ *
+ * @author Saša Obradović
+ */
+@Entity
+@Table(name = "ACCOUNT")
+@Inheritance(strategy = InheritanceType.JOINED)
+public class Account extends AccountBase {
+ public Account() {
+ }
+
+ public Account(String accountNumber) {
+ super( accountNumber );
+ }
+}
\ No newline at end of file
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/AccountBase.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/AccountBase.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/AccountBase.java 2010-04-13 14:01:54 UTC (rev 19220)
@@ -0,0 +1,67 @@
+/*
+ * 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.annotations.mappedsuperclass.intermediate;
+
+
+import javax.persistence.Column;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.MappedSuperclass;
+import javax.persistence.GenerationType;
+
+/**
+ * Represents the most base super class in the hierarchy.
+ *
+ * @author Saša Obradović
+ */
+@MappedSuperclass
+public abstract class AccountBase {
+ @Id
+ @org.hibernate.annotations.GenericGenerator(name = "generator::Account", strategy = "increment")
+ @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "generator::Account")
+ @Column(name = "ACC_ID")
+ private Long id;
+
+ @Column(name = "ACC_NO")
+ private String accountNumber;
+
+ public Long getId() {
+ return id;
+ }
+
+ protected AccountBase() {
+ }
+
+ protected AccountBase(String accountNumber) {
+ this.accountNumber = accountNumber;
+ }
+
+ public String getAccountNumber() {
+ return accountNumber;
+ }
+
+ public void setAccountNumber(String accountNumber) {
+ this.accountNumber = accountNumber;
+ }
+}
\ No newline at end of file
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/IntermediateMappedSuperclassTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/IntermediateMappedSuperclassTest.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/IntermediateMappedSuperclassTest.java 2010-04-13 14:01:54 UTC (rev 19220)
@@ -0,0 +1,59 @@
+/*
+ * 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.annotations.mappedsuperclass.intermediate;
+
+import java.math.BigDecimal;
+
+import org.hibernate.Session;
+import org.hibernate.test.annotations.TestCase;
+
+/**
+ * TODO : javadoc
+ *
+ * @author Steve Ebersole
+ */
+public class IntermediateMappedSuperclassTest extends TestCase {
+ @Override
+ protected Class<?>[] getAnnotatedClasses() {
+ return new Class[] { AccountBase.class, Account.class, SavingsAccountBase.class, SavingsAccount.class };
+ }
+
+ public void testGetOnIntermediateMappedSuperclass() {
+ final BigDecimal withdrawalLimit = new BigDecimal( 1000 );
+ Session session = openSession();
+ session.beginTransaction();
+ SavingsAccount savingsAccount = new SavingsAccount( "123", withdrawalLimit );
+ session.save( savingsAccount );
+ session.getTransaction().commit();
+ session.close();
+
+ session = openSession();
+ session.beginTransaction();
+ Account account = (Account) session.get( Account.class, savingsAccount.getId() );
+ assertEquals( withdrawalLimit, ( (SavingsAccount) account ).getWithdrawalLimit() );
+ session.delete( account );
+ session.getTransaction().commit();
+ session.close();
+ }
+}
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/SavingsAccount.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/SavingsAccount.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/SavingsAccount.java 2010-04-13 14:01:54 UTC (rev 19220)
@@ -0,0 +1,46 @@
+/*
+ * 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.annotations.mappedsuperclass.intermediate;
+
+import java.math.BigDecimal;
+import javax.persistence.Entity;
+import javax.persistence.PrimaryKeyJoinColumn;
+import javax.persistence.Table;
+
+/**
+ * The "leaf" entity in the hierarchy
+ *
+ * @author Saša Obradović
+ */
+@Entity
+@Table(name = "SAVINGS_ACCOUNT")
+@PrimaryKeyJoinColumn(name = "SAVACC_ACC_ID")
+public class SavingsAccount extends SavingsAccountBase {
+ public SavingsAccount() {
+ }
+
+ public SavingsAccount(String accountNumber, BigDecimal withdrawalLimit) {
+ super( accountNumber, withdrawalLimit );
+ }
+}
\ No newline at end of file
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/SavingsAccountBase.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/SavingsAccountBase.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/mappedsuperclass/intermediate/SavingsAccountBase.java 2010-04-13 14:01:54 UTC (rev 19220)
@@ -0,0 +1,56 @@
+/*
+ * 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.annotations.mappedsuperclass.intermediate;
+
+import java.math.BigDecimal;
+import javax.persistence.Column;
+import javax.persistence.MappedSuperclass;
+
+
+/**
+ * Represents the intermediate mapped superclass in the hierarchy.
+ *
+ * @author Saša Obradović
+ */
+@MappedSuperclass
+public abstract class SavingsAccountBase extends Account {
+ @Column(name = "SAVACC_WITHDRAWALLIMIT")
+ private BigDecimal withdrawalLimit;
+
+ protected SavingsAccountBase() {
+ }
+
+ protected SavingsAccountBase(String accountNumber, BigDecimal withdrawalLimit) {
+ super( accountNumber );
+ this.withdrawalLimit = withdrawalLimit;
+ }
+
+ public BigDecimal getWithdrawalLimit() {
+ return withdrawalLimit;
+ }
+
+ public void setWithdrawalLimit(BigDecimal withdrawalLimit) {
+ this.withdrawalLimit = withdrawalLimit;
+ }
+}
\ No newline at end of file
Modified: core/trunk/core/src/main/java/org/hibernate/mapping/Subclass.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/mapping/Subclass.java 2010-04-13 13:35:38 UTC (rev 19219)
+++ core/trunk/core/src/main/java/org/hibernate/mapping/Subclass.java 2010-04-13 14:01:54 UTC (rev 19220)
@@ -99,7 +99,7 @@
getSuperclass().addSubclassProperty(p);
}
- public void addMappedsuperClassProperty(Property p) {
+ public void addMappedsuperclassProperty(Property p) {
super.addMappedsuperclassProperty( p );
getSuperclass().addSubclassProperty(p);
}
15 years, 7 months