Hibernate SVN: r18307 - in core/branches/Branch_3_2_4_SP1_CP: test/org/hibernate/test/criteria and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-21 12:18:14 -0500 (Mon, 21 Dec 2009)
New Revision: 18307
Added:
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/criteria/Animal.hbm.xml
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/criteria/LongInElementsTest.java
Modified:
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/hql/ast/util/NodeTraverser.java
Log:
JBPAPP-3089 HHH-2166 - Long 'in' lists in queries results in a Java stack overflow exception.
Modified: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/hql/ast/util/NodeTraverser.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/hql/ast/util/NodeTraverser.java 2009-12-21 17:07:30 UTC (rev 18306)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/hql/ast/util/NodeTraverser.java 2009-12-21 17:18:14 UTC (rev 18307)
@@ -1,44 +1,156 @@
+/*
+ * 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.hql.ast.util;
import antlr.collections.AST;
+import java.util.Map;
+import java.util.HashMap;
/**
* A visitor for traversing an AST tree.
- *
+ *
* @author Steve Ebersole
+ * @author Philip R. "Pib" Burns.
+ *
*/
+
public class NodeTraverser {
public static interface VisitationStrategy {
- public void visit(AST node);
+ public void visit( AST node );
}
private final VisitationStrategy strategy;
- public NodeTraverser(VisitationStrategy strategy) {
+ public NodeTraverser( VisitationStrategy strategy ) {
this.strategy = strategy;
}
/**
* Traverse the AST tree depth first.
- * <p/>
- * Note that the AST passed in is not visited itself. Visitation starts
- * with its children.
- *
+ *
* @param ast
+ * Root node of subtree to traverse.
+ *
+ * <p>
+ * Note that the AST passed in is not visited itself. Visitation
+ * starts with its children.
+ * </p>
+ * <p>
+ * The current code for traverseDepthFirst uses iteration to walk
+ * the tree. This corrects stack overflow problems for constructs
+ * such as "x in (:x)" where ":x" specifies a large number of
+ * items.
+ * </p>
*/
- public void traverseDepthFirst(AST ast) {
+
+ public void traverseDepthFirst( AST ast ) {
+ // Root AST node cannot be null or
+ // traversal of its subtree is impossible.
if ( ast == null ) {
throw new IllegalArgumentException( "node to traverse cannot be null!" );
}
- visitDepthFirst( ast.getFirstChild() );
- }
+ // Map to hold parents of each
+ // AST node. Unfortunately the AST
+ // interface does not provide a method
+ // for finding the parent of a node, so
+ // we use the Map to save them.
- private void visitDepthFirst(AST ast) {
- if ( ast == null ) {
- return;
+ Map parentNodes = new HashMap();
+
+ // Start tree traversal with first child
+ // of the specified root AST node.
+
+ AST currentNode = ast.getFirstChild();
+
+ // Remember parent of first child.
+
+ parentNodes.put(currentNode, ast);
+
+ // Iterate through nodes, simulating
+ // recursive tree traversal, and add them
+ // to queue in proper order for later
+ // linear traversal. This "flattens" the
+ // into a linear list of nodes which can
+ // be visited non-recursively.
+
+ while ( currentNode != null ) {
+ // Visit the current node.
+
+ strategy.visit( currentNode );
+
+ // Move down to current node's first child
+ // if it exists.
+
+ AST childNode = currentNode.getFirstChild();
+
+ // If the child is not null, make it
+ // the current node.
+
+ if ( childNode != null ) {
+ // Remember parent of the child.
+
+ parentNodes.put( childNode, currentNode );
+
+ // Make child the current node.
+
+ currentNode = childNode;
+
+ continue;
+ }
+
+ while ( currentNode != null ) {
+ // Move to next sibling if any.
+
+ AST siblingNode = currentNode.getNextSibling();
+
+ if (siblingNode != null) {
+ // Get current node's parent.
+ // This is also the parent of the
+ // sibling node.
+
+ AST parentNode = (AST) parentNodes.get(currentNode);
+
+ // Remember parent of sibling.
+
+ parentNodes.put(siblingNode, parentNode);
+
+ // Make sibling the current node.
+
+ currentNode = siblingNode;
+
+ break;
+ }
+ // Move up to parent if no sibling.
+ // If parent is root node, we're done.
+
+ currentNode = (AST) parentNodes.get(currentNode);
+
+ if (currentNode.equals(ast)) {
+ currentNode = null;
+ }
+ }
}
- strategy.visit( ast );
- visitDepthFirst( ast.getFirstChild() );
- visitDepthFirst( ast.getNextSibling() );
}
}
Added: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/criteria/Animal.hbm.xml
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/criteria/Animal.hbm.xml (rev 0)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/criteria/Animal.hbm.xml 2009-12-21 17:18:14 UTC (rev 18307)
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+<hibernate-mapping
+ package="org.hibernate.test.hql">
+
+
+
+ <class name="StateProvince">
+ <id name="id">
+ <generator class="native"/>
+ </id>
+ <property name="name"/>
+ <property name="isoCode"/>
+ </class>
+
+
+</hibernate-mapping>
\ No newline at end of file
Added: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/criteria/LongInElementsTest.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/criteria/LongInElementsTest.java (rev 0)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-21 17:18:14 UTC (rev 18307)
@@ -0,0 +1,111 @@
+/*
+ * 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.criteria;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.Criteria;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.criterion.Restrictions;
+import org.hibernate.junit.functional.FunctionalTestCase;
+import org.hibernate.test.hql.StateProvince;
+
+/**
+ *
+ * HHH-2166 Long "in" lists in queries results in a Java stack overflow exception.
+ *
+ * @author Strong Liu
+ */
+public class LongInElementsTest extends FunctionalTestCase {
+
+ private static final int ELEMENTS_SIZE = 4000;
+
+ public LongInElementsTest( String string ) {
+ super(string);
+ }
+
+ public String[] getMappings() {
+ return new String[] { "criteria/Animal.hbm.xml" };
+ }
+
+ //HHH-1123
+ public void testLongInElementsByHQL(){
+ Session session = openSession();
+ Transaction t = session.beginTransaction();
+
+ StateProvince beijing = new StateProvince();
+ beijing.setIsoCode("100089");
+ beijing.setName("beijing");
+ session.persist(beijing);
+ session.flush();
+ session.clear();
+
+ Query query = session.createQuery("from org.hibernate.test.hql.StateProvince sp where sp.id in ( :idList )");
+ query.setParameterList( "idList" , createLotsOfElements() );
+ List list = query.list();
+ session.flush();
+ session.clear();
+ assertEquals( 1, list.size() );
+ session.delete(beijing);
+ t.commit();
+ session.close();
+
+ }
+
+ //HHH-1123
+ public void te2stLongInElementsByCriteria(){
+ Session session = openSession();
+ Transaction t = session.beginTransaction();
+
+ StateProvince beijing = new StateProvince();
+ beijing.setIsoCode("100089");
+ beijing.setName("beijing");
+ session.persist(beijing);
+ session.flush();
+ session.clear();
+
+ Criteria criteria = session.createCriteria(StateProvince.class);
+ criteria.add(Restrictions.in("id", createLotsOfElements()));
+ List list = criteria.list();
+ session.flush();
+ session.clear();
+ assertEquals( 1, list.size() );
+ session.delete(beijing);
+ t.commit();
+ session.close();
+
+ }
+
+ private List createLotsOfElements(){
+ List list = new ArrayList();
+ for ( int i = 0; i < ELEMENTS_SIZE; i++ ){
+ list.add(Long.valueOf(i));
+ }
+ return list;
+ }
+}
14 years, 11 months
Hibernate SVN: r18306 - in core/branches/Branch_3_3: testsuite/src/test/java/org/hibernate/test/criteria and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-21 12:07:30 -0500 (Mon, 21 Dec 2009)
New Revision: 18306
Added:
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/Animal.hbm.xml
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
Modified:
core/branches/Branch_3_3/core/src/main/java/org/hibernate/hql/ast/util/NodeTraverser.java
Log:
HHH-2166 Long 'in' lists in queries results in a Java stack overflow exception
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/hql/ast/util/NodeTraverser.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/hql/ast/util/NodeTraverser.java 2009-12-21 17:05:58 UTC (rev 18305)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/hql/ast/util/NodeTraverser.java 2009-12-21 17:07:30 UTC (rev 18306)
@@ -25,44 +25,132 @@
package org.hibernate.hql.ast.util;
import antlr.collections.AST;
+import java.util.Map;
+import java.util.HashMap;
/**
* A visitor for traversing an AST tree.
- *
+ *
* @author Steve Ebersole
+ * @author Philip R. "Pib" Burns.
+ *
*/
+
public class NodeTraverser {
public static interface VisitationStrategy {
- public void visit(AST node);
+ public void visit( AST node );
}
private final VisitationStrategy strategy;
- public NodeTraverser(VisitationStrategy strategy) {
+ public NodeTraverser( VisitationStrategy strategy ) {
this.strategy = strategy;
}
/**
* Traverse the AST tree depth first.
- * <p/>
- * Note that the AST passed in is not visited itself. Visitation starts
- * with its children.
- *
+ *
* @param ast
+ * Root node of subtree to traverse.
+ *
+ * <p>
+ * Note that the AST passed in is not visited itself. Visitation
+ * starts with its children.
+ * </p>
+ * <p>
+ * The current code for traverseDepthFirst uses iteration to walk
+ * the tree. This corrects stack overflow problems for constructs
+ * such as "x in (:x)" where ":x" specifies a large number of
+ * items.
+ * </p>
*/
- public void traverseDepthFirst(AST ast) {
+
+ public void traverseDepthFirst( AST ast ) {
+ // Root AST node cannot be null or
+ // traversal of its subtree is impossible.
if ( ast == null ) {
throw new IllegalArgumentException( "node to traverse cannot be null!" );
}
- visitDepthFirst( ast.getFirstChild() );
- }
+ // Map to hold parents of each
+ // AST node. Unfortunately the AST
+ // interface does not provide a method
+ // for finding the parent of a node, so
+ // we use the Map to save them.
- private void visitDepthFirst(AST ast) {
- if ( ast == null ) {
- return;
+ Map parentNodes = new HashMap();
+
+ // Start tree traversal with first child
+ // of the specified root AST node.
+
+ AST currentNode = ast.getFirstChild();
+
+ // Remember parent of first child.
+
+ parentNodes.put(currentNode, ast);
+
+ // Iterate through nodes, simulating
+ // recursive tree traversal, and add them
+ // to queue in proper order for later
+ // linear traversal. This "flattens" the
+ // into a linear list of nodes which can
+ // be visited non-recursively.
+
+ while ( currentNode != null ) {
+ // Visit the current node.
+
+ strategy.visit( currentNode );
+
+ // Move down to current node's first child
+ // if it exists.
+
+ AST childNode = currentNode.getFirstChild();
+
+ // If the child is not null, make it
+ // the current node.
+
+ if ( childNode != null ) {
+ // Remember parent of the child.
+
+ parentNodes.put( childNode, currentNode );
+
+ // Make child the current node.
+
+ currentNode = childNode;
+
+ continue;
+ }
+
+ while ( currentNode != null ) {
+ // Move to next sibling if any.
+
+ AST siblingNode = currentNode.getNextSibling();
+
+ if (siblingNode != null) {
+ // Get current node's parent.
+ // This is also the parent of the
+ // sibling node.
+
+ AST parentNode = (AST) parentNodes.get(currentNode);
+
+ // Remember parent of sibling.
+
+ parentNodes.put(siblingNode, parentNode);
+
+ // Make sibling the current node.
+
+ currentNode = siblingNode;
+
+ break;
+ }
+ // Move up to parent if no sibling.
+ // If parent is root node, we're done.
+
+ currentNode = (AST) parentNodes.get(currentNode);
+
+ if (currentNode.equals(ast)) {
+ currentNode = null;
+ }
+ }
}
- strategy.visit( ast );
- visitDepthFirst( ast.getFirstChild() );
- visitDepthFirst( ast.getNextSibling() );
}
}
Added: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/Animal.hbm.xml
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/Animal.hbm.xml (rev 0)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/Animal.hbm.xml 2009-12-21 17:07:30 UTC (rev 18306)
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+<hibernate-mapping
+ package="org.hibernate.test.hql">
+
+
+
+ <class name="StateProvince">
+ <id name="id">
+ <generator class="native"/>
+ </id>
+ <property name="name"/>
+ <property name="isoCode"/>
+ </class>
+
+
+</hibernate-mapping>
\ No newline at end of file
Added: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java (rev 0)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-21 17:07:30 UTC (rev 18306)
@@ -0,0 +1,111 @@
+/*
+ * 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.criteria;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.Criteria;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.criterion.Restrictions;
+import org.hibernate.junit.functional.FunctionalTestCase;
+import org.hibernate.test.hql.StateProvince;
+
+/**
+ *
+ * HHH-2166 Long "in" lists in queries results in a Java stack overflow exception.
+ *
+ * @author Strong Liu
+ */
+public class LongInElementsTest extends FunctionalTestCase {
+
+ private static final int ELEMENTS_SIZE = 4000;
+
+ public LongInElementsTest( String string ) {
+ super(string);
+ }
+
+ public String[] getMappings() {
+ return new String[] { "criteria/Animal.hbm.xml" };
+ }
+
+ //HHH-1123
+ public void testLongInElementsByHQL(){
+ Session session = openSession();
+ Transaction t = session.beginTransaction();
+
+ StateProvince beijing = new StateProvince();
+ beijing.setIsoCode("100089");
+ beijing.setName("beijing");
+ session.persist(beijing);
+ session.flush();
+ session.clear();
+
+ Query query = session.createQuery("from org.hibernate.test.hql.StateProvince sp where sp.id in ( :idList )");
+ query.setParameterList( "idList" , createLotsOfElements() );
+ List list = query.list();
+ session.flush();
+ session.clear();
+ assertEquals( 1, list.size() );
+ session.delete(beijing);
+ t.commit();
+ session.close();
+
+ }
+
+ //HHH-1123
+ public void te2stLongInElementsByCriteria(){
+ Session session = openSession();
+ Transaction t = session.beginTransaction();
+
+ StateProvince beijing = new StateProvince();
+ beijing.setIsoCode("100089");
+ beijing.setName("beijing");
+ session.persist(beijing);
+ session.flush();
+ session.clear();
+
+ Criteria criteria = session.createCriteria(StateProvince.class);
+ criteria.add(Restrictions.in("id", createLotsOfElements()));
+ List list = criteria.list();
+ session.flush();
+ session.clear();
+ assertEquals( 1, list.size() );
+ session.delete(beijing);
+ t.commit();
+ session.close();
+
+ }
+
+ private List createLotsOfElements(){
+ List list = new ArrayList();
+ for ( int i = 0; i < ELEMENTS_SIZE; i++ ){
+ list.add(Long.valueOf(i));
+ }
+ return list;
+ }
+}
14 years, 11 months
Hibernate SVN: r18305 - in core/trunk: testsuite/src/test/java/org/hibernate/test/criteria and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-21 12:05:58 -0500 (Mon, 21 Dec 2009)
New Revision: 18305
Added:
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Animal.hbm.xml
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
Modified:
core/trunk/core/src/main/java/org/hibernate/hql/ast/util/NodeTraverser.java
Log:
HHH-2166 Long 'in' lists in queries results in a Java stack overflow exception
Modified: core/trunk/core/src/main/java/org/hibernate/hql/ast/util/NodeTraverser.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/hql/ast/util/NodeTraverser.java 2009-12-21 17:02:33 UTC (rev 18304)
+++ core/trunk/core/src/main/java/org/hibernate/hql/ast/util/NodeTraverser.java 2009-12-21 17:05:58 UTC (rev 18305)
@@ -25,44 +25,132 @@
package org.hibernate.hql.ast.util;
import antlr.collections.AST;
+import java.util.Map;
+import java.util.HashMap;
/**
* A visitor for traversing an AST tree.
- *
+ *
* @author Steve Ebersole
+ * @author Philip R. "Pib" Burns.
+ *
*/
+
public class NodeTraverser {
public static interface VisitationStrategy {
- public void visit(AST node);
+ public void visit( AST node );
}
private final VisitationStrategy strategy;
- public NodeTraverser(VisitationStrategy strategy) {
+ public NodeTraverser( VisitationStrategy strategy ) {
this.strategy = strategy;
}
/**
* Traverse the AST tree depth first.
- * <p/>
- * Note that the AST passed in is not visited itself. Visitation starts
- * with its children.
- *
+ *
* @param ast
+ * Root node of subtree to traverse.
+ *
+ * <p>
+ * Note that the AST passed in is not visited itself. Visitation
+ * starts with its children.
+ * </p>
+ * <p>
+ * The current code for traverseDepthFirst uses iteration to walk
+ * the tree. This corrects stack overflow problems for constructs
+ * such as "x in (:x)" where ":x" specifies a large number of
+ * items.
+ * </p>
*/
- public void traverseDepthFirst(AST ast) {
+
+ public void traverseDepthFirst( AST ast ) {
+ // Root AST node cannot be null or
+ // traversal of its subtree is impossible.
if ( ast == null ) {
throw new IllegalArgumentException( "node to traverse cannot be null!" );
}
- visitDepthFirst( ast.getFirstChild() );
- }
+ // Map to hold parents of each
+ // AST node. Unfortunately the AST
+ // interface does not provide a method
+ // for finding the parent of a node, so
+ // we use the Map to save them.
- private void visitDepthFirst(AST ast) {
- if ( ast == null ) {
- return;
+ Map parentNodes = new HashMap();
+
+ // Start tree traversal with first child
+ // of the specified root AST node.
+
+ AST currentNode = ast.getFirstChild();
+
+ // Remember parent of first child.
+
+ parentNodes.put(currentNode, ast);
+
+ // Iterate through nodes, simulating
+ // recursive tree traversal, and add them
+ // to queue in proper order for later
+ // linear traversal. This "flattens" the
+ // into a linear list of nodes which can
+ // be visited non-recursively.
+
+ while ( currentNode != null ) {
+ // Visit the current node.
+
+ strategy.visit( currentNode );
+
+ // Move down to current node's first child
+ // if it exists.
+
+ AST childNode = currentNode.getFirstChild();
+
+ // If the child is not null, make it
+ // the current node.
+
+ if ( childNode != null ) {
+ // Remember parent of the child.
+
+ parentNodes.put( childNode, currentNode );
+
+ // Make child the current node.
+
+ currentNode = childNode;
+
+ continue;
+ }
+
+ while ( currentNode != null ) {
+ // Move to next sibling if any.
+
+ AST siblingNode = currentNode.getNextSibling();
+
+ if (siblingNode != null) {
+ // Get current node's parent.
+ // This is also the parent of the
+ // sibling node.
+
+ AST parentNode = (AST) parentNodes.get(currentNode);
+
+ // Remember parent of sibling.
+
+ parentNodes.put(siblingNode, parentNode);
+
+ // Make sibling the current node.
+
+ currentNode = siblingNode;
+
+ break;
+ }
+ // Move up to parent if no sibling.
+ // If parent is root node, we're done.
+
+ currentNode = (AST) parentNodes.get(currentNode);
+
+ if (currentNode.equals(ast)) {
+ currentNode = null;
+ }
+ }
}
- strategy.visit( ast );
- visitDepthFirst( ast.getFirstChild() );
- visitDepthFirst( ast.getNextSibling() );
}
}
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Animal.hbm.xml
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Animal.hbm.xml (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/Animal.hbm.xml 2009-12-21 17:05:58 UTC (rev 18305)
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+<hibernate-mapping
+ package="org.hibernate.test.hql">
+
+
+
+ <class name="StateProvince">
+ <id name="id">
+ <generator class="native"/>
+ </id>
+ <property name="name"/>
+ <property name="isoCode"/>
+ </class>
+
+
+</hibernate-mapping>
\ No newline at end of file
Added: core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java (rev 0)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-21 17:05:58 UTC (rev 18305)
@@ -0,0 +1,111 @@
+/*
+ * 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.criteria;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.Criteria;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.criterion.Restrictions;
+import org.hibernate.junit.functional.FunctionalTestCase;
+import org.hibernate.test.hql.StateProvince;
+
+/**
+ *
+ * HHH-2166 Long "in" lists in queries results in a Java stack overflow exception.
+ *
+ * @author Strong Liu
+ */
+public class LongInElementsTest extends FunctionalTestCase {
+
+ private static final int ELEMENTS_SIZE = 4000;
+
+ public LongInElementsTest( String string ) {
+ super(string);
+ }
+
+ public String[] getMappings() {
+ return new String[] { "criteria/Animal.hbm.xml" };
+ }
+
+ //HHH-1123
+ public void testLongInElementsByHQL(){
+ Session session = openSession();
+ Transaction t = session.beginTransaction();
+
+ StateProvince beijing = new StateProvince();
+ beijing.setIsoCode("100089");
+ beijing.setName("beijing");
+ session.persist(beijing);
+ session.flush();
+ session.clear();
+
+ Query query = session.createQuery("from org.hibernate.test.hql.StateProvince sp where sp.id in ( :idList )");
+ query.setParameterList( "idList" , createLotsOfElements() );
+ List list = query.list();
+ session.flush();
+ session.clear();
+ assertEquals( 1, list.size() );
+ session.delete(beijing);
+ t.commit();
+ session.close();
+
+ }
+
+ //HHH-1123
+ public void te2stLongInElementsByCriteria(){
+ Session session = openSession();
+ Transaction t = session.beginTransaction();
+
+ StateProvince beijing = new StateProvince();
+ beijing.setIsoCode("100089");
+ beijing.setName("beijing");
+ session.persist(beijing);
+ session.flush();
+ session.clear();
+
+ Criteria criteria = session.createCriteria(StateProvince.class);
+ criteria.add(Restrictions.in("id", createLotsOfElements()));
+ List list = criteria.list();
+ session.flush();
+ session.clear();
+ assertEquals( 1, list.size() );
+ session.delete(beijing);
+ t.commit();
+ session.close();
+
+ }
+
+ private List createLotsOfElements(){
+ List list = new ArrayList();
+ for ( int i = 0; i < ELEMENTS_SIZE; i++ ){
+ list.add(Long.valueOf(i));
+ }
+ return list;
+ }
+}
14 years, 11 months
Hibernate SVN: r18304 - in core/branches/Branch_3_3_2_GA_CP: testsuite/src/test/java/org/hibernate/test/criteria and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-21 12:02:33 -0500 (Mon, 21 Dec 2009)
New Revision: 18304
Added:
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/criteria/Animal.hbm.xml
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/hql/ast/util/NodeTraverser.java
Log:
JBPAPP-3089 HHH-2166 Long 'in' lists in queries results in a Java stack overflow exception.
Modified: core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/hql/ast/util/NodeTraverser.java
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/hql/ast/util/NodeTraverser.java 2009-12-21 16:17:24 UTC (rev 18303)
+++ core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/hql/ast/util/NodeTraverser.java 2009-12-21 17:02:33 UTC (rev 18304)
@@ -25,44 +25,132 @@
package org.hibernate.hql.ast.util;
import antlr.collections.AST;
+import java.util.Map;
+import java.util.HashMap;
/**
* A visitor for traversing an AST tree.
- *
+ *
* @author Steve Ebersole
+ * @author Philip R. "Pib" Burns.
+ *
*/
+
public class NodeTraverser {
public static interface VisitationStrategy {
- public void visit(AST node);
+ public void visit( AST node );
}
private final VisitationStrategy strategy;
- public NodeTraverser(VisitationStrategy strategy) {
+ public NodeTraverser( VisitationStrategy strategy ) {
this.strategy = strategy;
}
/**
* Traverse the AST tree depth first.
- * <p/>
- * Note that the AST passed in is not visited itself. Visitation starts
- * with its children.
- *
+ *
* @param ast
+ * Root node of subtree to traverse.
+ *
+ * <p>
+ * Note that the AST passed in is not visited itself. Visitation
+ * starts with its children.
+ * </p>
+ * <p>
+ * The current code for traverseDepthFirst uses iteration to walk
+ * the tree. This corrects stack overflow problems for constructs
+ * such as "x in (:x)" where ":x" specifies a large number of
+ * items.
+ * </p>
*/
- public void traverseDepthFirst(AST ast) {
+
+ public void traverseDepthFirst( AST ast ) {
+ // Root AST node cannot be null or
+ // traversal of its subtree is impossible.
if ( ast == null ) {
throw new IllegalArgumentException( "node to traverse cannot be null!" );
}
- visitDepthFirst( ast.getFirstChild() );
- }
+ // Map to hold parents of each
+ // AST node. Unfortunately the AST
+ // interface does not provide a method
+ // for finding the parent of a node, so
+ // we use the Map to save them.
- private void visitDepthFirst(AST ast) {
- if ( ast == null ) {
- return;
+ Map parentNodes = new HashMap();
+
+ // Start tree traversal with first child
+ // of the specified root AST node.
+
+ AST currentNode = ast.getFirstChild();
+
+ // Remember parent of first child.
+
+ parentNodes.put(currentNode, ast);
+
+ // Iterate through nodes, simulating
+ // recursive tree traversal, and add them
+ // to queue in proper order for later
+ // linear traversal. This "flattens" the
+ // into a linear list of nodes which can
+ // be visited non-recursively.
+
+ while ( currentNode != null ) {
+ // Visit the current node.
+
+ strategy.visit( currentNode );
+
+ // Move down to current node's first child
+ // if it exists.
+
+ AST childNode = currentNode.getFirstChild();
+
+ // If the child is not null, make it
+ // the current node.
+
+ if ( childNode != null ) {
+ // Remember parent of the child.
+
+ parentNodes.put( childNode, currentNode );
+
+ // Make child the current node.
+
+ currentNode = childNode;
+
+ continue;
+ }
+
+ while ( currentNode != null ) {
+ // Move to next sibling if any.
+
+ AST siblingNode = currentNode.getNextSibling();
+
+ if (siblingNode != null) {
+ // Get current node's parent.
+ // This is also the parent of the
+ // sibling node.
+
+ AST parentNode = (AST) parentNodes.get(currentNode);
+
+ // Remember parent of sibling.
+
+ parentNodes.put(siblingNode, parentNode);
+
+ // Make sibling the current node.
+
+ currentNode = siblingNode;
+
+ break;
+ }
+ // Move up to parent if no sibling.
+ // If parent is root node, we're done.
+
+ currentNode = (AST) parentNodes.get(currentNode);
+
+ if (currentNode.equals(ast)) {
+ currentNode = null;
+ }
+ }
}
- strategy.visit( ast );
- visitDepthFirst( ast.getFirstChild() );
- visitDepthFirst( ast.getNextSibling() );
}
}
Added: core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/criteria/Animal.hbm.xml
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/criteria/Animal.hbm.xml (rev 0)
+++ core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/criteria/Animal.hbm.xml 2009-12-21 17:02:33 UTC (rev 18304)
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+<hibernate-mapping
+ package="org.hibernate.test.hql">
+
+
+
+ <class name="StateProvince">
+ <id name="id">
+ <generator class="native"/>
+ </id>
+ <property name="name"/>
+ <property name="isoCode"/>
+ </class>
+
+
+</hibernate-mapping>
\ No newline at end of file
Added: core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java (rev 0)
+++ core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-21 17:02:33 UTC (rev 18304)
@@ -0,0 +1,111 @@
+/*
+ * 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.criteria;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.Criteria;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.criterion.Restrictions;
+import org.hibernate.junit.functional.FunctionalTestCase;
+import org.hibernate.test.hql.StateProvince;
+
+/**
+ *
+ * HHH-2166 Long "in" lists in queries results in a Java stack overflow exception.
+ *
+ * @author Strong Liu
+ */
+public class LongInElementsTest extends FunctionalTestCase {
+
+ private static final int ELEMENTS_SIZE = 4000;
+
+ public LongInElementsTest( String string ) {
+ super(string);
+ }
+
+ public String[] getMappings() {
+ return new String[] { "criteria/Animal.hbm.xml" };
+ }
+
+ //HHH-1123
+ public void testLongInElementsByHQL(){
+ Session session = openSession();
+ Transaction t = session.beginTransaction();
+
+ StateProvince beijing = new StateProvince();
+ beijing.setIsoCode("100089");
+ beijing.setName("beijing");
+ session.persist(beijing);
+ session.flush();
+ session.clear();
+
+ Query query = session.createQuery("from org.hibernate.test.hql.StateProvince sp where sp.id in ( :idList )");
+ query.setParameterList( "idList" , createLotsOfElements() );
+ List list = query.list();
+ session.flush();
+ session.clear();
+ assertEquals( 1, list.size() );
+ session.delete(beijing);
+ t.commit();
+ session.close();
+
+ }
+
+ //HHH-1123
+ public void te2stLongInElementsByCriteria(){
+ Session session = openSession();
+ Transaction t = session.beginTransaction();
+
+ StateProvince beijing = new StateProvince();
+ beijing.setIsoCode("100089");
+ beijing.setName("beijing");
+ session.persist(beijing);
+ session.flush();
+ session.clear();
+
+ Criteria criteria = session.createCriteria(StateProvince.class);
+ criteria.add(Restrictions.in("id", createLotsOfElements()));
+ List list = criteria.list();
+ session.flush();
+ session.clear();
+ assertEquals( 1, list.size() );
+ session.delete(beijing);
+ t.commit();
+ session.close();
+
+ }
+
+ private List createLotsOfElements(){
+ List list = new ArrayList();
+ for ( int i = 0; i < ELEMENTS_SIZE; i++ ){
+ list.add(Long.valueOf(i));
+ }
+ return list;
+ }
+}
14 years, 11 months
Hibernate SVN: r18303 - core/trunk/entitymanager.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-21 11:17:24 -0500 (Mon, 21 Dec 2009)
New Revision: 18303
Modified:
core/trunk/entitymanager/pom.xml
Log:
minor change, correct spell
Modified: core/trunk/entitymanager/pom.xml
===================================================================
--- core/trunk/entitymanager/pom.xml 2009-12-21 15:49:55 UTC (rev 18302)
+++ core/trunk/entitymanager/pom.xml 2009-12-21 16:17:24 UTC (rev 18303)
@@ -13,8 +13,8 @@
<artifactId>hibernate-entitymanager</artifactId>
<packaging>jar</packaging>
- <name>Hibernate Entitity Manager</name>
- <description>Hibernate Entitity Manager</description>
+ <name>Hibernate Entity Manager</name>
+ <description>Hibernate Entity Manager</description>
<dependencies>
<dependency>
14 years, 11 months
Hibernate SVN: r18302 - in core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test: util and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-12-21 10:49:55 -0500 (Mon, 21 Dec 2009)
New Revision: 18302
Added:
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/Book.java
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/GetIdentifierTest.java
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/Sickness.java
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/Umbrella.java
Log:
HHH-4665 add tests for getIdentifier()
Added: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/Book.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/Book.java (rev 0)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/Book.java 2009-12-21 15:49:55 UTC (rev 18302)
@@ -0,0 +1,32 @@
+package org.hibernate.ejb.test.util;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.GeneratedValue;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Entity
+public class Book {
+ private Long id;
+ private String name;
+
+ @Id
+ @GeneratedValue
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/GetIdentifierTest.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/GetIdentifierTest.java (rev 0)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/GetIdentifierTest.java 2009-12-21 15:49:55 UTC (rev 18302)
@@ -0,0 +1,62 @@
+package org.hibernate.ejb.test.util;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Persistence;
+
+import org.hibernate.ejb.test.TestCase;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class GetIdentifierTest extends TestCase {
+
+ public void testSimpleId() {
+ EntityManager em = factory.createEntityManager();
+ em.getTransaction().begin();
+ Book book = new Book();
+ em.persist( book );
+ em.flush();
+ assertEquals( book.getId(), em.getEntityManagerFactory().getPersistenceUnitUtil().getIdentifier( book ) );
+ em.getTransaction().rollback();
+ em.close();
+ }
+
+ public void testEmbeddedId() {
+ EntityManager em = factory.createEntityManager();
+ em.getTransaction().begin();
+ Umbrella umbrella = new Umbrella();
+ umbrella.setId( new Umbrella.PK() );
+ umbrella.getId().setBrand( "Burberry" );
+ umbrella.getId().setModel( "Red Hat" );
+ em.persist( umbrella );
+ em.flush();
+ assertEquals( umbrella.getId(), em.getEntityManagerFactory().getPersistenceUnitUtil().getIdentifier( umbrella ) );
+ em.getTransaction().rollback();
+ em.close();
+ }
+
+ public void testIdClass() {
+ EntityManager em = factory.createEntityManager();
+ em.getTransaction().begin();
+ Sickness sick = new Sickness();
+
+ sick.setClassification( "H1N1" );
+ sick.setType("Flu");
+ em.persist( sick );
+ em.flush();
+ Sickness.PK id = new Sickness.PK();
+ id.setClassification( sick.getClassification() );
+ id.setType( sick.getType() );
+ assertEquals( id, em.getEntityManagerFactory().getPersistenceUnitUtil().getIdentifier( sick ) );
+ em.getTransaction().rollback();
+ em.close();
+ }
+
+ public Class[] getAnnotatedClasses() {
+ return new Class[] {
+ Book.class,
+ Umbrella.class,
+ Sickness.class
+ };
+ }
+}
Added: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/Sickness.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/Sickness.java (rev 0)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/Sickness.java 2009-12-21 15:49:55 UTC (rev 18302)
@@ -0,0 +1,96 @@
+package org.hibernate.ejb.test.util;
+
+import java.util.Date;
+import java.io.Serializable;
+import javax.persistence.Entity;
+import javax.persistence.Temporal;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Entity
+(a)IdClass(Sickness.PK.class)
+public class Sickness {
+ private Date beginTime;
+ private String type;
+ private String classification;
+
+ @Id
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ @Id
+ public String getClassification() {
+ return classification;
+ }
+
+ public void setClassification(String classification) {
+ this.classification = classification;
+ }
+
+
+ @Temporal(javax.persistence.TemporalType.DATE)
+ public Date getBeginTime() {
+ return beginTime;
+ }
+
+ public void setBeginTime(Date beginTime) {
+ this.beginTime = beginTime;
+ }
+
+ public static class PK implements Serializable {
+ private String type;
+ private String classification;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getClassification() {
+ return classification;
+ }
+
+ public void setClassification(String classification) {
+ this.classification = classification;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if ( this == o ) {
+ return true;
+ }
+ if ( o == null || getClass() != o.getClass() ) {
+ return false;
+ }
+
+ PK pk = ( PK ) o;
+
+ if ( classification != null ? !classification.equals( pk.classification ) : pk.classification != null ) {
+ return false;
+ }
+ if ( type != null ? !type.equals( pk.type ) : pk.type != null ) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = type != null ? type.hashCode() : 0;
+ result = 31 * result + ( classification != null ? classification.hashCode() : 0 );
+ return result;
+ }
+ }
+}
Added: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/Umbrella.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/Umbrella.java (rev 0)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/Umbrella.java 2009-12-21 15:49:55 UTC (rev 18302)
@@ -0,0 +1,81 @@
+package org.hibernate.ejb.test.util;
+
+import java.io.Serializable;
+import javax.persistence.Entity;
+import javax.persistence.EmbeddedId;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Entity
+public class Umbrella {
+ private PK id;
+
+ private int size;
+
+ @EmbeddedId
+ public PK getId() {
+ return id;
+ }
+
+ public void setId(PK id) {
+ this.id = id;
+ }
+
+ public int getSize() {
+ return size;
+ }
+
+ public void setSize(int size) {
+ this.size = size;
+ }
+
+ public static class PK implements Serializable {
+ private String model;
+ private String brand;
+
+ public String getModel() {
+ return model;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ public String getBrand() {
+ return brand;
+ }
+
+ public void setBrand(String brand) {
+ this.brand = brand;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if ( this == o ) {
+ return true;
+ }
+ if ( o == null || getClass() != o.getClass() ) {
+ return false;
+ }
+
+ PK pk = ( PK ) o;
+
+ if ( brand != null ? !brand.equals( pk.brand ) : pk.brand != null ) {
+ return false;
+ }
+ if ( model != null ? !model.equals( pk.model ) : pk.model != null ) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = model != null ? model.hashCode() : 0;
+ result = 31 * result + ( brand != null ? brand.hashCode() : 0 );
+ return result;
+ }
+ }
+}
14 years, 11 months
Hibernate SVN: r18301 - in search/trunk/src: main/java/org/hibernate/search/cfg and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-12-21 10:12:12 -0500 (Mon, 21 Dec 2009)
New Revision: 18301
Removed:
search/trunk/src/main/java/org/hibernate/search/cfg/DynamicEntityBoostMapping.java
search/trunk/src/main/java/org/hibernate/search/cfg/DynamicFieldBoostMapping.java
Modified:
search/trunk/src/main/docbook/en-US/modules/mapping.xml
search/trunk/src/main/java/org/hibernate/search/cfg/EntityDescriptor.java
search/trunk/src/main/java/org/hibernate/search/cfg/EntityMapping.java
search/trunk/src/main/java/org/hibernate/search/cfg/FieldMapping.java
search/trunk/src/main/java/org/hibernate/search/cfg/IndexedMapping.java
search/trunk/src/main/java/org/hibernate/search/cfg/PropertyDescriptor.java
search/trunk/src/main/java/org/hibernate/search/cfg/PropertyMapping.java
search/trunk/src/main/java/org/hibernate/search/impl/MappingModelMetadataProvider.java
search/trunk/src/test/java/org/hibernate/search/test/configuration/ProgrammaticSearchMappingFactory.java
Log:
HSEARCH-411 improve dynamicboost mapping
Modified: search/trunk/src/main/docbook/en-US/modules/mapping.xml
===================================================================
--- search/trunk/src/main/docbook/en-US/modules/mapping.xml 2009-12-21 13:58:50 UTC (rev 18300)
+++ search/trunk/src/main/docbook/en-US/modules/mapping.xml 2009-12-21 15:12:12 UTC (rev 18301)
@@ -2236,9 +2236,9 @@
.property("libraryId", ElementType.FIELD)
.documentId().name("id")
.property("name", ElementType.FIELD)
+ <emphasis>.dynamicBoost(CustomFieldBoostStrategy.class)</emphasis>;
.field()
.store(Store.YES)
- <emphasis>.dynamicBoost(CustomFieldBoostStrategy.class)</emphasis>;
cfg.getProperties().put( "hibernate.search.model_mapping", mapping );</programlisting>
Deleted: search/trunk/src/main/java/org/hibernate/search/cfg/DynamicEntityBoostMapping.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/cfg/DynamicEntityBoostMapping.java 2009-12-21 13:58:50 UTC (rev 18300)
+++ search/trunk/src/main/java/org/hibernate/search/cfg/DynamicEntityBoostMapping.java 2009-12-21 15:12:12 UTC (rev 18301)
@@ -1,47 +0,0 @@
-package org.hibernate.search.cfg;
-
-import java.lang.annotation.ElementType;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.solr.analysis.TokenizerFactory;
-import org.hibernate.search.engine.BoostStrategy;
-
-public class DynamicEntityBoostMapping {
-
- private final SearchMapping mapping;
- private final Map<String,Object> dynamicEntityBoost;
- private final EntityDescriptor entity;
- private final EntityMapping entityMapping;
-
- public DynamicEntityBoostMapping(SearchMapping mapping, Class<? extends BoostStrategy> impl, EntityDescriptor entity, EntityMapping entityMapping) {
- this.mapping = mapping;
- this.entity = entity;
- this.entityMapping = entityMapping;
- this.dynamicEntityBoost = new HashMap<String, Object>();
- this.entity.setDynamicEntityBoost(dynamicEntityBoost);
- this.dynamicEntityBoost.put("impl", impl);
-
- }
-
- public FullTextFilterDefMapping fullTextFilterDef(String name, Class<?> impl) {
- return new FullTextFilterDefMapping(mapping,name, impl);
- }
-
- public PropertyMapping property(String name, ElementType type) {
- return new PropertyMapping(name, type, entity, mapping);
- }
-
- public AnalyzerDefMapping analyzerDef(String name, Class<? extends TokenizerFactory> tokenizerFactory) {
- return new AnalyzerDefMapping(name, tokenizerFactory, mapping);
- }
-
- public EntityMapping entity(Class<?> entityType) {
- return new EntityMapping(entityType, mapping);
- }
-
- public ClassBridgeMapping classBridge(Class<?> impl) {
- return new ClassBridgeMapping(mapping, entity, impl, entityMapping);
- }
-
-}
Deleted: search/trunk/src/main/java/org/hibernate/search/cfg/DynamicFieldBoostMapping.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/cfg/DynamicFieldBoostMapping.java 2009-12-21 13:58:50 UTC (rev 18300)
+++ search/trunk/src/main/java/org/hibernate/search/cfg/DynamicFieldBoostMapping.java 2009-12-21 15:12:12 UTC (rev 18301)
@@ -1,59 +0,0 @@
-package org.hibernate.search.cfg;
-
-import java.lang.annotation.ElementType;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.solr.analysis.TokenizerFactory;
-import org.hibernate.search.annotations.Resolution;
-import org.hibernate.search.engine.BoostStrategy;
-
-public class DynamicFieldBoostMapping {
-
- private final SearchMapping mapping;
- private final EntityDescriptor entity;
- private final Map<String,Object> dynamicFieldBoost;
- private final PropertyDescriptor property;
-
- public DynamicFieldBoostMapping(SearchMapping mapping, Class<? extends BoostStrategy> impl, PropertyDescriptor property, EntityDescriptor entity) {
- this.mapping = mapping;
- this.property = property;
- this.entity = entity;
- dynamicFieldBoost = new HashMap<String, Object>();
- this.property.setDynamicFieldBoost(dynamicFieldBoost);
- dynamicFieldBoost.put("impl", impl);
- }
-
- public FieldMapping field() {
- return new FieldMapping(property, entity, mapping);
- }
-
- public PropertyMapping property(String name, ElementType type) {
- return new PropertyMapping(name, type, entity, mapping);
- }
-
- public DateBridgeMapping dateBridge(Resolution resolution) {
- return new DateBridgeMapping(mapping, entity, property, resolution);
- }
-
- public AnalyzerDefMapping analyzerDef(String name, Class<? extends TokenizerFactory> tokenizerFactory) {
- return new AnalyzerDefMapping(name, tokenizerFactory, mapping);
- }
-
- public EntityMapping entity(Class<?> entityType) {
- return new EntityMapping(entityType, mapping);
- }
-
- public CalendarBridgeMapping calendarBridge(Resolution resolution) {
- return new CalendarBridgeMapping(mapping,entity,property, resolution);
- }
-
- public IndexEmbeddedMapping indexEmbedded() {
- return new IndexEmbeddedMapping(mapping,property,entity);
- }
-
- public ContainedInMapping containedIn() {
- return new ContainedInMapping(mapping, property, entity);
- }
-
-}
Modified: search/trunk/src/main/java/org/hibernate/search/cfg/EntityDescriptor.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/cfg/EntityDescriptor.java 2009-12-21 13:58:50 UTC (rev 18300)
+++ search/trunk/src/main/java/org/hibernate/search/cfg/EntityDescriptor.java 2009-12-21 15:12:12 UTC (rev 18301)
@@ -43,7 +43,7 @@
private Set<Map<String, Object>> fullTextFilterDefs = new HashSet<Map<String, Object>>();
private Map<String,Object> providedId;
private Set<Map<String,Object>> classBridges = new HashSet<Map<String,Object>>();
- private Map<String, Object> dynamicEntityBoost;
+ private Map<String, Object> dynamicBoost;
public Map<String, Object> getIndexed() {
return indexed;
@@ -120,12 +120,12 @@
return this.providedId;
}
- public void setDynamicEntityBoost(Map<String, Object> dynamicEntityBoost) {
- this.dynamicEntityBoost = dynamicEntityBoost;
+ public void setDynamicBoost(Map<String, Object> dynamicEntityBoost) {
+ this.dynamicBoost = dynamicEntityBoost;
}
- public Map<String, Object> getDynamicEntityBoost() {
- return this.dynamicEntityBoost;
+ public Map<String, Object> getDynamicBoost() {
+ return this.dynamicBoost;
}
private static class PropertyKey {
Modified: search/trunk/src/main/java/org/hibernate/search/cfg/EntityMapping.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/cfg/EntityMapping.java 2009-12-21 13:58:50 UTC (rev 18300)
+++ search/trunk/src/main/java/org/hibernate/search/cfg/EntityMapping.java 2009-12-21 15:12:12 UTC (rev 18301)
@@ -62,6 +62,14 @@
return this;
}
+
+ public EntityMapping dynamicBoost(Class<? extends BoostStrategy> impl) {
+ final Map<String, Object> dynamicBoost = new HashMap<String, Object>();
+ dynamicBoost.put("impl", impl);
+ entity.setDynamicBoost(dynamicBoost);
+ return this;
+ }
+
public EntityMapping analyzerDiscriminator(Class<? extends Discriminator> discriminator) {
final Map<String, Object> discriminatorAnn = new HashMap<String, Object>();
discriminatorAnn.put( "impl", discriminator );
Modified: search/trunk/src/main/java/org/hibernate/search/cfg/FieldMapping.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/cfg/FieldMapping.java 2009-12-21 13:58:50 UTC (rev 18300)
+++ search/trunk/src/main/java/org/hibernate/search/cfg/FieldMapping.java 2009-12-21 15:12:12 UTC (rev 18301)
@@ -77,6 +77,7 @@
field.put( "boost", boostAnn );
return this;
}
+
public FieldBridgeMapping bridge(Class<?> impl) {
return new FieldBridgeMapping( impl, field, this, property, entity, mapping );
@@ -120,8 +121,4 @@
return new CalendarBridgeMapping(mapping,entity,property, resolution);
}
- public DynamicFieldBoostMapping dynamicBoost(Class<? extends BoostStrategy> impl) {
- return new DynamicFieldBoostMapping(mapping, impl, property, entity);
- }
-
}
Modified: search/trunk/src/main/java/org/hibernate/search/cfg/IndexedMapping.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/cfg/IndexedMapping.java 2009-12-21 13:58:50 UTC (rev 18300)
+++ search/trunk/src/main/java/org/hibernate/search/cfg/IndexedMapping.java 2009-12-21 15:12:12 UTC (rev 18301)
@@ -30,7 +30,6 @@
import org.apache.solr.analysis.TokenizerFactory;
import org.hibernate.search.analyzer.Discriminator;
-import org.hibernate.search.engine.BoostStrategy;
public class IndexedMapping {
@@ -93,9 +92,5 @@
public ProvidedIdMapping providedId() {
return new ProvidedIdMapping(mapping,entity);
}
-
- public DynamicEntityBoostMapping dynamicBoost(Class<? extends BoostStrategy> impl) {
- return new DynamicEntityBoostMapping(mapping, impl, entity, entityMapping);
- }
}
Modified: search/trunk/src/main/java/org/hibernate/search/cfg/PropertyDescriptor.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/cfg/PropertyDescriptor.java 2009-12-21 13:58:50 UTC (rev 18300)
+++ search/trunk/src/main/java/org/hibernate/search/cfg/PropertyDescriptor.java 2009-12-21 15:12:12 UTC (rev 18301)
@@ -44,7 +44,7 @@
private Map<String, Object> documentId;
private Map<String, Object> analyzerDiscriminator;
- private Map<String, Object> dynamicFieldBoost;
+ private Map<String, Object> dynamicBoost;
public PropertyDescriptor(String name, ElementType type) {
this.name = name;
@@ -106,12 +106,11 @@
this.containedIn = containedIn;
}
- public void setDynamicFieldBoost(Map<String, Object> dynamicFieldBoost) {
- this.dynamicFieldBoost = dynamicFieldBoost;
+ public void setDynamicBoost(Map<String, Object> dynamicBoostAnn) {
+ this.dynamicBoost = dynamicBoostAnn;
}
- public Map<String,Object> getDynamicFieldBoost() {
- return this.dynamicFieldBoost;
+ public Map<String,Object> getDynamicBoost() {
+ return this.dynamicBoost;
}
-
}
Modified: search/trunk/src/main/java/org/hibernate/search/cfg/PropertyMapping.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/cfg/PropertyMapping.java 2009-12-21 13:58:50 UTC (rev 18300)
+++ search/trunk/src/main/java/org/hibernate/search/cfg/PropertyMapping.java 2009-12-21 15:12:12 UTC (rev 18301)
@@ -32,6 +32,7 @@
import org.hibernate.search.analyzer.Discriminator;
import org.hibernate.search.annotations.Resolution;
+import org.hibernate.search.engine.BoostStrategy;
/**
* @author Emmanuel Bernard
@@ -69,6 +70,13 @@
property.setAnalyzerDiscriminator(analyzerDiscriminatorAnn);
return this;
}
+
+ public PropertyMapping dynamicBoost(Class<? extends BoostStrategy> impl) {
+ final Map<String, Object> dynamicBoostAnn = new HashMap<String, Object>();
+ dynamicBoostAnn.put("impl", impl);
+ property.setDynamicBoost(dynamicBoostAnn);
+ return this;
+ }
public PropertyMapping property(String name, ElementType type) {
return new PropertyMapping(name, type, entity, mapping);
Modified: search/trunk/src/main/java/org/hibernate/search/impl/MappingModelMetadataProvider.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/impl/MappingModelMetadataProvider.java 2009-12-21 13:58:50 UTC (rev 18300)
+++ search/trunk/src/main/java/org/hibernate/search/impl/MappingModelMetadataProvider.java 2009-12-21 15:12:12 UTC (rev 18301)
@@ -316,16 +316,6 @@
}
}
- private void createDynamicFieldBoost(PropertyDescriptor property) {
- if (property.getDynamicFieldBoost() != null) {
- AnnotationDescriptor dynamicBoostAnn = new AnnotationDescriptor( DynamicBoost.class );
- Set<Entry<String,Object>> entrySet = property.getDynamicFieldBoost().entrySet();
- for (Entry<String, Object> entry : entrySet) {
- dynamicBoostAnn.setValue(entry.getKey(), entry.getValue());
- }
- annotations.put(DynamicBoost.class, AnnotationFactory.create( dynamicBoostAnn ));
- }
- }
private void createDateBridge(PropertyDescriptor property) {
Map<String, Object> map = property.getDateBridge();
@@ -367,6 +357,7 @@
}
}
+
private void createFields(PropertyDescriptor property) {
final Collection<Map<String,Object>> fields = property.getFields();
List<org.hibernate.search.annotations.Field> fieldAnnotations =
@@ -405,7 +396,7 @@
}
}
fieldAnnotation.setValue( "bridge", AnnotationFactory.create( bridgeAnnotation ) );
- }
+ }
else {
fieldAnnotation.setValue( entry.getKey(), entry.getValue() );
}
@@ -422,10 +413,20 @@
annotations.put( Fields.class, AnnotationFactory.create( fieldsAnnotation ) );
createDateBridge(property);
createCalendarBridge(property);
- createDynamicFieldBoost(property);
+ createDynamicBoost(property);
+
}
-
+ private void createDynamicBoost(PropertyDescriptor property) {
+ if (property.getDynamicBoost() != null) {
+ AnnotationDescriptor dynamicBoostAnn = new AnnotationDescriptor( DynamicBoost.class );
+ Set<Entry<String,Object>> entrySet = property.getDynamicBoost().entrySet();
+ for (Entry<String, Object> entry : entrySet) {
+ dynamicBoostAnn.setValue(entry.getKey(), entry.getValue());
+ }
+ annotations.put(DynamicBoost.class, AnnotationFactory.create( dynamicBoostAnn ));
+ }
+ }
private void createContainedIn(PropertyDescriptor property) {
if (property.getContainedIn() != null) {
Map<String, Object> containedIn = property.getContainedIn();
@@ -500,9 +501,9 @@
annotations.put(ClassBridges.class, AnnotationFactory.create( classBridgesAnn ));
}
- if (entity.getDynamicEntityBoost() != null) {
+ if (entity.getDynamicBoost() != null) {
AnnotationDescriptor dynamicBoostAnn = new AnnotationDescriptor( DynamicBoost.class );
- Set<Entry<String,Object>> entrySet = entity.getDynamicEntityBoost().entrySet();
+ Set<Entry<String,Object>> entrySet = entity.getDynamicBoost().entrySet();
for (Entry<String, Object> entry : entrySet) {
dynamicBoostAnn.setValue(entry.getKey(), entry.getValue());
}
Modified: search/trunk/src/test/java/org/hibernate/search/test/configuration/ProgrammaticSearchMappingFactory.java
===================================================================
--- search/trunk/src/test/java/org/hibernate/search/test/configuration/ProgrammaticSearchMappingFactory.java 2009-12-21 13:58:50 UTC (rev 18300)
+++ search/trunk/src/test/java/org/hibernate/search/test/configuration/ProgrammaticSearchMappingFactory.java 2009-12-21 15:12:12 UTC (rev 18301)
@@ -80,13 +80,13 @@
.property("productCatalog", ElementType.FIELD)
.containedIn()
.entity(DynamicBoostedDescLibrary.class)
+ .dynamicBoost(CustomBoostStrategy.class)
.indexed()
- .dynamicBoost(CustomBoostStrategy.class)
.property("libraryId", ElementType.FIELD)
.documentId().name("id")
.property("name", ElementType.FIELD)
+ .dynamicBoost(CustomFieldBoostStrategy.class)
.field().store(Store.YES)
- .dynamicBoost(CustomFieldBoostStrategy.class)
.entity(Departments.class)
.classBridge(CatDeptsFieldsClassBridge.class)
.name("branchnetwork")
14 years, 11 months
Hibernate SVN: r18300 - in core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria: tuple and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-12-21 08:58:50 -0500 (Mon, 21 Dec 2009)
New Revision: 18300
Added:
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria/tuple/
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria/tuple/Customer.java
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria/tuple/TupleCriteriaTest.java
Log:
HHH-4724 add tests on Tuple
Added: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria/tuple/Customer.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria/tuple/Customer.java (rev 0)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria/tuple/Customer.java 2009-12-21 13:58:50 UTC (rev 18300)
@@ -0,0 +1,43 @@
+package org.hibernate.ejb.criteria.tuple;
+
+import javax.persistence.Table;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.GeneratedValue;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Entity
+@Table(name="tup_cust")
+public class Customer {
+ private Long id;
+ private String name;
+ private Integer age;
+
+ @Id
+ @GeneratedValue
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Integer getAge() {
+ return age;
+ }
+
+ public void setAge(Integer age) {
+ this.age = age;
+ }
+}
Added: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria/tuple/TupleCriteriaTest.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria/tuple/TupleCriteriaTest.java (rev 0)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/criteria/tuple/TupleCriteriaTest.java 2009-12-21 13:58:50 UTC (rev 18300)
@@ -0,0 +1,74 @@
+package org.hibernate.ejb.criteria.tuple;
+
+import java.util.List;
+import javax.persistence.EntityManager;
+import javax.persistence.Tuple;
+import javax.persistence.TupleElement;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.Root;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Path;
+
+import org.hibernate.ejb.test.TestCase;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class TupleCriteriaTest extends TestCase {
+ public void testArray() {
+ EntityManager em = factory.createEntityManager();
+ Customer c1 = new Customer();
+ c1.setAge( 18 );
+ c1.setName( "Bob" );
+ em.getTransaction().begin();
+ em.persist( c1 );
+ em.flush();
+
+ final CriteriaBuilder cb = em.getCriteriaBuilder();
+ CriteriaQuery<Object[]> q = cb.createQuery(Object[].class);
+ Root<Customer> c = q.from(Customer.class);
+ q.select( cb.array( c.get(Customer_.name), c.get(Customer_.age) ) );
+ List<Object[]> result = em.createQuery(q).getResultList();
+
+ assertEquals( 1, result.size() );
+ assertEquals( c1.getName(), result.get( 0 )[0] );
+ assertEquals( c1.getAge(), result.get( 0 )[1] );
+
+ em.getTransaction().rollback();
+ em.close();
+ }
+
+
+ public void testTuple() {
+ EntityManager em = factory.createEntityManager();
+ Customer c1 = new Customer();
+ c1.setAge( 18 );
+ c1.setName( "Bob" );
+ em.getTransaction().begin();
+ em.persist( c1 );
+ em.flush();
+
+ final CriteriaBuilder cb = em.getCriteriaBuilder();
+
+ CriteriaQuery<Tuple> q = cb.createTupleQuery();
+ Root<Customer> c = q.from(Customer.class);
+ Path<String> tname = c.get(Customer_.name);
+ q.multiselect( tname, c.get(Customer_.age).alias("age") );
+ List<Tuple> result = em.createQuery(q).getResultList();
+
+ assertEquals( 1, result.size() );
+ //FIXME uncomment when HHH-4724 is fixed
+// assertEquals( c1.getName(), result.get(0).get(tname) );
+// assertEquals( c1.getAge(), result.get(0).get("age") );
+
+
+ em.getTransaction().rollback();
+ em.close();
+ }
+
+ public Class[] getAnnotatedClasses() {
+ return new Class[] {
+ Customer.class
+ };
+ }
+}
14 years, 11 months
Hibernate SVN: r18299 - annotations/branches/v3_4_0_GA_CP.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-21 03:12:59 -0500 (Mon, 21 Dec 2009)
New Revision: 18299
Modified:
annotations/branches/v3_4_0_GA_CP/pom.xml
Log:
JBPAPP-3218 update db profile in hibernate eap 5 cp branch
Modified: annotations/branches/v3_4_0_GA_CP/pom.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP/pom.xml 2009-12-21 08:10:30 UTC (rev 18298)
+++ annotations/branches/v3_4_0_GA_CP/pom.xml 2009-12-21 08:12:59 UTC (rev 18299)
@@ -758,7 +758,8 @@
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>msjdbc</artifactId>
- <version>2.0.1008.2-4</version>
+ <version>2.0.1008.2</version>
+ <classifier>4</classifier>
<scope>test</scope>
</dependency>
</dependencies>
@@ -775,4 +776,4 @@
<properties>
<slf4jVersion>1.5.8</slf4jVersion>
</properties>
-</project>
\ No newline at end of file
+</project>
14 years, 12 months
Hibernate SVN: r18298 - search/branches/v3_1_1_GA_CP.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-21 03:10:30 -0500 (Mon, 21 Dec 2009)
New Revision: 18298
Modified:
search/branches/v3_1_1_GA_CP/pom.xml
Log:
JBPAPP-3218 update db profile in hibernate eap 5 cp branch
Modified: search/branches/v3_1_1_GA_CP/pom.xml
===================================================================
--- search/branches/v3_1_1_GA_CP/pom.xml 2009-12-21 08:10:09 UTC (rev 18297)
+++ search/branches/v3_1_1_GA_CP/pom.xml 2009-12-21 08:10:30 UTC (rev 18298)
@@ -680,6 +680,7 @@
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>msjdbc</artifactId>
<version>2.0.1008.2</version>
+ <classifier>4</classifier>
<scope>test</scope>
</dependency>
</dependencies>
14 years, 12 months