Hibernate SVN: r17528 - in annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations: manytoone and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-09-19 15:24:40 -0400 (Sat, 19 Sep 2009)
New Revision: 17528
Modified:
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytomany/Company.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytomany/Group.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytomany/GroupWithSet.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/Frame.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/ManyToOneTest.java
annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/Order.java
Log:
JBPAPP-1075 Annotations - Oracle/Sybase - Unique/Primary Key declared twice raises an error
Modified: annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytomany/Company.java
===================================================================
--- annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytomany/Company.java 2009-09-18 09:06:47 UTC (rev 17527)
+++ annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytomany/Company.java 2009-09-19 19:24:40 UTC (rev 17528)
@@ -10,7 +10,7 @@
*/
@MappedSuperclass
public class Company implements Serializable {
- @Column(unique = true) private String name;
+ @Column private String name;
public String getName() {
return name;
Modified: annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytomany/Group.java
===================================================================
--- annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytomany/Group.java 2009-09-18 09:06:47 UTC (rev 17527)
+++ annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytomany/Group.java 2009-09-19 19:24:40 UTC (rev 17528)
@@ -5,12 +5,9 @@
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
-import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.Where;
import org.hibernate.annotations.FilterDef;
@@ -38,11 +35,6 @@
}
@ManyToMany(cascade = CascadeType.PERSIST)
- @JoinTable(name = "GROUPS_PERMISSIONS",
- uniqueConstraints = @UniqueConstraint(columnNames = {"group_id", "permission"}),
- joinColumns = @JoinColumn(name = "group_id", referencedColumnName = "id"),
- inverseJoinColumns = @JoinColumn(name = "permission", referencedColumnName = "permission")
- )
@OrderBy("expirationDate")
@Where(clause = "1=1")
@WhereJoinTable(clause = "2=2")
Modified: annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytomany/GroupWithSet.java
===================================================================
--- annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytomany/GroupWithSet.java 2009-09-18 09:06:47 UTC (rev 17527)
+++ annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytomany/GroupWithSet.java 2009-09-19 19:24:40 UTC (rev 17528)
@@ -40,11 +40,6 @@
}
@ManyToMany(cascade = CascadeType.PERSIST)
- @JoinTable(name = "GROUPS_PERMISSIONS",
- uniqueConstraints = @UniqueConstraint(columnNames = {"group_id", "permission"}),
- joinColumns = @JoinColumn(name = "group_id", referencedColumnName = "id"),
- inverseJoinColumns = @JoinColumn(name = "permission", referencedColumnName = "permission")
- )
@OrderBy("expirationDate")
@Where(clause = "1=1")
@WhereJoinTable(clause = "2=2")
Modified: annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/Frame.java
===================================================================
--- annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/Frame.java 2009-09-18 09:06:47 UTC (rev 17527)
+++ annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/Frame.java 2009-09-19 19:24:40 UTC (rev 17528)
@@ -21,7 +21,6 @@
private Long id;
@OneToMany( mappedBy = "frame" )
private Set<Lens> lenses;
- @Column( unique = true )
private String name;
@Formula("lower(name)")
private String lowerName;
Modified: annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/ManyToOneTest.java
===================================================================
--- annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/ManyToOneTest.java 2009-09-18 09:06:47 UTC (rev 17527)
+++ annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/ManyToOneTest.java 2009-09-19 19:24:40 UTC (rev 17528)
@@ -249,10 +249,6 @@
s.close();
}
- public void testManyToOneAndIdClass() throws Exception {
-
- }
-
public void testManyToOneNonPk() throws Exception {
Session s = openSession();
Transaction tx = s.beginTransaction();
Modified: annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/Order.java
===================================================================
--- annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/Order.java 2009-09-18 09:06:47 UTC (rev 17527)
+++ annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/manytoone/Order.java 2009-09-19 19:24:40 UTC (rev 17528)
@@ -30,7 +30,7 @@
this.id = id;
}
- @Column(name="order_nbr", unique = true)
+ @Column(name="order_nbr")
public String getOrderNbr() {
return orderNbr;
}
16 years
Thank you for setting the order No.475456
by Karina Inman
Dear Customer!
Thank you for ordering at our online store.
Your order: Sony VAIO A1133651A, was sent at your address.
The tracking number of your postal parcel is indicated in the document attached to this letter.
Please, print out the postal label for receiving the parcel.
Internet Store.
16 years
Hibernate SVN: r17527 - core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytomany.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-18 05:06:47 -0400 (Fri, 18 Sep 2009)
New Revision: 17527
Modified:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytomany/Company.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytomany/Group.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytomany/GroupWithSet.java
Log:
JBPAPP-1075 - Removed the @JoinColumn mappings. Thought not wrong per se they cause some wrong table creation scripts. Removing them circumvents this problem without affecting the test.
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytomany/Company.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytomany/Company.java 2009-09-17 21:26:25 UTC (rev 17526)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytomany/Company.java 2009-09-18 09:06:47 UTC (rev 17527)
@@ -10,7 +10,8 @@
*/
@MappedSuperclass
public class Company implements Serializable {
- @Column(unique = true) private String name;
+ @Column
+ private String name;
public String getName() {
return name;
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytomany/Group.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytomany/Group.java 2009-09-17 21:26:25 UTC (rev 17526)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytomany/Group.java 2009-09-18 09:06:47 UTC (rev 17527)
@@ -5,17 +5,14 @@
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
-import javax.persistence.UniqueConstraint;
-import org.hibernate.annotations.Where;
-import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.Filter;
+import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.FilterJoinTable;
+import org.hibernate.annotations.Where;
import org.hibernate.annotations.WhereJoinTable;
/**
@@ -38,10 +35,6 @@
}
@ManyToMany(cascade = CascadeType.PERSIST)
- @JoinTable(name = "GROUPS_PERMISSIONS",
- joinColumns = @JoinColumn(name = "group_id", referencedColumnName = "id"),
- inverseJoinColumns = @JoinColumn(name = "permission", referencedColumnName = "permission")
- )
@OrderBy("expirationDate")
@Where(clause = "1=1")
@WhereJoinTable(clause = "2=2")
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytomany/GroupWithSet.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytomany/GroupWithSet.java 2009-09-17 21:26:25 UTC (rev 17526)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytomany/GroupWithSet.java 2009-09-18 09:06:47 UTC (rev 17527)
@@ -40,11 +40,6 @@
}
@ManyToMany(cascade = CascadeType.PERSIST)
- @JoinTable(name = "GROUPS_PERMISSIONS",
- uniqueConstraints = @UniqueConstraint(columnNames = {"group_id", "permission"}),
- joinColumns = @JoinColumn(name = "group_id", referencedColumnName = "id"),
- inverseJoinColumns = @JoinColumn(name = "permission", referencedColumnName = "permission")
- )
@OrderBy("expirationDate")
@Where(clause = "1=1")
@WhereJoinTable(clause = "2=2")
16 years
Hibernate SVN: r17526 - in core/trunk: entitymanager/src/main/java/org/hibernate/ejb/criteria/expression and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-09-17 17:26:25 -0400 (Thu, 17 Sep 2009)
New Revision: 17526
Modified:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/AbstractBasicPluralJoin.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/AbstractNode.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicCollectionJoinImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicListJoinImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicMapJoinImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicPathUsageException.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicSetJoinImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/CollectionJoinImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/CriteriaQueryImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/CriteriaSubqueryImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/FromImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/JoinImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/JoinImplementors.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ListJoinImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/MapJoinImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/MapKeyHelpers.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/OrderImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ParameterContainer.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ParameterRegistry.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/PathImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/QueryBuilderImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/QueryStructure.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/RootImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/SetJoinImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/AbstractTupleElement.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/BinaryArithmeticOperation.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/BinaryOperatorExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/CoalesceExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/CollectionExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/CompoundSelectionImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ConcatExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/EntityTypeExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ExpressionImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ListIndexExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/LiteralExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/NullifExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ParameterExpressionImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SearchedCaseExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SelectionImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SimpleCaseExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SizeOfCollectionExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SubqueryComparisonModifierExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/UnaryArithmeticOperation.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/UnaryOperatorExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/AbsFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/AggregationFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/BasicFunctionExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CastFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CurrentDateFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CurrentTimeFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CurrentTimestampFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/FunctionExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/LengthFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/LocateFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/LowerFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/ParameterizedFunctionExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/SqrtFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/SubstringFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/TrimFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/UpperFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/AbstractPredicateImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/AbstractSimplePredicate.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/BetweenPredicate.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/BooleanExpressionPredicate.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ComparisonPredicate.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/CompoundPredicate.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ExistsPredicate.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ExplicitTruthValueCheck.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/InPredicate.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/IsEmptyPredicate.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/LikePredicate.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/MemberOfPredicate.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/NullnessPredicate.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/TruthValue.java
core/trunk/parent/pom.xml
Log:
HHH-4196 - Implement JPA 2.0 criteria apis (building)
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/AbstractBasicPluralJoin.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/AbstractBasicPluralJoin.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/AbstractBasicPluralJoin.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/AbstractNode.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/AbstractNode.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/AbstractNode.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicCollectionJoinImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicCollectionJoinImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicCollectionJoinImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -23,6 +25,7 @@
import javax.persistence.criteria.JoinType;
import javax.persistence.metamodel.CollectionAttribute;
+import org.hibernate.ejb.criteria.JoinImplementors.CollectionJoinImplementor;
/**
* Represents a join to a persistent collection, defined as type {@link java.util.Collection}, whose elements
@@ -44,8 +47,26 @@
}
@Override
+ public CollectionAttribute<? super O, E> getAttribute() {
+ return (CollectionAttribute<? super O, E>) super.getAttribute();
+ }
+
+ @Override
public CollectionAttribute<? super O, E> getModel() {
- return (CollectionAttribute<? super O, E>) super.getAttribute();
+ return getAttribute();
}
+ @Override
+ public CollectionJoinImplementor<O, E> correlateTo(CriteriaSubqueryImpl subquery) {
+ BasicCollectionJoinImpl<O,E> correlation = new BasicCollectionJoinImpl<O,E>(
+ queryBuilder(),
+ getJavaType(),
+ (PathImpl<O>) getParentPath(),
+ getModel(),
+ getJoinType()
+ );
+ correlation.defineJoinScope( subquery.getJoinScope() );
+ return correlation;
+ }
+
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicListJoinImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicListJoinImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicListJoinImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -24,6 +26,7 @@
import javax.persistence.criteria.Expression;
import javax.persistence.criteria.JoinType;
import javax.persistence.metamodel.ListAttribute;
+import org.hibernate.ejb.criteria.JoinImplementors.ListJoinImplementor;
import org.hibernate.ejb.criteria.expression.ListIndexExpression;
/**
@@ -58,4 +61,18 @@
public Expression<Integer> index() {
return new ListIndexExpression( queryBuilder(), getAttribute() );
}
+
+ @Override
+ public ListJoinImplementor<O, E> correlateTo(CriteriaSubqueryImpl subquery) {
+ BasicListJoinImpl<O,E> correlation = new BasicListJoinImpl<O,E>(
+ queryBuilder(),
+ getJavaType(),
+ (PathImpl<O>) getParentPath(),
+ getAttribute(),
+ getJoinType()
+ );
+ correlation.defineJoinScope( subquery.getJoinScope() );
+ return correlation;
+ }
+
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicMapJoinImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicMapJoinImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicMapJoinImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -29,6 +31,7 @@
import javax.persistence.criteria.Path;
import javax.persistence.metamodel.MapAttribute;
import javax.persistence.metamodel.Type.PersistenceType;
+import org.hibernate.ejb.criteria.JoinImplementors.MapJoinImplementor;
/**
* Represents a join to a persistent collection, defined as type {@link java.util.Map}, whose elements
@@ -54,6 +57,19 @@
}
@Override
+ public MapJoinImplementor<O, K, V> correlateTo(CriteriaSubqueryImpl subquery) {
+ BasicMapJoinImpl<O,K,V> correlation = new BasicMapJoinImpl<O,K,V>(
+ queryBuilder(),
+ getJavaType(),
+ (PathImpl<O>) getParentPath(),
+ getAttribute(),
+ getJoinType()
+ );
+ correlation.defineJoinScope( subquery.getJoinScope() );
+ return correlation;
+ }
+
+ @Override
public MapAttribute<? super O, K, V> getAttribute() {
return (MapAttribute<? super O, K, V>) super.getAttribute();
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicPathUsageException.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicPathUsageException.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicPathUsageException.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicSetJoinImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicSetJoinImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/BasicSetJoinImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -23,6 +25,7 @@
import javax.persistence.criteria.JoinType;
import javax.persistence.metamodel.SetAttribute;
+import org.hibernate.ejb.criteria.JoinImplementors.SetJoinImplementor;
/**
* Represents a join to a persistent collection, defined as type {@link java.util.Set}, whose elements
@@ -44,7 +47,25 @@
}
@Override
+ public SetJoinImplementor<O, E> correlateTo(CriteriaSubqueryImpl subquery) {
+ BasicSetJoinImpl<O,E> correlation = new BasicSetJoinImpl<O,E>(
+ queryBuilder(),
+ getJavaType(),
+ (PathImpl<O>) getParentPath(),
+ getAttribute(),
+ getJoinType()
+ );
+ correlation.defineJoinScope( subquery.getJoinScope() );
+ return correlation;
+ }
+
+ @Override
+ public SetAttribute<? super O, E> getAttribute() {
+ return (SetAttribute<? super O, E>) super.getAttribute();
+ }
+
+ @Override
public SetAttribute<? super O, E> getModel() {
- return (SetAttribute<? super O, E>) super.getAttribute();
+ return getAttribute();
}
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/CollectionJoinImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/CollectionJoinImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/CollectionJoinImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -23,6 +25,7 @@
import javax.persistence.criteria.JoinType;
import javax.persistence.metamodel.CollectionAttribute;
+import org.hibernate.ejb.criteria.JoinImplementors.CollectionJoinImplementor;
/**
* Represents a join to a persistent collection, defined as type {@link java.util.Collection}, whose elements
@@ -44,8 +47,26 @@
}
@Override
+ public CollectionJoinImplementor<O, E> correlateTo(CriteriaSubqueryImpl subquery) {
+ CollectionJoinImpl<O,E> correlation = new CollectionJoinImpl<O,E>(
+ queryBuilder(),
+ getJavaType(),
+ (PathImpl<O>) getParentPath(),
+ getAttribute(),
+ getJoinType()
+ );
+ correlation.defineJoinScope( subquery.getJoinScope() );
+ return correlation;
+ }
+
+ @Override
+ public CollectionAttribute<? super O, E> getAttribute() {
+ return (CollectionAttribute<? super O, E>) super.getAttribute();
+ }
+
+ @Override
public CollectionAttribute<? super O, E> getModel() {
- return (CollectionAttribute<? super O, E>) super.getAttribute();
+ return getAttribute();
}
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/CriteriaQueryImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/CriteriaQueryImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/CriteriaQueryImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -57,6 +59,9 @@
this.queryStructure = new QueryStructure<T>( this, queryBuilder );
}
+ /**
+ * {@inheritDoc}
+ */
public Class<T> getResultType() {
return returnType;
}
@@ -64,15 +69,24 @@
// SELECTION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ /**
+ * {@inheritDoc}
+ */
public CriteriaQuery<T> distinct(boolean applyDistinction) {
queryStructure.setDistinction( applyDistinction );
return this;
}
+ /**
+ * {@inheritDoc}
+ */
public boolean isDistinct() {
return queryStructure.isDistinction();
}
+ /**
+ * {@inheritDoc}
+ */
@SuppressWarnings({ "unchecked" })
public Selection<T> getSelection() {
return ( Selection<T> ) queryStructure.getSelection();
@@ -82,16 +96,25 @@
queryStructure.setSelection( selection );
}
+ /**
+ * {@inheritDoc}
+ */
public CriteriaQuery<T> select(Selection<? extends T> selection) {
applySelection( selection );
return this;
}
+ /**
+ * {@inheritDoc}
+ */
@SuppressWarnings({ "unchecked" })
public CriteriaQuery<T> multiselect(Selection<?>... selections) {
return multiselect( Arrays.asList( selections ) );
}
+ /**
+ * {@inheritDoc}
+ */
@SuppressWarnings({ "unchecked" })
public CriteriaQuery<T> multiselect(List<Selection<?>> selections) {
final Selection<? extends T> selection;
@@ -131,14 +154,23 @@
// ROOTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ /**
+ * {@inheritDoc}
+ */
public Set<Root<?>> getRoots() {
return queryStructure.getRoots();
}
+ /**
+ * {@inheritDoc}
+ */
public <X> Root<X> from(EntityType<X> entityType) {
return queryStructure.from( entityType );
}
+ /**
+ * {@inheritDoc}
+ */
public <X> Root<X> from(Class<X> entityClass) {
return queryStructure.from( entityClass );
}
@@ -188,6 +220,11 @@
return this;
}
+ public CriteriaQuery<T> groupBy(List<Expression<?>> groupings) {
+ queryStructure.setGroupings( groupings );
+ return this;
+ }
+
/**
* {@inheritDoc}
*/
@@ -214,10 +251,16 @@
// ORDERING ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ /**
+ * {@inheritDoc}
+ */
public List<Order> getOrderList() {
return orderSpecs;
}
+ /**
+ * {@inheritDoc}
+ */
public CriteriaQuery<T> orderBy(Order... orders) {
if ( orders != null && orders.length > 0 ) {
orderSpecs = Arrays.asList( orders );
@@ -228,10 +271,24 @@
return this;
}
+ /**
+ * {@inheritDoc}
+ */
+ public CriteriaQuery<T> orderBy(List<Order> orders) {
+ orderSpecs = orders;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public Set<ParameterExpression<?>> getParameters() {
return queryStructure.getParameters();
}
+ /**
+ * {@inheritDoc}
+ */
public <U> Subquery<U> subquery(Class<U> subqueryType) {
return queryStructure.subquery( subqueryType );
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/CriteriaSubqueryImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/CriteriaSubqueryImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/CriteriaSubqueryImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -23,9 +25,12 @@
import java.util.List;
import java.util.Set;
+import java.util.HashSet;
+import java.util.Collections;
import javax.persistence.criteria.AbstractQuery;
import javax.persistence.criteria.CollectionJoin;
import javax.persistence.criteria.Expression;
+import javax.persistence.criteria.Fetch;
import javax.persistence.criteria.Join;
import javax.persistence.criteria.ListJoin;
import javax.persistence.criteria.MapJoin;
@@ -35,6 +40,7 @@
import javax.persistence.criteria.SetJoin;
import javax.persistence.criteria.Subquery;
import javax.persistence.metamodel.EntityType;
+import org.hibernate.ejb.criteria.FromImpl.JoinScope;
import org.hibernate.ejb.criteria.expression.ExpressionImpl;
/**
@@ -48,8 +54,18 @@
private final QueryStructure<T> queryStructure;
private Expression<T> selection;
- private Set<Join<?, ?>> joins;
+ private Set<Join<?, ?>> correlatedJoins = new HashSet<Join<?,?>>();
+ private final FromImpl.JoinScope joinScope = new FromImpl.JoinScope() {
+ public void addJoin(Join join) {
+ correlatedJoins.add( join );
+ }
+
+ public void addFetch(Fetch fetch) {
+ throw new UnsupportedOperationException( "Cannot define fetch from a subquery correlation" );
+ }
+ };
+
public CriteriaSubqueryImpl(
QueryBuilderImpl queryBuilder,
Class<T> javaType,
@@ -59,28 +75,58 @@
this.queryStructure = new QueryStructure<T>( this, queryBuilder );
}
+ /**
+ * Get the scope used to scope joins to this subquery.
+ *
+ * @return The subquery's join scope.
+ */
+ public JoinScope getJoinScope() {
+ return joinScope;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public AbstractQuery<?> getParent() {
return parent;
}
+ /**
+ * {@inheritDoc}
+ */
public void registerParameters(ParameterRegistry registry) {
for ( ParameterExpression param : queryStructure.getParameters() ) {
registry.registerParameter( param );
}
- // TODO : correlations. Can they contain parameters?
}
+ /**
+ * {@inheritDoc}
+ */
+ public Class<T> getResultType() {
+ return getJavaType();
+ }
+
// ROOTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ /**
+ * {@inheritDoc}
+ */
public Set<Root<?>> getRoots() {
return queryStructure.getRoots();
}
+ /**
+ * {@inheritDoc}
+ */
public <X> Root<X> from(EntityType<X> entityType) {
return queryStructure.from( entityType );
}
+ /**
+ * {@inheritDoc}
+ */
public <X> Root<X> from(Class<X> entityClass) {
return queryStructure.from( entityClass );
}
@@ -156,6 +202,14 @@
/**
* {@inheritDoc}
*/
+ public Subquery<T> groupBy(List<Expression<?>> groupings) {
+ queryStructure.setGroupings( groupings );
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public Predicate getGroupRestriction() {
return queryStructure.getHaving();
}
@@ -179,34 +233,58 @@
// CORRELATIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- public Set<Join<?, ?>> getJoins() {
- return joins;
+ /**
+ * {@inheritDoc}
+ */
+ public Set<Join<?, ?>> getCorrelatedJoins() {
+ return correlatedJoins;
}
- public <Y> Root<Y> correlate(Root<Y> arg0) {
- throw new UnsupportedOperationException("Not supported yet.");
+ /**
+ * {@inheritDoc}
+ */
+ public <Y> Root<Y> correlate(Root<Y> source) {
+ return ( ( RootImpl<Y> ) source ).correlateTo( this );
}
- public <X, Y> Join<X, Y> correlate(Join<X, Y> arg0) {
- throw new UnsupportedOperationException("Not supported yet.");
+ /**
+ * {@inheritDoc}
+ */
+ public <X, Y> Join<X, Y> correlate(Join<X, Y> source) {
+ return ( ( JoinImplementors.JoinImplementor<X,Y> ) source ).correlateTo( this );
}
- public <X, Y> CollectionJoin<X, Y> correlate(CollectionJoin<X, Y> arg0) {
- throw new UnsupportedOperationException("Not supported yet.");
+ /**
+ * {@inheritDoc}
+ */
+ public <X, Y> CollectionJoin<X, Y> correlate(CollectionJoin<X, Y> source) {
+ return ( ( JoinImplementors.CollectionJoinImplementor<X,Y> ) source ).correlateTo( this );
}
- public <X, Y> SetJoin<X, Y> correlate(SetJoin<X, Y> arg0) {
- throw new UnsupportedOperationException("Not supported yet.");
+ /**
+ * {@inheritDoc}
+ */
+ public <X, Y> SetJoin<X, Y> correlate(SetJoin<X, Y> source) {
+ return ( ( JoinImplementors.SetJoinImplementor<X,Y> ) source ).correlateTo( this );
}
- public <X, Y> ListJoin<X, Y> correlate(ListJoin<X, Y> arg0) {
- throw new UnsupportedOperationException("Not supported yet.");
+ /**
+ * {@inheritDoc}
+ */
+ public <X, Y> ListJoin<X, Y> correlate(ListJoin<X, Y> source) {
+ return ( ( JoinImplementors.ListJoinImplementor<X,Y> ) source ).correlateTo( this );
}
- public <X, K, V> MapJoin<X, K, V> correlate(MapJoin<X, K, V> arg0) {
- throw new UnsupportedOperationException("Not supported yet.");
+ /**
+ * {@inheritDoc}
+ */
+ public <X, K, V> MapJoin<X, K, V> correlate(MapJoin<X, K, V> source) {
+ return ( ( JoinImplementors.MapJoinImplementor<X, K, V> ) source ).correlateTo( this );
}
+ /**
+ * {@inheritDoc}
+ */
public <U> Subquery<U> subquery(Class<U> subqueryType) {
return queryStructure.subquery( subqueryType );
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/FromImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/FromImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/FromImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -59,10 +61,34 @@
public abstract class FromImpl<Z,X> extends PathImpl<X> implements From<Z,X> {
public static final JoinType DEFAULT_JOIN_TYPE = JoinType.INNER;
+ /**
+ * Helper contract used to define who/what keeps track of joins and fetches made from this <tt>FROM</tt>.
+ */
+ public static interface JoinScope<X> {
+ public void addJoin(Join<X, ?> join);
+ public void addFetch(Fetch<X,?> fetch);
+ }
+
private final Expression<Class<? extends X>> type;
private Set<Join<X, ?>> joins;
private Set<Fetch<X, ?>> fetches;
+ private JoinScope<X> joinScope = new JoinScope<X>() {
+ public void addJoin(Join<X, ?> join) {
+ if ( joins == null ) {
+ joins = new LinkedHashSet<Join<X,?>>();
+ }
+ joins.add( join );
+ }
+
+ public void addFetch(Fetch<X, ?> fetch) {
+ if ( fetches == null ) {
+ fetches = new LinkedHashSet<Fetch<X,?>>();
+ }
+ fetches.add( fetch );
+ }
+ };
+
/**
* Special constructor for {@link RootImpl}.
*
@@ -84,6 +110,10 @@
this.type = new EntityTypeExpression( queryBuilder, model.getJavaType() );
}
+ protected void defineJoinScope(JoinScope<X> joinScope) {
+ this.joinScope = joinScope;
+ }
+
@Override
public Expression<Class<? extends X>> type() {
return type;
@@ -112,19 +142,6 @@
}
/**
- * Retrieve the collection of joins, imnplementing delayed creations. Calls on this method
- * assume the set is physically needed, and the result is the set being built if not already.
- *
- * @return The set of joins.
- */
- public Set<Join<X, ?>> getJoinsInternal() {
- if ( joins == null ) {
- joins = new LinkedHashSet<Join<X,?>>();
- }
- return joins;
- }
-
- /**
* {@inheritDoc}
*/
public <Y> Join<X, Y> join(SingularAttribute<? super X, Y> singularAttribute) {
@@ -136,7 +153,7 @@
*/
public <Y> Join<X, Y> join(SingularAttribute<? super X, Y> attribute, JoinType jt) {
Join<X, Y> join = constructJoin( attribute, jt );
- getJoinsInternal().add( join );
+ joinScope.addJoin( join );
return join;
}
@@ -172,7 +189,7 @@
*/
public <Y> CollectionJoin<X, Y> join(CollectionAttribute<? super X, Y> collection, JoinType jt) {
final CollectionJoin<X, Y> join = constructJoin( collection, jt );
- getJoinsInternal().add( join );
+ joinScope.addJoin( join );
return join;
}
@@ -220,7 +237,7 @@
*/
public <Y> SetJoin<X, Y> join(SetAttribute<? super X, Y> set, JoinType jt) {
final SetJoin<X, Y> join = constructJoin( set, jt );
- getJoinsInternal().add( join );
+ joinScope.addJoin( join );
return join;
}
@@ -252,7 +269,7 @@
*/
public <Y> ListJoin<X, Y> join(ListAttribute<? super X, Y> list, JoinType jt) {
final ListJoin<X, Y> join = constructJoin( list, jt );
- getJoinsInternal().add( join );
+ joinScope.addJoin( join );
return join;
}
@@ -284,7 +301,7 @@
*/
public <K, V> MapJoin<X, K, V> join(MapAttribute<? super X, K, V> map, JoinType jt) {
final MapJoin<X, K, V> join = constructJoin( map, jt );
- getJoinsInternal().add( join );
+ joinScope.addJoin( join );
return join;
}
@@ -448,14 +465,11 @@
/**
* Retrieve the collection of fetches, imnplementing delayed creations. Calls on this method
- * assume the set is physically needed, and the result is the set being built if not already.
+ * assume the set is physically needed, and as a result the set is built if not already.
*
* @return The set of fetches.
*/
- public Set<Fetch<X, ?>> getFetchesInternal() {
- if ( fetches == null ) {
- fetches = new LinkedHashSet<Fetch<X,?>>();
- }
+ public Set<Fetch<X, ?>> internalGetFetches() {
return fetches;
}
@@ -465,7 +479,7 @@
public <Y> Fetch<X, Y> fetch(SingularAttribute<? super X, Y> attribute, JoinType jt) {
Fetch<X, Y> fetch = constructJoin( attribute, jt );
- getFetchesInternal().add( fetch );
+ joinScope.addFetch( fetch );
return fetch;
}
@@ -488,7 +502,7 @@
else {
fetch = constructJoin( (MapAttribute<X,?,Y>) pluralAttribute, jt );
}
- getFetchesInternal().add( fetch );
+ joinScope.addFetch( fetch );
return fetch;
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/JoinImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/JoinImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/JoinImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -83,4 +85,18 @@
protected Attribute<X, ?> getAttribute(String name) {
return (Attribute<X, ?>) managedType.getAttribute( name );
}
+
+ public JoinImplementors.JoinImplementor<Z,X> correlateTo(CriteriaSubqueryImpl subquery) {
+ JoinImpl<Z,X> correlation = new JoinImpl<Z,X>(
+ queryBuilder(),
+ getJavaType(),
+ (PathImpl<Z>)getParentPath(),
+ getAttribute(),
+ getJoinType()
+ );
+ correlation.defineJoinScope( subquery.getJoinScope() );
+ return correlation;
+ }
+
+
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/JoinImplementors.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/JoinImplementors.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/JoinImplementors.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -35,18 +37,28 @@
* @author Steve Ebersole
*/
public interface JoinImplementors {
- public static interface JoinImplementor<Z,X> extends Join<Z,X>, Fetch<Z,X> {
+ public static interface JoinImplementor<Z,X>
+ extends Join<Z,X>, Fetch<Z,X> {
+ public JoinImplementor<Z,X> correlateTo(CriteriaSubqueryImpl subquery);
}
- public static interface CollectionJoinImplementor<Z,X> extends CollectionJoin<Z,X>, Fetch<Z,X> {
+ public static interface CollectionJoinImplementor<Z,X>
+ extends JoinImplementor<Z,X>, CollectionJoin<Z,X>, Fetch<Z,X> {
+ public CollectionJoinImplementor<Z,X> correlateTo(CriteriaSubqueryImpl subquery);
}
- public static interface SetJoinImplementor<Z,X> extends SetJoin<Z,X>, Fetch<Z,X> {
+ public static interface SetJoinImplementor<Z,X>
+ extends JoinImplementor<Z,X>, SetJoin<Z,X>, Fetch<Z,X> {
+ public SetJoinImplementor<Z,X> correlateTo(CriteriaSubqueryImpl subquery);
}
- public static interface ListJoinImplementor<Z,X> extends ListJoin<Z,X>, Fetch<Z,X> {
+ public static interface ListJoinImplementor<Z,X>
+ extends JoinImplementor<Z,X>, ListJoin<Z,X>, Fetch<Z,X> {
+ public ListJoinImplementor<Z,X> correlateTo(CriteriaSubqueryImpl subquery);
}
- public static interface MapJoinImplementor<Z,K,V> extends MapJoin<Z,K,V>, Fetch<Z,V> {
+ public static interface MapJoinImplementor<Z,K,V>
+ extends JoinImplementor<Z,V>, MapJoin<Z,K,V>, Fetch<Z,V> {
+ public MapJoinImplementor<Z,K,V> correlateTo(CriteriaSubqueryImpl subquery);
}
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ListJoinImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ListJoinImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ListJoinImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -24,6 +26,7 @@
import javax.persistence.criteria.Expression;
import javax.persistence.criteria.JoinType;
import javax.persistence.metamodel.ListAttribute;
+import org.hibernate.ejb.criteria.JoinImplementors.ListJoinImplementor;
import org.hibernate.ejb.criteria.expression.ListIndexExpression;
/**
@@ -43,6 +46,19 @@
}
@Override
+ public ListJoinImplementor<O, E> correlateTo(CriteriaSubqueryImpl subquery) {
+ ListJoinImpl<O,E> correlation = new ListJoinImpl<O,E>(
+ queryBuilder(),
+ getJavaType(),
+ (PathImpl<O>) getParentPath(),
+ getAttribute(),
+ getJoinType()
+ );
+ correlation.defineJoinScope( subquery.getJoinScope() );
+ return correlation;
+ }
+
+ @Override
public ListAttribute<? super O, E> getAttribute() {
return (ListAttribute<? super O, E>) super.getAttribute();
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/MapJoinImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/MapJoinImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/MapJoinImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -29,6 +31,7 @@
import javax.persistence.criteria.Path;
import javax.persistence.metamodel.MapAttribute;
import javax.persistence.metamodel.Type.PersistenceType;
+import org.hibernate.ejb.criteria.JoinImplementors.MapJoinImplementor;
/**
* Represents a join to a persistent collection, defined as type {@link java.util.Map}, whose elements
@@ -50,6 +53,19 @@
}
@Override
+ public MapJoinImplementor<O, K, V> correlateTo(CriteriaSubqueryImpl subquery) {
+ MapJoinImpl<O, K, V> correlation = new MapJoinImpl<O, K, V>(
+ queryBuilder(),
+ getJavaType(),
+ (PathImpl<O>) getParentPath(),
+ getAttribute(),
+ getJoinType()
+ );
+ correlation.defineJoinScope( subquery.getJoinScope() );
+ return correlation;
+ }
+
+ @Override
public MapAttribute<? super O, K, V> getAttribute() {
return (MapAttribute<? super O, K, V>) super.getAttribute();
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/MapKeyHelpers.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/MapKeyHelpers.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/MapKeyHelpers.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -35,6 +37,7 @@
import javax.persistence.metamodel.MapAttribute;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.Type.PersistenceType;
+import org.hibernate.ejb.criteria.JoinImplementors.JoinImplementor;
import org.hibernate.ejb.criteria.expression.ExpressionImpl;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.persister.collection.CollectionPersister;
@@ -66,6 +69,12 @@
jt
);
}
+
+ @Override
+ public JoinImplementor<Map<K, V>, K> correlateTo(CriteriaSubqueryImpl subquery) {
+ throw new UnsupportedOperationException( "Map key join cannot be used as a correlation" );
+ }
+
}
/**
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/OrderImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/OrderImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/OrderImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ParameterContainer.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ParameterContainer.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ParameterContainer.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ParameterRegistry.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ParameterRegistry.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ParameterRegistry.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/PathImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/PathImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/PathImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/QueryBuilderImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/QueryBuilderImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/QueryBuilderImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -69,8 +71,6 @@
import org.hibernate.ejb.criteria.expression.function.TrimFunction;
import org.hibernate.ejb.criteria.expression.function.UpperFunction;
import org.hibernate.ejb.criteria.predicate.BooleanExpressionPredicate;
-import org.hibernate.ejb.criteria.predicate.ExplicitTruthValueCheck;
-import org.hibernate.ejb.criteria.predicate.TruthValue;
import org.hibernate.ejb.criteria.predicate.NullnessPredicate;
import org.hibernate.ejb.criteria.predicate.CompoundPredicate;
import org.hibernate.ejb.criteria.predicate.ComparisonPredicate;
@@ -309,14 +309,18 @@
* {@inheritDoc}
*/
public Predicate isTrue(Expression<Boolean> x) {
- return new ExplicitTruthValueCheck( this, x, TruthValue.TRUE );
+ return wrap( x );
+// TODO : the correct thing here depends on response to #5 on my wiki page
+// return new ExplicitTruthValueCheck( this, x, TruthValue.TRUE );
}
/**
* {@inheritDoc}
*/
public Predicate isFalse(Expression<Boolean> x) {
- return new ExplicitTruthValueCheck( this, x, TruthValue.FALSE );
+ return wrap( x ).negate();
+// TODO : the correct thing here depends on response to #5 on my wiki page
+// return new ExplicitTruthValueCheck( this, x, TruthValue.FALSE );
}
/**
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/QueryStructure.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/QueryStructure.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/QueryStructure.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/RootImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/RootImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/RootImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -47,4 +49,9 @@
return (Attribute<X, ?>) getModel().getAttribute( name );
}
+ public RootImpl<X> correlateTo(CriteriaSubqueryImpl subquery) {
+ RootImpl<X> correlation = new RootImpl<X>( queryBuilder(), getModel() );
+ correlation.defineJoinScope( subquery.getJoinScope() );
+ return correlation;
+ }
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/SetJoinImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/SetJoinImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/SetJoinImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
@@ -23,6 +25,7 @@
import javax.persistence.criteria.JoinType;
import javax.persistence.metamodel.SetAttribute;
+import org.hibernate.ejb.criteria.JoinImplementors.SetJoinImplementor;
/**
* Represents a join to a persistent collection, defined as type {@link java.util.Set}, whose elements
@@ -44,8 +47,25 @@
}
@Override
+ public SetJoinImplementor<O, E> correlateTo(CriteriaSubqueryImpl subquery) {
+ SetJoinImpl<O,E> correlation = new SetJoinImpl<O,E>(
+ queryBuilder(),
+ getJavaType(),
+ (PathImpl<O>) getParentPath(),
+ getAttribute(),
+ getJoinType()
+ );
+ correlation.defineJoinScope( subquery.getJoinScope() );
+ return correlation;
+ }
+
+ @Override
+ public SetAttribute<? super O, E> getAttribute() {
+ return (SetAttribute<? super O, E>) super.getAttribute();
+ }
+
+ @Override
public SetAttribute<? super O, E> getModel() {
- return (SetAttribute<? super O, E>) super.getAttribute();
+ return getAttribute();
}
-
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/AbstractTupleElement.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/AbstractTupleElement.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/AbstractTupleElement.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/BinaryArithmeticOperation.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/BinaryArithmeticOperation.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/BinaryArithmeticOperation.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/BinaryOperatorExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/BinaryOperatorExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/BinaryOperatorExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/CoalesceExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/CoalesceExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/CoalesceExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/CollectionExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/CollectionExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/CollectionExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/CompoundSelectionImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/CompoundSelectionImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/CompoundSelectionImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ConcatExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ConcatExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ConcatExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/EntityTypeExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/EntityTypeExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/EntityTypeExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ExpressionImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ExpressionImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ExpressionImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ListIndexExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ListIndexExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ListIndexExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,3 +1,26 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.ejb.criteria.expression;
import javax.persistence.metamodel.ListAttribute;
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/LiteralExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/LiteralExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/LiteralExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/NullifExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/NullifExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/NullifExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ParameterExpressionImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ParameterExpressionImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ParameterExpressionImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SearchedCaseExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SearchedCaseExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SearchedCaseExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SelectionImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SelectionImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SelectionImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SimpleCaseExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SimpleCaseExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SimpleCaseExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SizeOfCollectionExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SizeOfCollectionExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SizeOfCollectionExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SubqueryComparisonModifierExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SubqueryComparisonModifierExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/SubqueryComparisonModifierExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,3 +1,26 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.ejb.criteria.expression;
import javax.persistence.criteria.Subquery;
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/UnaryArithmeticOperation.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/UnaryArithmeticOperation.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/UnaryArithmeticOperation.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,3 +1,26 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.ejb.criteria.expression;
import javax.persistence.criteria.Expression;
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/UnaryOperatorExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/UnaryOperatorExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/UnaryOperatorExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/AbsFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/AbsFunction.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/AbsFunction.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/AggregationFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/AggregationFunction.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/AggregationFunction.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/BasicFunctionExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/BasicFunctionExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/BasicFunctionExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CastFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CastFunction.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CastFunction.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CurrentDateFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CurrentDateFunction.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CurrentDateFunction.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CurrentTimeFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CurrentTimeFunction.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CurrentTimeFunction.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CurrentTimestampFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CurrentTimestampFunction.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CurrentTimestampFunction.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/FunctionExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/FunctionExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/FunctionExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/LengthFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/LengthFunction.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/LengthFunction.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/LocateFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/LocateFunction.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/LocateFunction.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/LowerFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/LowerFunction.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/LowerFunction.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/ParameterizedFunctionExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/ParameterizedFunctionExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/ParameterizedFunctionExpression.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/SqrtFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/SqrtFunction.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/SqrtFunction.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/SubstringFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/SubstringFunction.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/SubstringFunction.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,3 +1,26 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.ejb.criteria.expression.function;
import javax.persistence.criteria.Expression;
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/TrimFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/TrimFunction.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/TrimFunction.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,3 +1,26 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.ejb.criteria.expression.function;
import javax.persistence.criteria.Expression;
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/UpperFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/UpperFunction.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/UpperFunction.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/AbstractPredicateImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/AbstractPredicateImpl.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/AbstractPredicateImpl.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/AbstractSimplePredicate.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/AbstractSimplePredicate.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/AbstractSimplePredicate.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/BetweenPredicate.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/BetweenPredicate.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/BetweenPredicate.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/BooleanExpressionPredicate.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/BooleanExpressionPredicate.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/BooleanExpressionPredicate.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ComparisonPredicate.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ComparisonPredicate.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ComparisonPredicate.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/CompoundPredicate.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/CompoundPredicate.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/CompoundPredicate.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ExistsPredicate.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ExistsPredicate.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ExistsPredicate.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ExplicitTruthValueCheck.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ExplicitTruthValueCheck.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ExplicitTruthValueCheck.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/InPredicate.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/InPredicate.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/InPredicate.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/IsEmptyPredicate.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/IsEmptyPredicate.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/IsEmptyPredicate.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/LikePredicate.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/LikePredicate.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/LikePredicate.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/MemberOfPredicate.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/MemberOfPredicate.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/MemberOfPredicate.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/NullnessPredicate.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/NullnessPredicate.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/NullnessPredicate.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/TruthValue.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/TruthValue.java 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/TruthValue.java 2009-09-17 21:26:25 UTC (rev 17526)
@@ -1,9 +1,11 @@
/*
- * Copyright (c) 2009, 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.
+ * Hibernate, Relational Persistence for Idiomatic Java
*
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @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.
Modified: core/trunk/parent/pom.xml
===================================================================
--- core/trunk/parent/pom.xml 2009-09-17 20:22:44 UTC (rev 17525)
+++ core/trunk/parent/pom.xml 2009-09-17 21:26:25 UTC (rev 17526)
@@ -428,7 +428,7 @@
<dependency>
<groupId>org.hibernate.java-persistence</groupId>
<artifactId>jpa-api</artifactId>
- <version>2.0.Beta-20090815</version>
+ <version>2.0.Beta-SNAPSHOT</version>
</dependency>
<!-- Set the version of the hibernate-commons-annotations to be used throughout the the project -->
<dependency>
16 years
Hibernate SVN: r17525 - jpa-api/trunk/src/main/java/javax/persistence/criteria.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-09-17 16:22:44 -0400 (Thu, 17 Sep 2009)
New Revision: 17525
Modified:
jpa-api/trunk/src/main/java/javax/persistence/criteria/AbstractQuery.java
jpa-api/trunk/src/main/java/javax/persistence/criteria/CollectionJoin.java
jpa-api/trunk/src/main/java/javax/persistence/criteria/CriteriaQuery.java
jpa-api/trunk/src/main/java/javax/persistence/criteria/Expression.java
jpa-api/trunk/src/main/java/javax/persistence/criteria/FetchParent.java
jpa-api/trunk/src/main/java/javax/persistence/criteria/From.java
jpa-api/trunk/src/main/java/javax/persistence/criteria/ListJoin.java
jpa-api/trunk/src/main/java/javax/persistence/criteria/MapJoin.java
jpa-api/trunk/src/main/java/javax/persistence/criteria/ParameterExpression.java
jpa-api/trunk/src/main/java/javax/persistence/criteria/Path.java
jpa-api/trunk/src/main/java/javax/persistence/criteria/Predicate.java
jpa-api/trunk/src/main/java/javax/persistence/criteria/QueryBuilder.java
jpa-api/trunk/src/main/java/javax/persistence/criteria/Subquery.java
Log:
validated javax.persistence.criteria package definitions against spec version dated 2009.31.08 (plus accounted for Subquery#getJoins being renamed to getCorrelatedJoins as indicated by Linda in email response)
Modified: jpa-api/trunk/src/main/java/javax/persistence/criteria/AbstractQuery.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/criteria/AbstractQuery.java 2009-09-17 17:36:24 UTC (rev 17524)
+++ jpa-api/trunk/src/main/java/javax/persistence/criteria/AbstractQuery.java 2009-09-17 20:22:44 UTC (rev 17525)
@@ -22,27 +22,21 @@
/**
* Add a query root corresponding to the given entity,
* forming a cartesian product with any existing roots.
- * @param entity metamodel entity representing the entity
- * of type X
+ * @param entityClass the entity class
* @return query root corresponding to the given entity
*/
- <X> Root<X> from(EntityType<X> entity);
+ <X> Root<X> from(Class<X> entityClass);
/**
* Add a query root corresponding to the given entity,
* forming a cartesian product with any existing roots.
- * @param entityClass the entity class
+ * @param entity metamodel entity representing the entity
+ * of type X
* @return query root corresponding to the given entity
*/
- <X> Root<X> from(Class<X> entityClass);
+ <X> Root<X> from(EntityType<X> entity);
/**
- * Return the query roots.
- * @return the set of query roots
- */
- Set<Root<?>> getRoots();
-
- /**
* Modify the query to restrict the query results according
* to the specified boolean expression.
* Replaces the previously added restriction(s), if any.
@@ -73,6 +67,17 @@
*/
AbstractQuery<T> groupBy(Expression<?>... grouping);
+ /**
+ * Specify the expressions that are used to form groups over
+ * the query results.
+ * Replaces the previous specified grouping expressions, if any.
+ * If no grouping expressions are specified, any previously
+ * added grouping expressions are simply removed.
+ * @param grouping list of zero or more grouping expressions
+ * @return the modified query
+ */
+ AbstractQuery<T> groupBy(List<Expression<?>> grouping);
+
/**
* Specify a restriction over the groups of the query.
* Replaces the previous having restriction(s), if any.
@@ -107,18 +112,25 @@
AbstractQuery<T> distinct(boolean distinct);
/**
+ * Create a subquery of the query.
+ * @param type the subquery result type
+ * @return subquery
+ */
+ <U> Subquery<U> subquery(Class<U> type);
+
+ /**
+ * Return the query roots.
+ * @return the set of query roots
+ */
+ Set<Root<?>> getRoots();
+
+ /**
* Return the selection of the query
* @return selection item
*/
Selection<T> getSelection();
/**
- * Return a list of the grouping expressions
- * @return the list of grouping expressions
- */
- List<Expression<?>> getGroupList();
-
- /**
* Return the predicate that corresponds to the where clause
* restriction(s).
* @return where clause predicate
@@ -126,6 +138,12 @@
Predicate getRestriction();
/**
+ * Return a list of the grouping expressions
+ * @return the list of grouping expressions
+ */
+ List<Expression<?>> getGroupList();
+
+ /**
* Return the predicate that corresponds to the restriction(s)
* over the grouping items.
* @return having clause predicate
@@ -140,12 +158,15 @@
*/
boolean isDistinct();
- /**
- * Create a subquery of the query.
- * @param type the subquery result type
- * @return subquery
- */
- <U> Subquery<U> subquery(Class<U> type);
-
+ /**
+ * Return the result type of the query or subquery.
+ * If a result type was specified as an argument to the
+ * createQuery or subquery method, that type will be returned.
+ * If the query was created using the createTupleQuery
+ * method, the result type is Tuple.
+ * Otherwise, the result type is Object.
+ * @return result type
+ */
+ Class<T> getResultType();
}
Modified: jpa-api/trunk/src/main/java/javax/persistence/criteria/CollectionJoin.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/criteria/CollectionJoin.java 2009-09-17 17:36:24 UTC (rev 17524)
+++ jpa-api/trunk/src/main/java/javax/persistence/criteria/CollectionJoin.java 2009-09-17 20:22:44 UTC (rev 17525)
@@ -13,8 +13,7 @@
* @param <Z> The source type of the join
* @param <E> The element type of the target Collection
*/
-public interface CollectionJoin<Z, E>
- extends PluralJoin<Z, Collection<E>, E> {
+public interface CollectionJoin<Z, E> extends PluralJoin<Z, Collection<E>, E> {
/**
* Return the metamodel representation for the collection
Modified: jpa-api/trunk/src/main/java/javax/persistence/criteria/CriteriaQuery.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/criteria/CriteriaQuery.java 2009-09-17 17:36:24 UTC (rev 17524)
+++ jpa-api/trunk/src/main/java/javax/persistence/criteria/CriteriaQuery.java 2009-09-17 20:22:44 UTC (rev 17525)
@@ -11,119 +11,145 @@
*/
public interface CriteriaQuery<T> extends AbstractQuery<T> {
- /**
- * Specify the item that is to be returned in the query result.
- * Replaces the previously specified selection(s), if any.
- * @param selection selection specifying the item that
- * is to be returned in the query result
- * @return the modified query
- */
- CriteriaQuery<T> select(Selection<? extends T> selection);
+ /**
+ * Specify the item that is to be returned in the query result.
+ * Replaces the previously specified selection(s), if any.
+ *
+ * Note: Applications using the string-based API may need to
+ * specify the type of the select item when it results from
+ * a get or join operation and the query result type is
+ * specified. For example:
+ *
+ * CriteriaQuery<String> q = qb.createQuery(String.class);
+ * Root<Order> order = q.from(Order.class);
+ * q.select(order.get("shippingAddress").<String>get("state"));
+ *
+ * CriteriaQuery<Product> q2 = qb.createQuery(Product.class);
+ * q2.select(q2.from(Order.class)
+ * .join("items")
+ * .<Item,Product>join("product"));
+ *
+ * @param selection selection specifying the item that
+ * is to be returned in the query result
+ * @return the modified query
+ * @throws IllegalArgumentException if the selection is
+ * a compound selection and more than one selection
+ * item has the same assigned alias
+ */
+ CriteriaQuery<T> select(Selection<? extends T> selection);
- /**
- * Specify the selection items that are to be returned in the
- * query result.
- * Replaces the previously specified selection(s), if any.
- *
- * The type of the result of the query execution depends on
- * the specification of the type of the criteria query object
- * created as well as the arguments to the multiselect method.
- * An argument to the multiselect method must not be a tuple-
- * or array-valued compound selection item.
- * The semantics of this method are as follows:
- *
- * If the type of the criteria query is CriteriaQuery<Tuple>
- * (i.e., a criteria query object created by either the
- * createTupleQuery method or by passing a Tuple class argument
- * to the createQuery method), a Tuple object corresponding to
- * the arguments of the multiselect method will be instantiated
- * and returned for each row that results from the query execution.
- *
- * If the type of the criteria query is CriteriaQuery<X> for
- * some user-defined class X (i.e., a criteria query object
- * created by passing a X class argument to the createQuery
- * method), then the arguments to the multiselect method will be
- * passed to the X constructor and an instance of type X will be
- * returned for each row.
- *
- * If the type of the criteria query is CriteriaQuery<X[]> for
- * some class X, an instance of type X[] will be returned for
- * each row. The elements of the array will correspond to the
- * arguments of the multiselect method.
- *
- * If the type of the criteria query is CriteriaQuery<Object>
- * or if the criteria query was created without specifying a type,
- * and only a single argument is passed to the multiselect method,
- * an instance of type Object will be returned for each row.
- *
- * If the type of the criteria query is CriteriaQuery<Object>
- * or if the criteria query was created without specifying a type,
- * and more than one argument is passed to the multiselect method,
- * an instance of type Object[] will be instantiated and returned
- * for each row. The elements of the array will correspond to the
- * arguments to the multiselect method.
- *
- * @param selections selection items corresponding to the
- * results to be returned by the query
- * @return the modified query
- */
- CriteriaQuery<T> multiselect(Selection<?>... selections);
+ /**
+ * Specify the selection items that are to be returned in the
+ * query result.
+ * Replaces the previously specified selection(s), if any.
+ *
+ * The type of the result of the query execution depends on
+ * the specification of the type of the criteria query object
+ * created as well as the arguments to the multiselect method.
+ * An argument to the multiselect method must not be a tuple-
+ * or array-valued compound selection item.
+ *
+ * The semantics of this method are as follows:
+ *
+ * If the type of the criteria query is CriteriaQuery<Tuple>
+ * (i.e., a criteria query object created by either the
+ * createTupleQuery method or by passing a Tuple class argument
+ * to the createQuery method), a Tuple object corresponding to
+ * the arguments of the multiselect method will be instantiated
+ * and returned for each row that results from the query
+ * execution.
+ *
+ * If the type of the criteria query is CriteriaQuery<X> for
+ * some user-defined class X (i.e., a criteria query object
+ * created by passing a X class argument to the createQuery
+ * method), the arguments to the multiselect method will be
+ * passed to the X constructor and an instance of type X will be
+ * returned for each row.
+ *
+ * If the type of the criteria query is CriteriaQuery<X[]> for
+ * some class X, an instance of type X[] will be returned for
+ * each row. The elements of the array will correspond to the
+ * arguments of the multiselect method.
+ *
+ * If the type of the criteria query is CriteriaQuery<Object>
+ * or if the criteria query was created without specifying a
+ * type, and only a single argument is passed to the multiselect
+ * method, an instance of type Object will be returned for
+ * each row.
+ *
+ * If the type of the criteria query is CriteriaQuery<Object>
+ * or if the criteria query was created without specifying a
+ * type, and more than one argument is passed to the multiselect
+ * method, an instance of type Object[] will be instantiated
+ * and returned for each row. The elements of the array will
+ * correspond to the arguments to the multiselect method.
+ *
+ * @param selections selection items corresponding to the
+ * results to be returned by the query
+ * @return the modified query
+ * @throws IllegalArgumentException if a selection item is
+ * not valid or if more than one selection item has
+ * the same assigned alias
+ */
+ CriteriaQuery<T> multiselect(Selection<?>... selections);
+ /**
+ * Specify the selection items that are to be returned in the
+ * query result.
+ * Replaces the previously specified selection(s), if any.
+ *
+ * The type of the result of the query execution depends on
+ * the specification of the type of the criteria query object
+ * created as well as the argument to the multiselect method.
+ * An element of the list passed to the multiselect method
+ * must not be a tuple- or array-valued compound selection item.
+ *
+ * The semantics of this method are as follows:
+ *
+ * If the type of the criteria query is CriteriaQuery<Tuple>
+ * (i.e., a criteria query object created by either the
+ * createTupleQuery method or by passing a Tuple class argument
+ * to the createQuery method), a Tuple object corresponding to
+ * the elements of the list passed to the multiselect method
+ * will be instantiated and returned for each row that results
+ * from the query execution.
+ *
+ * If the type of the criteria query is CriteriaQuery<X> for
+ * some user-defined class X (i.e., a criteria query object
+ * created by passing a X class argument to the createQuery
+ * method), the elements of the list passed to the multiselect
+ * method will be passed to the X constructor and an instance
+ * of type X will be returned for each row.
+ *
+ * If the type of the criteria query is CriteriaQuery<X[]> for
+ * some class X, an instance of type X[] will be returned for
+ * each row. The elements of the array will correspond to the
+ * elements of the list passed to the multiselect method.
+ *
+ * If the type of the criteria query is CriteriaQuery<Object>
+ * or if the criteria query was created without specifying a
+ * type, and the list passed to the multiselect method contains
+ * only a single element, an instance of type Object will be
+ * returned for each row.
+ *
+ * If the type of the criteria query is CriteriaQuery<Object>
+ * or if the criteria query was created without specifying a
+ * type, and the list passed to the multiselect method contains
+ * more than one element, an instance of type Object[] will be
+ * instantiated and returned for each row. The elements of the
+ * array will correspond to the elements of the list passed to
+ * the multiselect method.
+ *
+ * @param selectionList list of selection items corresponding
+ * to the results to be returned by the query
+ * @return the modified query
+ * @throws IllegalArgumentException if a selection item is
+ * not valid or if more than one selection item has
+ * the same assigned alias
+ */
+ CriteriaQuery<T> multiselect(List<Selection<?>> selectionList);
/**
- * Specify the selection items that are to be returned in the
- * query result.
- * Replaces the previously specified selection(s), if any.
- *
- * The type of the result of the query execution depends on
- * the specification of the type of the criteria query object
- * created as well as the argument to the multiselect method.
- * An element of the list passed to the multiselect method
- * must not be a tuple- or array-valued compound selection item.
- * The semantics of this method are as follows:
- *
- * If the type of the criteria query is CriteriaQuery<Tuple>
- * (i.e., a criteria query object created by either the
- * createTupleQuery method or by passing a Tuple class argument
- * to the createQuery method), a Tuple object corresponding to
- * the elements of the list passed to the multiselect method
- * will be instantiated and returned for each row that results
- * from the query execution.
- *
- * If the type of the criteria query is CriteriaQuery<X> for
- * some user-defined class X (i.e., a criteria query object
- * created by passing a X class argument to the createQuery
- * method), then the elements of the list passed to the
- * multiselect method will be passed to the X constructor and
- * an instance of type X will be returned for each row.
- *
- * If the type of the criteria query is CriteriaQuery<X[]> for
- * some class X, an instance of type X[] will be returned for
- * each row. The elements of the array will correspond to the
- * elements of the list passed to the multiselect method.
- *
- * If the type of the criteria query is CriteriaQuery<Object>
- * or if the criteria query was created without specifying a type,
- * and the list passed to the multiselect method contains only
- * a single element, an instance of type Object will be returned
- * for each row.
- *
- * If the type of the criteria query is CriteriaQuery<Object>
- * or if the criteria query was created without specifying a type,
- * and the list passed to the multiselect method contains more
- * than one element, an instance of type Object[] will be
- * instantiated and returned for each row. The elements of the
- * array will correspond to the elements of the list passed to
- * the multiselect method.
- *
- * @param selectionList list of selection items corresponding
- * to the results to be returned by the query
- * @return the modified query
- */
- CriteriaQuery<T> multiselect(List<Selection<?>> selectionList);
-
-
- /**
* Modify the query to restrict the query result according
* to the specified boolean expression.
* Replaces the previously added restriction(s), if any.
@@ -160,6 +186,19 @@
*/
CriteriaQuery<T> groupBy(Expression<?>... grouping);
+ /**
+ * Specify the expressions that are used to form groups over
+ * the query results.
+ * Replaces the previous specified grouping expressions, if any.
+ * If no grouping expressions are specified, any previously
+ * added grouping expressions are simply removed.
+ * This method only overrides the return type of the
+ * corresponding AbstractQuery method.
+ * @param grouping list of zero or more grouping expressions
+ * @return the modified query
+ */
+ CriteriaQuery<T> groupBy(List<Expression<?>> grouping);
+
/**
* Specify a restriction over the groups of the query.
* Replaces the previous having restriction(s), if any.
@@ -199,6 +238,21 @@
*/
CriteriaQuery<T> orderBy(Order... o);
+ /**
+ * Specify the ordering expressions that are used to
+ * order the query results.
+ * Replaces the previous ordering expressions, if any.
+ * If no ordering expressions are specified, the previous
+ * ordering, if any, is simply removed, and results will
+ * be returned in no particular order.
+ * The order of the ordering expressions in the list
+ * determines the precedence, whereby the first element in the
+ * list has highest precedence.
+ * @param o list of zero or more ordering expressions
+ * @return the modified query.
+ */
+ CriteriaQuery<T> orderBy(List<Order> o);
+
/**
* Specify whether duplicate query results will be eliminated.
* A true value will cause duplicates to be eliminated.
@@ -215,25 +269,19 @@
CriteriaQuery<T> distinct(boolean distinct);
/**
- * Return the result type of the query.
- * If a result type was specified as an argument to the
- * createQuery method, that type will be returned.
- * If the query was created using the createTupleQuery
- * method, the result type is Tuple.
- * Otherwise, the result type is Object.
- * @return result type
+ * Return the ordering expressions in order of precedence.
+ * Returns empty list if no ordering expressions have been
+ * specified.
+ * Modifications to the list do not affect the query.
+ * @return the list of ordering expressions
*/
- Class getResultType();
-
- /**
- * Return the ordering expressions in order of precedence.
- * @return the list of ordering expressions
- */
List<Order> getOrderList();
- /**
- * Return the parameters of the query
- * @return the query parameters
- */
+ /**
+ * Return the parameters of the query. Returns empty set if
+ * there are no parameters.
+ * Modifications to the set do not affect the query.
+ * @return the query parameters
+ */
Set<ParameterExpression<?>> getParameters();
}
Modified: jpa-api/trunk/src/main/java/javax/persistence/criteria/Expression.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/criteria/Expression.java 2009-09-17 17:36:24 UTC (rev 17524)
+++ jpa-api/trunk/src/main/java/javax/persistence/criteria/Expression.java 2009-09-17 20:22:44 UTC (rev 17525)
@@ -11,54 +11,58 @@
public interface Expression<T> extends Selection<T> {
/**
- * Apply a predicate to test whether the expression is null.
- * @return predicate testing whether the expression is null
+ * Create a predicate to test whether the expression is null.
+ * @return predicate testing whether the expression is null
*/
Predicate isNull();
/**
- * Apply a predicate to test whether the expression is not null.
- * @return predicate testing whether the expression is not null.
+ * Create a predicate to test whether the expression is
+ * not null.
+ * @return predicate testing whether the expression is not null.
*/
Predicate isNotNull();
/**
- * Apply a predicate to test whether the expression is a member
- * of the argument list.
- * @param values
- * @return predicate testing for membership in the list
+ * Create a predicate to test whether the expression is a member
+ * of the argument list.
+ * @param values The argument list
+ * @return predicate testing for membership in the list
*/
Predicate in(Object... values);
/**
- * Apply a predicate to test whether the expression is a member
- * of the argument list.
- * @param values
- * @return predicate testing for membership
+ * Create a predicate to test whether the expression is a member
+ * of the argument list.
+ * @param values The argument list
+ * @return predicate testing for membership in the list
*/
Predicate in(Expression<?>... values);
/**
- * Apply a predicate to test whether the expression is a member
- * of the collection.
- * @param values collection
- * @return predicate testing for membership
+ * Create a predicate to test whether the expression is a member
+ * of the collection.
+ * @param values collection
+ * @return predicate testing for membership
*/
Predicate in(Collection<?> values);
/**
- * Apply a predicate to test whether the expression is a member
- * of the collection.
- * @param values expression corresponding to collection
- * @return predicate testing for membership
+ * Create a predicate to test whether the expression is a member
+ * of the collection.
+ * @param values expression corresponding to collection
+ * @return predicate testing for membership
*/
Predicate in(Expression<Collection<?>> values);
/**
- * Perform a typecast upon the expression.
- * Warning: may result in a runtime failure.
- * @param type
- * @return expression
+ * Perform a typecast upon the expression, returning new
+ * expression object.
+ * This method does not cause type conversion:
+ * the runtime type is not changed.
+ * Warning: may result in a runtime failure.
+ * @param type The cast type
+ * @return new expression of the given type
*/
<X> Expression<X> as(Class<X> type);
}
Modified: jpa-api/trunk/src/main/java/javax/persistence/criteria/FetchParent.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/criteria/FetchParent.java 2009-09-17 17:36:24 UTC (rev 17524)
+++ jpa-api/trunk/src/main/java/javax/persistence/criteria/FetchParent.java 2009-09-17 20:22:44 UTC (rev 17525)
@@ -15,42 +15,45 @@
public interface FetchParent<Z, X> {
/**
- * Return the fetch joins that have been made from this type.
- * @return fetch joins made from this type
+ * Return the fetch joins that have been made from this type.
+ * Returns empty set if no fetch joins have been made from
+ * this type.
+ * Modifications to the set do not affect the query.
+ * @return fetch joins made from this type
*/
java.util.Set<Fetch<X, ?>> getFetches();
/**
- * Fetch join to the specified single-valued attribute
- * using an inner join.
- * @param attribute target of the join
- * @return the resulting fetch join
+ * Create a fetch join to the specified single-valued attribute
+ * using an inner join.
+ * @param attribute target of the join
+ * @return the resulting fetch join
*/
<Y> Fetch<X, Y> fetch(SingularAttribute<? super X, Y> attribute);
/**
- * Fetch join to the specified single-valued attribute using
- * the given join type.
- * @param attribute target of the join
- * @param jt join type
- * @return the resulting fetch join
+ * Create a fetch join to the specified single-valued attribute
+ * using the given join type.
+ * @param attribute target of the join
+ * @param jt join type
+ * @return the resulting fetch join
*/
<Y> Fetch<X, Y> fetch(SingularAttribute<? super X, Y> attribute, JoinType jt);
/**
- * Fetch join to the specified collection-valued attribute
- * using an inner join.
- * @param attribute target of the join
- * @return the resulting join
+ * Create a fetch join to the specified collection-valued attribute
+ * using an inner join.
+ * @param attribute target of the join
+ * @return the resulting join
*/
<Y> Fetch<X, Y> fetch(PluralAttribute<? super X, ?, Y> attribute);
/**
- * Fetch join to the specified collection-valued attribute
- * using the given join type.
- * @param attribute target of the join
- * @param jt join type
- * @return the resulting join
+ * Create a fetch join to the specified collection-valued attribute
+ * using the given join type.
+ * @param attribute target of the join
+ * @param jt join type
+ * @return the resulting join
*/
<Y> Fetch<X, Y> fetch(PluralAttribute<? super X, ?, Y> attribute, JoinType jt);
@@ -58,32 +61,26 @@
//String-based:
/**
- * Fetch join to the specified attribute using an inner join.
- *
- * @param <X> The type of the source of the fetch; note that this method-local <X> hides the <X> defined as a type
- * param to {@link FetchParent}; the expectation is that the two types match.
- * @param <Y> The type of the fetched attribute/association
- * @param attributeName name of the attribute for the
- * target of the join
- * @return the resulting fetch join
- * @throws IllegalArgumentException if attribute of the given
- * name does not exist
+ * Create a fetch join to the specified attribute using an
+ * inner join.
+ * @param attributeName name of the attribute for the
+ * target of the join
+ * @return the resulting fetch join
+ * @throws IllegalArgumentException if attribute of the given
+ * name does not exist
*/
<X, Y> Fetch<X, Y> fetch(String attributeName);
/**
- * Fetch join to the specified attribute using the given
+ * Create a fetch join to the specified attribute using the given
* join type.
*
- * @param <X> The type of the source of the fetch; note that this method-local <X> hides the <X> defined as a type
- * param to {@link FetchParent}; the expectation is that the two types match.
- * @param <Y> The type of the fetched attribute/association
- * @param attributeName name of the attribute for the
- * target of the join
- * @param jt join type
- * @return the resulting fetch join
- * @throws IllegalArgumentException if attribute of the given
- * name does not exist
+ * @param attributeName name of the attribute for the
+ * target of the join
+ * @param jt join type
+ * @return the resulting fetch join
+ * @throws IllegalArgumentException if attribute of the given
+ * name does not exist
*/
<X, Y> Fetch<X, Y> fetch(String attributeName, JoinType jt);
}
Modified: jpa-api/trunk/src/main/java/javax/persistence/criteria/From.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/criteria/From.java 2009-09-17 17:36:24 UTC (rev 17524)
+++ jpa-api/trunk/src/main/java/javax/persistence/criteria/From.java 2009-09-17 20:22:44 UTC (rev 17525)
@@ -21,93 +21,94 @@
public interface From<Z, X> extends Path<X>, FetchParent<Z, X> {
/**
- * Return the joins that have been made from this type.
- * @return joins made from this type
+ * Return the joins that have been made from this bound type.
+ * Does not include joins from map keys, if any.
+ * Returns empty set if no joins have been made from this
+ * bound type.
+ * Modifications to the set do not affect the query.
+ * @return joins made from this type
*/
java.util.Set<Join<X, ?>> getJoins();
/**
- * Join to the specified single-valued attribute using an
- * inner join.
- * @param attribute target of the join
- * @return the resulting join
+ * Create an inner join to the specified single-valued
+ * attribute.
+ * @param attribute target of the join
+ * @return the resulting join
*/
<Y> Join<X, Y> join(SingularAttribute<? super X, Y> attribute);
/**
- * Join to the specified single-valued attribute using the
- * given join type.
- * @param attribute target of the join
- * @param jt join type
- * @return the resulting join
+ * Create a join to the specified single-valued attribute
+ * using the given join type.
+ * @param attribute target of the join
+ * @param jt join type
+ * @return the resulting join
*/
<Y> Join<X, Y> join(SingularAttribute<? super X, Y> attribute, JoinType jt);
/**
- * Join to the specified Collection-valued attribute using
- * an inner join.
- * @param collection target of the join
- * @return the resulting join
+ * Create an inner join to the specified Collection-valued
+ * attribute.
+ * @param collection target of the join
+ * @return the resulting join
*/
<Y> CollectionJoin<X, Y> join(CollectionAttribute<? super X, Y> collection);
/**
- * Join to the specified Set-valued attribute using an inner
- * join.
- * @param set target of the join
- * @return the resulting join
+ * Create an inner join to the specified Set-valued attribute.
+ * @param set target of the join
+ * @return the resulting join
*/
<Y> SetJoin<X, Y> join(SetAttribute<? super X, Y> set);
/**
- * Join to the specified List-valued attribute using an inner
- * join.
- * @param list target of the join
- * @return the resulting join
+ * Create an inner join to the specified List-valued attribute.
+ * @param list target of the join
+ * @return the resulting join
*/
<Y> ListJoin<X, Y> join(ListAttribute<? super X, Y> list);
/**
- * Join to the specified Map-valued attribute using an inner
- * join.
- * @param map target of the join
- * @return the resulting join
+ * Create an inner join to the specified Map-valued attribute.
+ * @param map target of the join
+ * @return the resulting join
*/
<K, V> MapJoin<X, K, V> join(MapAttribute<? super X, K, V> map);
/**
- * Join to the specified Collection-valued attribute
- * using the given join type.
- * @param collection target of the join
- * @param jt join type
- * @return the resulting join
+ * Create a join to the specified Collection-valued attribute
+ * using the given join type.
+ * @param collection target of the join
+ * @param jt join type
+ * @return the resulting join
*/
<Y> CollectionJoin<X, Y> join(CollectionAttribute<? super X, Y> collection, JoinType jt);
/**
- * Join to the specified Set-valued attribute using the given
- * join type.
- * @param set target of the join
- * @param jt join type
- * @return the resulting join
+ * Create a join to the specified Set-valued attribute using
+ * the given join type.
+ * @param set target of the join
+ * @param jt join type
+ * @return the resulting join
*/
<Y> SetJoin<X, Y> join(SetAttribute<? super X, Y> set, JoinType jt);
/**
- * Join to the specified List-valued attribute using the
- * given join type.
- * @param list target of the join
- * @param jt join type
- * @return the resulting join
+ * Create a join to the specified List-valued attribute using
+ * the given join type.
+ * @param list target of the join
+ * @param jt join type
+ * @return the resulting join
*/
<Y> ListJoin<X, Y> join(ListAttribute<? super X, Y> list, JoinType jt);
/**
- * Join to the specified Map-valued attribute using the
- * given join type.
- * @param map target of the join
- * @param jt join type
- * @return the resulting join
+ * Create a join to the specified Map-valued attribute using
+ * the given join type.
+ * @param map target of the join
+ * @param jt join type
+ * @return the resulting join
*/
<K, V> MapJoin<X, K, V> join(MapAttribute<? super X, K, V> map, JoinType jt);
Modified: jpa-api/trunk/src/main/java/javax/persistence/criteria/ListJoin.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/criteria/ListJoin.java 2009-09-17 17:36:24 UTC (rev 17524)
+++ jpa-api/trunk/src/main/java/javax/persistence/criteria/ListJoin.java 2009-09-17 20:22:44 UTC (rev 17525)
@@ -13,24 +13,23 @@
* @param <Z> The source type of the join
* @param <E> The element type of the target List
*/
-public interface ListJoin<Z, E>
- extends PluralJoin<Z, List<E>, E> {
+public interface ListJoin<Z, E> extends PluralJoin<Z, List<E>, E> {
/**
* Return the metamodel representation for the list attribute.
* @return metamodel type representing the List that is
- * the target of the join
+ * the target of the join
*/
ListAttribute<? super Z, E> getModel();
/**
- * Return an expression that corresponds to the index of
- * the object in the referenced association or element
- * collection.
- * This method must only be invoked upon an object that
- * represents an association or element collection for
- * which an order column has been defined.
- * @return expression denoting the index
+ * Create an expression that corresponds to the index of
+ * the object in the referenced association or element
+ * collection.
+ * This method must only be invoked upon an object that
+ * represents an association or element collection for
+ * which an order column has been defined.
+ * @return expression denoting the index
*/
Expression<Integer> index();
}
\ No newline at end of file
Modified: jpa-api/trunk/src/main/java/javax/persistence/criteria/MapJoin.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/criteria/MapJoin.java 2009-09-17 17:36:24 UTC (rev 17524)
+++ jpa-api/trunk/src/main/java/javax/persistence/criteria/MapJoin.java 2009-09-17 20:22:44 UTC (rev 17525)
@@ -14,8 +14,7 @@
* @param <K> The type of the target Map key
* @param <V> The type of the target Map value
*/
-public interface MapJoin<Z, K, V>
- extends PluralJoin<Z, Map<K, V>, V> {
+public interface MapJoin<Z, K, V> extends PluralJoin<Z, Map<K, V>, V> {
/**
* Return the metamodel representation for the map attribute.
@@ -25,35 +24,35 @@
MapAttribute<? super Z, K, V> getModel();
/**
- * Specify an inner join over the map key.
- * @return result of joining over the map key
+ * Create an inner join over the map key.
+ * @return result of joining over the map key
*/
Join<Map<K, V>, K> joinKey();
/**
- * Specify a join over the map key using the given
- * join type.
- * @param jt join type
- * @return result of joining over the map key
+ * Create a join over the map key using the given
+ * join type.
+ * @param jt join type
+ * @return result of joining over the map key
*/
Join<Map<K, V>, K> joinKey(JoinType jt);
/**
- * Return a path expression that corresponds to the map key.
- * @return path corresponding to map key
+ * Create a path expression that corresponds to the map key.
+ * @return path corresponding to map key
*/
Path<K> key();
/**
- * Return a path expression that corresponds to the map value.
- * This method is for stylistic use only: it just returns this.
- * @return path corresponding to the map value
+ * Create a path expression that corresponds to the map value.
+ * This method is for stylistic use only: it just returns this.
+ * @return path corresponding to the map value
*/
Path<V> value();
/**
- * Return an expression that corresponds to the map entry.
- * @return expression corresponding to the map entry
+ * Create an expression that corresponds to the map entry.
+ * @return expression corresponding to the map entry
*/
Expression<Map.Entry<K, V>> entry();
}
Modified: jpa-api/trunk/src/main/java/javax/persistence/criteria/ParameterExpression.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/criteria/ParameterExpression.java 2009-09-17 17:36:24 UTC (rev 17524)
+++ jpa-api/trunk/src/main/java/javax/persistence/criteria/ParameterExpression.java 2009-09-17 20:22:44 UTC (rev 17525)
@@ -9,5 +9,6 @@
* Type of criteria query parameter expressions.
* @param <T> the type of the parameter expression
*/
-public interface ParameterExpression<T> extends Parameter<T>, Expression<T> {}
+public interface ParameterExpression<T> extends Parameter<T>, Expression<T> {
+}
Modified: jpa-api/trunk/src/main/java/javax/persistence/criteria/Path.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/criteria/Path.java 2009-09-17 17:36:24 UTC (rev 17524)
+++ jpa-api/trunk/src/main/java/javax/persistence/criteria/Path.java 2009-09-17 20:22:44 UTC (rev 17525)
@@ -60,15 +60,35 @@
//String-based:
- /**
- * Return the path corresponding to the referenced
- * attribute.
- * @param attributeName name of the attribute
- * @return path corresponding to the referenced attribute
- * @throws IllegalStateException if invoked on a path that
- * corresponds to a basic type
- * @throws IllegalArgumentException if attribute of the given
- * name does not otherwise exist
- */
- <Y> Path<Y> get(String attributeName);
+ /**
+ * Create a path corresponding to the referenced attribute.
+ *
+ * Note: Applications using the string-based API may need to
+ * specify the type resulting from the get operation in order
+ * to avoid the use of Path variables.
+ *
+ * For example:
+ *
+ * CriteriaQuery<Person> q = qb.createQuery(Person.class);
+ * Root<Person> p = q.from(Person.class);
+ * q.select(p)
+ * .where(qb.isMember(qb.literal("joe"),
+ * p.<Set<String>>get("nicknames")));
+ *
+ * rather than:
+ *
+ * CriteriaQuery<Person> q = qb.createQuery(Person.class);
+ * Root<Person> p = q.from(Person.class);
+ * Path<Set<String>> nicknames = p.get("nicknames");
+ * q.select(p)
+ * .where(qb.isMember(qb.literal("joe"), nicknames));
+ *
+ * @param attributeName name of the attribute
+ * @return path corresponding to the referenced attribute
+ * @throws IllegalStateException if invoked on a path that
+ * corresponds to a basic type
+ * @throws IllegalArgumentException if attribute of the given
+ * name does not otherwise exist
+ */
+ <Y> Path<Y> get(String attributeName);
}
Modified: jpa-api/trunk/src/main/java/javax/persistence/criteria/Predicate.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/criteria/Predicate.java 2009-09-17 17:36:24 UTC (rev 17524)
+++ jpa-api/trunk/src/main/java/javax/persistence/criteria/Predicate.java 2009-09-17 20:22:44 UTC (rev 17525)
@@ -31,7 +31,10 @@
/**
* Return the top-level conjuncts or disjuncts of the predicate.
- * @return list of boolean expressions forming the predicate
+ * Returns empty list if there are no top-level conjuncts or
+ * disjuncts of the predicate.
+ * Modifications to the list do not affect the query.
+ * @return list of boolean expressions forming the predicate
*/
List<Expression<Boolean>> getExpressions();
Modified: jpa-api/trunk/src/main/java/javax/persistence/criteria/QueryBuilder.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/criteria/QueryBuilder.java 2009-09-17 17:36:24 UTC (rev 17524)
+++ jpa-api/trunk/src/main/java/javax/persistence/criteria/QueryBuilder.java 2009-09-17 20:22:44 UTC (rev 17525)
@@ -239,6 +239,16 @@
Predicate and(Expression<Boolean> x, Expression<Boolean> y);
/**
+ * Create a conjunction of the given restriction predicates.
+ * A conjunction of zero predicates is true.
+ *
+ * @param restrictions zero or more restriction predicates
+ *
+ * @return and predicate
+ */
+ Predicate and(Predicate... restrictions);
+
+ /**
* Create a disjunction of the given boolean expressions.
*
* @param x boolean expression
@@ -250,19 +260,9 @@
/**
* Create a conjunction of the given restriction predicates.
- * A conjunction of zero predicates is true.
- *
- * @param restriction zero or more restriction predicates
- *
- * @return and predicate
- */
- Predicate and(Predicate... restrictions);
-
- /**
- * Create a conjunction of the given restriction predicates.
* A disjunction of zero predicates is false.
*
- * @param restriction zero or more restriction predicates
+ * @param restrictions zero or more restriction predicates
*
* @return or predicate
*/
Modified: jpa-api/trunk/src/main/java/javax/persistence/criteria/Subquery.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/criteria/Subquery.java 2009-09-17 17:36:24 UTC (rev 17524)
+++ jpa-api/trunk/src/main/java/javax/persistence/criteria/Subquery.java 2009-09-17 20:22:44 UTC (rev 17525)
@@ -2,6 +2,8 @@
// EJB3 Specification Copyright 2004-2009 Sun Microsystems, Inc.
package javax.persistence.criteria;
+import java.util.List;
+
/**
* The Subquery interface defines functionality that is
* specific to subqueries.
@@ -12,12 +14,6 @@
public interface Subquery<T> extends AbstractQuery<T>, Expression<T> {
/**
- * Return the query of which this is a subquery.
- * @return the enclosing query or subquery
- */
- AbstractQuery<?> getParent();
-
- /**
* Specify the item that is to be returned in the query result.
* Replaces the previously specified selection, if any.
* @param expression expression specifying the item that
@@ -63,6 +59,19 @@
*/
Subquery<T> groupBy(Expression<?>... grouping);
+ /**
+ * Specify the expressions that are used to form groups over
+ * the subquery results.
+ * Replaces the previous specified grouping expressions, if any.
+ * If no grouping expressions are specified, any previously
+ * added grouping expressions are simply removed.
+ * This method only overrides the return type of the
+ * corresponding AbstractQuery method.
+ * @param grouping list of zero or more grouping expressions
+ * @return the modified subquery
+ */
+ Subquery<T> groupBy(List<Expression<?>> grouping);
+
/**
* Specify a restriction over the groups of the subquery.
* Replaces the previous having restriction(s), if any.
@@ -103,67 +112,73 @@
Subquery<T> distinct(boolean distinct);
/**
- * Return the selection expression.
- * @return the item to be returned in the subquery result
+ * Create a subquery root correlated to a root of the
+ * enclosing query.
+ * @param parentRoot a root of the containing query
+ * @return subquery root
*/
- Expression<T> getSelection();
-
- /**
- * Correlate a root of the enclosing query to a root of
- * the subquery and return the subquery root.
- * @param parentRoot a root of the containing query
- * @return subquery root
- */
<Y> Root<Y> correlate(Root<Y> parentRoot);
/**
- * Correlate a join of the enclosing query to a join of
- * the subquery and return the subquery join.
- * @param parentJoin join target of the containing query
- * @return subquery join
- */
+ * Create a subquery join object correlated to a join object
+ * of the enclosing query.
+ * @param parentJoin join object of the containing query
+ * @return subquery join
+ */
<X, Y> Join<X, Y> correlate(Join<X, Y> parentJoin);
/**
- * Correlate a join to a Collection-valued association or
- * element collection in the enclosing query to a join of
- * the subquery and return the subquery join.
- * @param parentCollection join target of the containing query
- * @return subquery join
+ * Create a subquery collection join object correlated to a
+ * collection join object of the enclosing query.
+ * @param parentCollection join object of the containing query
+ * @return subquery join
*/
<X, Y> CollectionJoin<X, Y> correlate(CollectionJoin<X, Y> parentCollection);
/**
- * Correlate a join to a Set-valued association or
- * element collection in the enclosing query to a join of
- * the subquery and return the subquery join.
- * @param parentSet join target of the containing query
- * @return subquery join
+ * Create a subquery set join object correlated to a set join
+ * object of the enclosing query.
+ * @param parentSet join object of the containing query
+ * @return subquery join
*/
<X, Y> SetJoin<X, Y> correlate(SetJoin<X, Y> parentSet);
/**
- * Correlate a join to a List-valued association or
- * element collection in the enclosing query to a join of
- * the subquery and return the subquery join.
- * @param parentList join target of the containing query
- * @return subquery join
+ * Create a subquery list join object correlated to a list join
+ * object of the enclosing query.
+ * @param parentList join object of the containing query
+ * @return subquery join
*/
<X, Y> ListJoin<X, Y> correlate(ListJoin<X, Y> parentList);
/**
- * Correlate a join to a Map-valued association or
- * element collection in the enclosing query to a join of
- * the subquery and return the subquery join.
- * @param parentMap join target of the containing query
- * @return subquery join
+ * Create a subquery map join object correlated to a map join
+ * object of the enclosing query.
+ * @param parentMap join object of the containing query
+ * @return subquery join
*/
<X, K, V> MapJoin<X, K, V> correlate(MapJoin<X, K, V> parentMap);
/**
- * Return the joins that have been made from the subquery.
- * @return joins made from this type
+ * Return the query of which this is a subquery.
+ * @return the enclosing query or subquery
*/
+ AbstractQuery<?> getParent();
+
+ /**
+ * Return the selection expression.
+ * @return the item to be returned in the subquery result
+ */
+ Expression<T> getSelection();
+
+ /**
+ * Return the joins that have been made from the subquery.
+ * Does not include joins from map keys, if any.
+ * Returns empty set if there are no joins made from the
+ * subquery.
+ * Modifications to the set do not affect the query.
+ * @return joins made from this type
+ */
java.util.Set<Join<?, ?>> getCorrelatedJoins();
}
\ No newline at end of file
16 years
Hibernate SVN: r17524 - core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytoone.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-17 13:36:24 -0400 (Thu, 17 Sep 2009)
New Revision: 17524
Modified:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytoone/ManyToOneTest.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytoone/Order.java
Log:
JBPAPP-1075 - Removed unique constraint on order number.
Also removed an empty test method.
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytoone/ManyToOneTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytoone/ManyToOneTest.java 2009-09-16 15:51:58 UTC (rev 17523)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytoone/ManyToOneTest.java 2009-09-17 17:36:24 UTC (rev 17524)
@@ -208,7 +208,7 @@
s = openSession();
tx = s.beginTransaction();
- //FIXME: fix this when the small parser bug will be fixed
+ //FIXME: fix this when the small parser bug will be fixed
Query q = s.createQuery( "from " + Child.class.getName() ); //+ " c where c.parent.id.lastName = :lastName");
//q.setString("lastName", p.id.lastName);
List result = q.list();
@@ -249,10 +249,6 @@
s.close();
}
- public void testManyToOneAndIdClass() throws Exception {
-
- }
-
public void testManyToOneNonPk() throws Exception {
Session s = openSession();
Transaction tx = s.beginTransaction();
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytoone/Order.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytoone/Order.java 2009-09-16 15:51:58 UTC (rev 17523)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/manytoone/Order.java 2009-09-17 17:36:24 UTC (rev 17524)
@@ -30,7 +30,7 @@
this.id = id;
}
- @Column(name="order_nbr", unique = true)
+ @Column(name="order_nbr")
public String getOrderNbr() {
return orderNbr;
}
16 years
Hibernate SVN: r17523 - in validator/trunk/hibernate-validator/src/main/docbook/en-US: images and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-16 11:51:58 -0400 (Wed, 16 Sep 2009)
New Revision: 17523
Added:
validator/trunk/hibernate-validator/src/main/docbook/en-US/images/application-layers2.png
Modified:
validator/trunk/hibernate-validator/src/main/docbook/en-US/images/application-layers.png
validator/trunk/hibernate-validator/src/main/docbook/en-US/master.xml
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/bootstrapping.xml
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/gettingstarted.xml
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/integration.xml
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml
Log:
HV-220
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/images/application-layers.png
===================================================================
(Binary files differ)
Added: validator/trunk/hibernate-validator/src/main/docbook/en-US/images/application-layers2.png
===================================================================
(Binary files differ)
Property changes on: validator/trunk/hibernate-validator/src/main/docbook/en-US/images/application-layers2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/master.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/master.xml 2009-09-16 14:51:56 UTC (rev 17522)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/master.xml 2009-09-16 15:51:58 UTC (rev 17523)
@@ -80,6 +80,17 @@
is available for both server-side application programming, as well as rich
client Swing application developers.</para>
+ <para><mediaobject>
+ <imageobject role="fo">
+ <imagedata align="center" contentdepth="" contentwidth="150mm"
+ fileref="application-layers2.png" scalefit="" />
+ </imageobject>
+
+ <imageobject role="html">
+ <imagedata depth="" fileref="application-layers2.png" scalefit="1" />
+ </imageobject>
+ </mediaobject></para>
+
<para>Hibernate Validator is the reference implementation of this
JSR.</para>
</preface>
@@ -115,6 +126,8 @@
url="http://anonsvn.jboss.org/repos/hibernate/validator/trunk">SVN
repository</ulink>. Alternatively you can view the tests using <ulink
url="http://fisheye.jboss.org/browse/Hibernate/beanvalidation/trunk/validation...">Hibernate's
- fisheye</ulink> installation.</para>
+ fisheye</ulink> installation. The JSR 303 specification itself is also a
+ great way to deepen your understanding of Bean Validation resp. Hibernate
+ Validator.</para>
</chapter>
</book>
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/bootstrapping.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/bootstrapping.xml 2009-09-16 14:51:56 UTC (rev 17522)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/bootstrapping.xml 2009-09-16 15:51:58 UTC (rev 17523)
@@ -28,17 +28,16 @@
<chapter id="validator-bootstrapping">
<title>Bootstrapping</title>
- <para>We already discussed in <xref linkend="section-validator-instance" />
- how to create a <classname>Validator</classname> instance using the
- different methods in <classname>javax.validation.Validation</classname>. In
- this chapter we have a closer look and discuss the different configuration
- possibilities available via the <classname>Configuration</classname>
- object.</para>
+ <para>We already seen in <xref linkend="section-validator-instance" /> the
+ easiest way to create a <classname>Validator</classname> instance -
+ <methodname>Validation.buildDefaultValidatorFactory</methodname>. In this
+ chapter we have a look at the other methods in
+ <classname>javax.validation.Validation</classname> and how they allow to
+ configure several aspects of Bean Validation at bootstrapping time.</para>
- <para>One requirement of the Bean Validation framework is that each
- implementation (including Hibernate Validator) must be able to bootstrap any
- other Bean Validation implementation on the classpath. The available
- providers are discovered by the <ulink
+ <para>The different bootstrapping options allwow, amongst other things, to
+ bootstrap any Bean Validation implementation on the classpath. Generally, an
+ available provider is discovered by the <ulink
url="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service%20Provider">Java
Service Provider</ulink> mechanism. A Bean Validation implementation
includes the file
@@ -57,6 +56,61 @@
used.</para>
</note></para>
+ <section id="section-validator-instance">
+ <title><classname>Configuration</classname> and
+ <classname>ValidatorFactory</classname></title>
+
+ <para>There are three different methods in the Validation class to create
+ a Validator instance. The easiest in shown in <xref
+ linkend="example-build-default-validator-factory" />.<example
+ id="example-build-default-validator-factory">
+ <title>Validation.buildDefaultValidatorFactory()</title>
+
+ <programlisting>ValidatorFactory factory = <emphasis role="bold">Validation.buildDefaultValidatorFactory()</emphasis>;
+Validator validator = factory.getValidator();</programlisting>
+ </example>You can also use the method
+ <methodname>Validation.byDefaultProvider()</methodname> which will allow
+ you to configure several aspects of the created Validator
+ instance:<example>
+ <title>Validation.byDefaultProvider()</title>
+
+ <programlisting>Configuration<?> config = <emphasis role="bold">Validation.byDefaultProvider()</emphasis>.configure();
+config.messageInterpolator(new MyMessageInterpolator())
+ .traversableResolver( new MyTraversableResolver())
+ .constraintValidatorFactory(new MyConstraintValidatorFactory());
+
+ValidatorFactory factory = config.buildValidatorFactory();
+Validator validator = factory.getValidator();
+</programlisting>
+ </example>We will learn more about
+ <classname>MessageInterpolator</classname>,
+ <classname>TraversableResolver</classname> and
+ <classname>ConstraintValidatorFactory</classname> in the following
+ sections.</para>
+
+ <para>Last but not least you can ask for a Configuration object of a
+ specific Bean Validation provider. This is useful if you have more than
+ one Bean Validation provider in your classpath. In this situation you can
+ make an explicit choice about which implementation to use. In the case of
+ Hibernate Validator the <classname>Validator</classname> creation looks
+ like:<example>
+ <title>Validation.byProvider( HibernateValidator.class )</title>
+
+ <programlisting>ValidatorConfiguration config = <emphasis role="bold">Validation.byProvider( HibernateValidator.class )</emphasis>.configure();
+config.messageInterpolator(new MyMessageInterpolator())
+ .traversableResolver( new MyTraversableResolver())
+ .constraintValidatorFactory(new MyConstraintValidatorFactory());
+
+ValidatorFactory factory = config.buildValidatorFactory();
+Validator validator = factory.getValidator();</programlisting>
+ </example></para>
+
+ <para><tip>
+ <para>The generated <classname>Validator</classname> instance is
+ thread safe and can be cached.</para>
+ </tip></para>
+ </section>
+
<section>
<title><classname>ValidationProviderResolver</classname></title>
@@ -64,8 +118,7 @@
in your environment or you have a special classloader setup, you are able
to provide a custom <classname>ValidationProviderResolver</classname>. An
example in an OSGi environment you could plug your custom provider
- resolver like seen in <xref linkend="example-provider-resolver" />.
- </para>
+ resolver like seen in <xref linkend="example-provider-resolver" />.</para>
<para><example id="example-provider-resolver">
<title>Providing a custom ValidationProviderResolver</title>
@@ -135,7 +188,7 @@
<title><classname>TraversableResolver</classname></title>
<para>The usage of the <classname>TraversableResolver</classname> has so
- far been not be discussed. The idea is that In some cases, the state of a
+ far not been discussed. The idea is that in some cases, the state of a
property should not be accessed. The most obvious example for that is a
lazy loaded property or association of a Java Persistence provider.
Validating this lazy property or association would mean that its state
@@ -208,7 +261,7 @@
true for <methodname>isReachable()</methodname> and
i<methodname>sTraversable()</methodname>. The second is the
<classname>JPATraversableResolver</classname> which gets enabled when
- Hibernate Validator gets used in combination with JPA2. In case you have
+ Hibernate Validator gets used in combination with JPA 2. In case you have
to provide your own resolver you can do so again using the
<classname>Configuration</classname> object as seen in <xref
linkend="example-traversable-resolver-config" />.<example
@@ -234,8 +287,8 @@
Hibernate Validator requires a public no-arg constructor to instantiate
<classname>ConstraintValidator</classname> instances (see <xref
linkend="section-constraint-validator" />). Using a custom
- <classname>ConstraintValidatorFactory</classname> offers the possibility
- to use dependency injection in constraint implementations. The
+ <classname>ConstraintValidatorFactory</classname> offers for example the
+ possibility to use dependency injection in constraint implementations. The
configuration of the custom factory is once more via the
<classname>Configuration</classname> (<xref
linkend="example-constraint-validator-factory" />).</para>
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/gettingstarted.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/gettingstarted.xml 2009-09-16 14:51:56 UTC (rev 17522)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/gettingstarted.xml 2009-09-16 15:51:58 UTC (rev 17523)
@@ -42,8 +42,8 @@
</listitem>
<listitem>
- <para>A functioning Internet connection (Maven has to download all
- required libraries)</para>
+ <para>An Internet connection (Maven has to download all required
+ libraries)</para>
</listitem>
<listitem>
@@ -81,15 +81,15 @@
<para>When presented with the list of available archetypes in the JBoss
Maven Repository select the
- <emphasis>hibernate-validator-quickstart-archetype. </emphasis>After
- downloading all dependencies confirm the settings by just pressing enter.
- Maven will create your project in the directory
+ <emphasis>hibernate-validator-quickstart-archetype. </emphasis>After Maven
+ has downloaded all dependencies confirm the settings by just pressing
+ enter. Maven will create your project in the directory
<filename>beanvalidation-gettingstarted</filename>. Change into this
directory and run:</para>
<para><programlisting>mvn test</programlisting>Maven will compile the
- example code and run some unit tests. Let's have a look at the actual
- code.</para>
+ example code and run the implemented unit tests. Let's have a look at the
+ actual code.</para>
</section>
<section id="validator-gettingstarted-createmodel" revision="1">
@@ -231,9 +231,9 @@
<classname>Validator</classname> instance from the
<classname>ValidatorFactory</classname>. A
<classname>Validator</classname> instance is thread-safe and may be reused
- multiple times, therefore we store it as field of our test class. We can
- use the <classname>Validator</classname> now to validate the different car
- instances in the test methods.</para>
+ multiple times. For this reason we store it as field of our test class. We
+ can use the <classname>Validator</classname> now to validate the different
+ car instances in the test methods.</para>
<para>The <methodname>validate()</methodname> method returns a set of
<classname>ConstraintViolation</classname> instances, which we can iterate
@@ -273,7 +273,7 @@
<para>That concludes our 5 minute tour through the world of Hibernate
Validator. Continue exploring the code or look at further examples
referenced in <xref linkend="chapter-further-reading" />. To get a deeper
- understanding of the Bean Validation just continue reading .<xref
+ understanding of the Bean Validation just continue reading.<xref
linkend="validator-usingvalidator" />. In case your application has
specific validation requirements have a look at <xref
linkend="validator-customconstraints" />.</para>
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/integration.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/integration.xml 2009-09-16 14:51:56 UTC (rev 17522)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/integration.xml 2009-09-16 15:51:58 UTC (rev 17523)
@@ -33,9 +33,6 @@
annotated domain model) and checked in various different layers of the
application.</para>
- <para>This chapter will cover Hibernate Validator usage for different
- layers</para>
-
<section id="validator-checkconstraints-db" revision="2">
<title>Database schema-level validation</title>
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml 2009-09-16 14:51:56 UTC (rev 17522)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml 2009-09-16 15:51:58 UTC (rev 17523)
@@ -30,9 +30,9 @@
<para>In this chapter we will see in more detail how to use Hibernate
Validator to validate constraints for a given entity model. We will also
- learn which default constraints the specification provides and which
- additional constraints are only provided by Hibernate Validator. Let's start
- with how to add constraints to an entity.</para>
+ learn which default constraints the Bean Validation specification provides
+ and which additional constraints are only provided by Hibernate Validator.
+ Let's start with how to add constraints to an entity.</para>
<section id="validator-usingvalidator-annotate" revision="1">
<title>Defining constraints</title>
@@ -40,11 +40,11 @@
<para>Constraints in Bean Validation are expressed via Java annotations.
In this section we show how to annotate an object model with these
annotations. We have to differentiate between three different type of
- constraint annotations - class-, field- and property-level
+ constraint annotations - field-, property-, and class-level
annotations.</para>
<note>
- <para>Not all constraints can be placed on any of these levels. In fact
+ <para>Not all constraints can be placed on all of these levels. In fact,
none of the default constraints defined by Bean Validation can be placed
at class level. The <classname>java.lang.annotation.Target</classname>
annotation in the constraint annotation itself determines on which
@@ -53,72 +53,14 @@
</note>
<section>
- <title id="validator-usingvalidator-classlevel">Class-level
- constraints</title>
-
- <para>When a constraint annotation is placed on class level the class
- instance itself passed to the
- <classname>ConstraintValidator</classname>. Class level constraints are
- useful if it is necessary to inspect more than a single property of the
- class to validate it or if a correlation between different state
- variables has to be evaluated. In the following example we add the
- properties <property>horsePower</property> and
- <property>kiloWatt</property> to the class <classname>Car</classname>.
- We also add the constraint <classname>ValidCar</classname> to the class
- itself. We will later see how we can actually create this custom
- constraint (see <xref linkend="validator-customconstraints" />). For now
- we it is enough to know that <classname>ValidCar</classname> will ensure
- that the following holds <constant>true</constant>:
- <property>kiloWatt</property> == 0.7456 *
- <property>horsePower</property>.</para>
-
- <para><example xreflabel="Car-example">
- <title>Class Car with added horsePower and killoWatt
- properties</title>
-
- <programlisting language="Java">package com.mycompany;
-
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-
-<emphasis role="bold">@ValidCar</emphasis>
-public class Car {
-
- @NotNull
- private String manufacturer;
-
- @NotNull
- @Size(min = 2, max = 14)
- private String licensePlate;
-
- @Min(2)
- private int seatCount;
-
- private int horsePower;
-
- private double kiloWatt;
-
- public Car(String manufacturer, String licencePlate, int seatCount) {
- this.manufacturer = manufacturer;
- this.licensePlate = licencePlate;
- this.seatCount = seatCount;
- }
-
- //getters and setters ...
-}</programlisting>
- </example></para>
- </section>
-
- <section>
<title>Field-level constraints</title>
- <para>Constraints can also be expressed by annotating a field of a
- class. <xref linkend="example-field-level" /> shows a field level
- configuration example:</para>
+ <para>Constraints can be expressed by annotating a field of a class.
+ <xref linkend="example-field-level" /> shows a field level configuration
+ example:</para>
<example id="example-field-level">
- <title>Example for field level constraints</title>
+ <title>Field level constraint</title>
<programlisting>package com.mycompany;
@@ -141,8 +83,8 @@
</example>
<para>When using field level constraints field access strategy is used
- to access the value to be validated. This means the bean validation
- provider accesses the instance variable directly.</para>
+ to access the value to be validated. This means the instance variable
+ directly independed of the access type.</para>
<note>
<para>The access type (private, protected or public) does not
@@ -161,14 +103,14 @@
url="http://java.sun.com/javase/technologies/desktop/javabeans/index.jsp">JavaBeans</ulink>
standard, it is also possible to annotate the properties of a bean class
instead of its fields. <xref linkend="example-property-level" /> uses
- the same entity as in the field-level constraint, however, property
- level constraints are used.<note>
+ the same entity as in <xref linkend="example-field-level" />, however,
+ property level constraints are used.<note>
<para>The property's getter method has to be annotated, not its
setter.</para>
</note></para>
<example id="example-property-level">
- <title>Example for property level constraints</title>
+ <title>Property level constraint</title>
<programlisting>package com.mycompany;
@@ -221,6 +163,60 @@
</section>
<section>
+ <title id="validator-usingvalidator-classlevel">Class-level
+ constraints</title>
+
+ <para>Last but not least, a constraint can also be placed on class
+ level. When a constraint annotation is placed on this level the class
+ instance itself passed to the
+ <classname>ConstraintValidator</classname>. Class level constraints are
+ useful if it is necessary to inspect more than a single property of the
+ class to validate it or if a correlation between different state
+ variables has to be evaluated. In <xref linkend="Car-example" /> we add
+ the property <property>passengers</property> to the class
+ <classname>Car</classname>. We also add the constraint
+ <classname>PassengerCount</classname> on the class level. We will later
+ see how we can actually create this custom constraint (see <xref
+ linkend="validator-customconstraints" />). For now we it is enough to
+ know that <classname>PassengerCount</classname> will ensure that there
+ cannot be more passengers in a car than there are seats.</para>
+
+ <para><example xreflabel="Car-example">
+ <title>Class level constraint</title>
+
+ <programlisting language="Java">package com.mycompany;
+
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+<emphasis role="bold">@PassengerCount</emphasis>
+public class Car {
+
+ @NotNull
+ private String manufacturer;
+
+ @NotNull
+ @Size(min = 2, max = 14)
+ private String licensePlate;
+
+ @Min(2)
+ private int seatCount;
+
+ private List<Person> passengers;
+
+ public Car(String manufacturer, String licencePlate, int seatCount) {
+ this.manufacturer = manufacturer;
+ this.licensePlate = licencePlate;
+ this.seatCount = seatCount;
+ }
+
+ //getters and setters ...
+}</programlisting>
+ </example></para>
+ </section>
+
+ <section>
<title>Constraint inheritance</title>
<para>When validating an object that implements an interface or extends
@@ -245,7 +241,7 @@
this.rentalStation = rentalStation;
}
- @NotNull
+ <emphasis role="bold">@NotNull</emphasis>
public String getRentalStation() {
return rentalStation;
}
@@ -257,7 +253,7 @@
</example>
<para>Our well-known class <classname>Car</classname> from <xref
- linkend="example-class-car" /> is now extended by
+ linkend="Car-example" /> is now extended by
<classname>RentalCar</classname> with the additional property
<property>rentalStation</property>. If an instance of
<classname>RentalCar</classname> is validated, not only the
@@ -280,8 +276,8 @@
<title>Object graphs</title>
<para>The Bean Validation API does not only allow to validate single
- objects but also complete object graphs. To do so, just annotate a field
- or property representing a reference to another object with
+ class instances but also complete object graphs. To do so, just annotate
+ a field or property representing a reference to another object with
<classname>@Valid</classname>. If the parent object is validated, all
referenced objects annotated with <classname>@Valid</classname> will be
validated as well (as will be their children etc.). See <xref
@@ -412,11 +408,10 @@
<para>The <classname>Validator</classname> interface is the main entry
point to Bean Validation. In <xref linkend="section-validator-instance" />
we will first show how to obtain an <classname>Validator</classname>
- instance using the different bootstrapping mechanisms. Afterwards we will
- learn how to use the different methods of the
+ instance. Afterwards we will learn how to use the different methods of the
<classname>Validator</classname> interface.</para>
- <section id="section-validator-instance">
+ <section id="section-obtaining-validator">
<title>Obtaining a <classname>Validator</classname> instance</title>
<para>The first step towards validating an entity instance is to get
@@ -430,62 +425,24 @@
<programlisting>ValidatorFactory factory = <emphasis role="bold">Validation.buildDefaultValidatorFactory()</emphasis>;
Validator validator = factory.getValidator();</programlisting>
- </example>You can also use the method
- <methodname>Validation.byDefaultProvider()</methodname> which will allow
- you to configure several aspects of the created Validator
- instance:<example>
- <title>Validation.byDefaultProvider()</title>
-
- <programlisting>Configuration<?> config = <emphasis
- role="bold">Validation.byDefaultProvider()</emphasis>.configure();
-config.messageInterpolator(new MyMessageInterpolator())
- .traversableResolver( new MyTraversableResolver())
- .constraintValidatorFactory(new MyConstraintValidatorFactory());
-
-ValidatorFactory factory = config.buildValidatorFactory();
-Validator validator = factory.getValidator();
-</programlisting>
- </example>We will learn more about
- <classname>MessageInterpolator</classname> and
- <classname>TraversableResolver</classname> in <xref
- linkend="validator-bootstrapping" />.</para>
-
- <para>Last but not least you can ask for a Configuration object of a
- specific Bean Validation provider. This is useful if you have more than
- one Bean Validation provider in your classpath. In this situation you
- can make an explicit choice about which implementation to use. In the
- case of Hibernate Validator the Validator creation looks like:<example>
- <title>Validation.byProvider( HibernateValidator.class )</title>
-
- <programlisting>ValidatorConfiguration config = <emphasis
- role="bold">Validation.byProvider( HibernateValidator.class )</emphasis>.configure();
-config.messageInterpolator(new MyMessageInterpolator())
- .traversableResolver( new MyTraversableResolver())
- .constraintValidatorFactory(new MyConstraintValidatorFactory());
-
-ValidatorFactory factory = config.buildValidatorFactory();
-Validator validator = factory.getValidator();</programlisting>
- </example></para>
-
- <para><tip>
- <para>The generated <classname>Validator</classname> instance is
- thread safe and can be cached.</para>
- </tip>Now that we have a <classname>Validator</classname> instance,
- let's see how we can use it to validate entity instances.</para>
+ </example>For other ways of obtaining a Validator instance see <xref
+ linkend="validator-bootstrapping" />. For now we just want to see how we
+ can use the <classname>Validator</classname> instance to validate entity
+ instances.</para>
</section>
<section>
<title>Validator methods</title>
<para>The <classname>Validator</classname> interface contains three
- methods that can be used to validate entire object instances or only
- single properties of an instance.</para>
+ methods that can be used to either validate entire entities or just a
+ single properties of the entity.</para>
- <para>All of three methods return a
+ <para>All three methods return a
<classname>Set<ConstraintViolation></classname>. The set is empty,
if the validation succeeds. Otherwise a
- <classname>ConstraintViolation</classname> instance is added to the set
- for each violated constraint.</para>
+ <classname>ConstraintViolation</classname> instance is added for each
+ violated constraint.</para>
<para>All the validation methods have a var-args parameter which can be
used to specify, which validation groups shall be considered when
@@ -576,9 +533,9 @@
<section>
<title><classname>ConstraintViolation</classname> methods</title>
- <para>Now it is time to have a closer look at what a failing validation
- returns. Using the different methods of a
- <classname>ConstraintViolation</classname> instance a lot of useful
+ <para>Now it is time to have a closer look at what a
+ <classname>ConstraintViolation</classname>. Using the different methods
+ of <classname>ConstraintViolation</classname> a lot of useful
information about the cause of the validation failure can be determined.
<xref linkend="table-constraint-violation" /> gives an overview of these
methods:</para>
@@ -587,12 +544,15 @@
<title>The various <classname>ConstraintViolation</classname>
methods</title>
- <tgroup cols="2">
+ <tgroup cols="3">
<thead>
<row>
<entry>Method</entry>
<entry>Usage</entry>
+
+ <entry>Example (refering to <xref
+ linkend="example-validator-validate" />)</entry>
</row>
</thead>
@@ -601,24 +561,32 @@
<entry><methodname>getMessage()</methodname></entry>
<entry>The interpolated error message.</entry>
+
+ <entry>may not be null</entry>
</row>
<row>
<entry><methodname>getMessageTemplate()</methodname></entry>
<entry>The non-interpolated error message.</entry>
+
+ <entry>{javax.validation.constraints.NotNull.message}</entry>
</row>
<row>
<entry><methodname>getRootBean()</methodname></entry>
<entry>The root bean being validated.</entry>
+
+ <entry>car</entry>
</row>
<row>
<entry><methodname>getRootBeanClass()</methodname></entry>
<entry>The class of the root bean being validated.</entry>
+
+ <entry>Car.class</entry>
</row>
<row>
@@ -627,24 +595,32 @@
<entry>If a bean constraint, the bean instance the constraint is
applied on. If a property constraint, the bean instance hosting
the property the constraint is applied on.</entry>
+
+ <entry>car</entry>
</row>
<row>
<entry><methodname>getPropertyPath()</methodname></entry>
<entry>The property path to the value from root bean.</entry>
+
+ <entry></entry>
</row>
<row>
<entry><methodname>getInvalidValue()</methodname></entry>
<entry>The value failing to pass the constraint.</entry>
+
+ <entry>passengers</entry>
</row>
<row>
<entry><methodname>getConstraintDescriptor()</methodname></entry>
<entry>Constraint metadata reported to fail.</entry>
+
+ <entry></entry>
</row>
</tbody>
</tgroup>
@@ -671,7 +647,7 @@
replacements are possible against the custom bundle the default
<classname>ResourceBundle</classname> under
<filename>/org/hibernate/validator/ValidationMessages.properties</filename>
- gets inspected. If a replacement occurs against the default bundle the
+ gets evaluated. If a replacement occurs against the default bundle the
algorithm looks again at the custom bundle (and so on). Once no further
replacements against these two resource bundles are possible remaining
parameters are getting resolved against the attributes of the constraint
@@ -689,7 +665,7 @@
</listitem>
<listitem>
- <para>\} is considered as the literal }</para>
+ <para>\\ is considered as the literal \</para>
</listitem>
</itemizedlist></para>
@@ -702,7 +678,7 @@
</section>
<section id="validator-usingvalidator-validationgroups" revision="1">
- <title>Using groups</title>
+ <title>Validating groups</title>
<para>Groups allow you to restrict the set of constraints applied during
validation. This makes for example wizard like validation possible where
@@ -715,7 +691,7 @@
First we have the class <classname>Person</classname> (<xref
linkend="example-person" />) which has a <classname>@NotNull
</classname>constraint on <property>name</property>. Since no group is
- specified for this annotation its default groups is
+ specified for this annotation its default group is
<classname>javax.validation.Default</classname>.</para>
<note>
@@ -745,8 +721,8 @@
license (<classname>@AssertTrue</classname>). Both constraints defined on
these properties belong to the group <classname>DriverChecks</classname>.
As you can see in <xref linkend="example-group-interfaces" /> the group
- <classname>DriverChecks</classname> is just a simple interface. Using
- interfaces makes the usage of groups type safe and allows for easy
+ <classname>DriverChecks</classname> is just a simple tagging interface.
+ Using interfaces makes the usage of groups type safe and allows for easy
refactoring. It also means that groups can inherit from each other via
class inheritance.<note>
<para>The Bean Validation specification does not enforce that groups
@@ -818,7 +794,7 @@
}</programlisting>
</example>Overall three different groups are used in our example.
<property>Person.name</property>, <property>Car.manufacturer</property>,
- <property>Car.licenseplate</property> and
+ <property>Car.licensePlate</property> and
<property>Car.seatCount</property> all belong to the
<classname>Default</classname> group. <property>Driver.age</property> and
<property>Driver.hasDrivingLicense</property> belong to
@@ -906,6 +882,12 @@
<classname>@GroupSequence</classname> defining the order in which the
groups have to be validated.</para>
+ <note>
+ <para>If at least one constraints fails in a sequenced group none of
+ the constraints of the follwoing groups in the sequence get
+ validated.</para>
+ </note>
+
<para><example>
<title>Interface with @GroupSequence</title>
@@ -948,7 +930,7 @@
allows you to redefine what the Default group means for a given class.
To redefine <classname>Default</classname> for a class, place a
<classname>@GroupSequence</classname> annotation on the class. The
- defined groups in the annotation expresse the sequence of groups that
+ defined groups in the annotation express the sequence of groups that
substitute <classname>Default</classname> for this class. <xref
linkend="example-rental-car" /> introduces a new class RentalCar with a
redfined default group. With this definition the check for all three
@@ -985,7 +967,7 @@
<note>
<para>Due to the fact that there cannot be a cyclic dependency in the
- group and group sequence definitions one cannot just at
+ group and group sequence definitions one cannot just add
<classname>Default</classname> to the sequence redefining
<classname>Default</classname> for a class. Instead the class itself
should be added!</para>
@@ -998,8 +980,8 @@
<para>Hibernate Validator implements all of the default constraints
specified in Bean Validation as well as some custom ones. <xref
- linkend="table-builtin-constraints" /> list all built-in constraints
- available in Hibernate Validator.</para>
+ linkend="table-builtin-constraints" /> list all constraints available in
+ Hibernate Validator.</para>
<table id="table-builtin-constraints">
<title>Built-in constraints</title>
@@ -1027,7 +1009,7 @@
<entry>yes</entry>
- <entry>field/propertyß</entry>
+ <entry>field/property</entry>
<entry>check that the annotated element is
<constant>false</constant>.</entry>
@@ -1081,7 +1063,7 @@
respective wrappers of the primitive types.</entry>
<entry>The annotated element must be a number whose value must be
- higher or equal to the specified maximum. The parameter value is
+ higher or equal to the specified minimum. The parameter value is
the string representation of the min value according to the
<classname>BigDecimal</classname> string representation.</entry>
@@ -1218,8 +1200,8 @@
<entry>field/property. Needs to be a string.</entry>
- <entry>Check if the annotated string match the regular
- expression.</entry>
+ <entry>Check if the annotated string match the regular expression
+ <parameter>regex</parameter>.</entry>
<entry>none</entry>
</row>
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml 2009-09-16 14:51:56 UTC (rev 17522)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml 2009-09-16 15:51:58 UTC (rev 17523)
@@ -61,7 +61,7 @@
<programlisting><validation-config xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration file:/Users/hardy/work/hibernate/beanvalidation/trunk/validation-api/src/test/resources/validation-configuration-1.0.xsd">
+ xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration">
<default-provider>org.hibernate.validator.HibernateValidator</default-provider>
<message-interpolator>org.hibernate.validator.engine.ResourceBundleMessageInterpolator</message-interpolator>
<traversable-resolver>org.hibernate.validator.engine.resolver.DefaultTraversableResolver</traversable-resolver>
@@ -80,17 +80,17 @@
<para>All settings shown in the <filename>validation.xml</filename> are
optional and in the case of <xref linkend="example-validation-xml" /> show
the defaults used within Hibernate Validator. The node
- <property>default-provider</property> allows to chose the Bean Validation
- provider. This is useful if there are more than one providers in the
+ <property>default-provider</property> allows to choose the Bean Validation
+ provider. This is useful if there is more than one provider in the
classpath. <property>message-interpolator</property>,
<property>traversable-resolver</property> and
<property>constraint-validator-factory</property> allow to customize the
<classname>javax.validation.MessageInterpolator</classname>,
<classname>javax.validation.TraversableResolver</classname> resp.
- <classname>javax.validation.ConstraintValidatorFactory</classname> to use.
- These are the same configuration option as available programmatically
- through the <classname>javax.validation.Configuration</classname>. In fact
- XML configuration will be overriden by values explicitly specified via the
+ <classname>javax.validation.ConstraintValidatorFactory</classname>. The
+ same configuration options are also available programmatically through the
+ <classname>javax.validation.Configuration</classname>. In fact XML
+ configuration will be overriden by values explicitly specified via the
API. It is even possible to ignore the XML configuration completely via
<methodname> Configuration.ignoreXmlConfiguration()</methodname>. See also
<xref linkend="validator-bootstrapping" />.</para>
@@ -213,9 +213,9 @@
(see <xref linkend="section-default-group-class" />) via the
<property>group-sequence</property> node.</para>
- <para>Last but not least, constraint annotations cannot be configured in
- XML. However, the list of <classname>ConstraintValidator</classname>s
- associated to a given constraint can be altered via the
+ <para>Last but not least, the list of
+ <classname>ConstraintValidator</classname>s associated to a given
+ constraint can be altered via the
<property>constraint-definition</property> node. The
<property>annotation</property> attribute represents the constraint
annotation being altered. The <property>validated-by</property> elements
16 years
Hibernate SVN: r17522 - jpa-api/trunk/src/main/java/javax/persistence/criteria.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-09-16 10:51:56 -0400 (Wed, 16 Sep 2009)
New Revision: 17522
Modified:
jpa-api/trunk/src/main/java/javax/persistence/criteria/Subquery.java
Log:
renamed Subquery#getJoins() -> Subquery#getCorrelatedJoins()
Modified: jpa-api/trunk/src/main/java/javax/persistence/criteria/Subquery.java
===================================================================
--- jpa-api/trunk/src/main/java/javax/persistence/criteria/Subquery.java 2009-09-16 12:50:41 UTC (rev 17521)
+++ jpa-api/trunk/src/main/java/javax/persistence/criteria/Subquery.java 2009-09-16 14:51:56 UTC (rev 17522)
@@ -164,6 +164,6 @@
* Return the joins that have been made from the subquery.
* @return joins made from this type
*/
- java.util.Set<Join<?, ?>> getJoins();
+ java.util.Set<Join<?, ?>> getCorrelatedJoins();
}
\ No newline at end of file
16 years
Hibernate SVN: r17521 - in validator/trunk/hibernate-validator/src: test/java/org/hibernate/validator/constraints/impl and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-16 08:50:41 -0400 (Wed, 16 Sep 2009)
New Revision: 17521
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMaxValidatorForNumber.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMaxValidatorForString.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMinValidatorForNumber.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMinValidatorForString.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DigitsValidatorForNumber.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DigitsValidatorForString.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/LengthValidator.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/PatternValidator.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForArray.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfPrimitives.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForCollection.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForMap.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForString.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/DigitsValidatorForNumberTest.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/DigitsValidatorForStringTest.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/LengthValidatorTest.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MaxValidatorForNumberTest.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MaxValidatorForStringTest.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MinValidatorForNumberTest.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MinValidatorForStringTest.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/PatternValidatorTest.java
Log:
HV-134 - Built-in constraint parameter validation now uses IllegalArguementException
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMaxValidatorForNumber.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMaxValidatorForNumber.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMaxValidatorForNumber.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -19,7 +19,6 @@
import java.math.BigDecimal;
import java.math.BigInteger;
-import javax.validation.ConstraintDeclarationException;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.DecimalMax;
@@ -39,7 +38,7 @@
this.maxValue = new BigDecimal( maxValue.value() );
}
catch ( NumberFormatException nfe ) {
- throw new ConstraintDeclarationException( maxValue.value() + " does not represent a valid BigDemcimal formt" );
+ throw new IllegalArgumentException( maxValue.value() + " does not represent a valid BigDecimal format" );
}
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMaxValidatorForString.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMaxValidatorForString.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMaxValidatorForString.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -18,7 +18,6 @@
package org.hibernate.validator.constraints.impl;
import java.math.BigDecimal;
-import javax.validation.ConstraintDeclarationException;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.DecimalMax;
@@ -38,7 +37,7 @@
this.maxValue = new BigDecimal( maxValue.value() );
}
catch ( NumberFormatException nfe ) {
- throw new ConstraintDeclarationException( maxValue.value() + " does not represent a valid BigDemcimal formt" );
+ throw new IllegalArgumentException( maxValue.value() + " does not represent a valid BigDecimal format" );
}
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMinValidatorForNumber.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMinValidatorForNumber.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMinValidatorForNumber.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -19,7 +19,6 @@
import java.math.BigDecimal;
import java.math.BigInteger;
-import javax.validation.ConstraintDeclarationException;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.DecimalMin;
@@ -39,7 +38,7 @@
this.minValue = new BigDecimal( minValue.value() );
}
catch ( NumberFormatException nfe ) {
- throw new ConstraintDeclarationException( minValue.value() + " does not represent a valid BigDemcimal formt" );
+ throw new IllegalArgumentException( minValue.value() + " does not represent a valid BigDecimal format" );
}
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMinValidatorForString.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMinValidatorForString.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DecimalMinValidatorForString.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -18,7 +18,6 @@
package org.hibernate.validator.constraints.impl;
import java.math.BigDecimal;
-import javax.validation.ConstraintDeclarationException;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.DecimalMin;
@@ -35,7 +34,7 @@
this.minValue = new BigDecimal( minValue.value() );
}
catch ( NumberFormatException nfe ) {
- throw new ConstraintDeclarationException( minValue.value() + " does not represent a valid BigDemcimal formt" );
+ throw new IllegalArgumentException( minValue.value() + " does not represent a valid BigDecimal format" );
}
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DigitsValidatorForNumber.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DigitsValidatorForNumber.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DigitsValidatorForNumber.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -20,7 +20,6 @@
import java.math.BigDecimal;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
-import javax.validation.ValidationException;
import javax.validation.constraints.Digits;
/**
@@ -63,10 +62,10 @@
private void validateParameters() {
if ( maxIntegerLength < 0 ) {
- throw new ValidationException( "The length of the interger part cannot be negative." );
+ throw new IllegalArgumentException( "The length of the integer part cannot be negative." );
}
if ( maxFractionLength < 0 ) {
- throw new ValidationException( "The length of the fraction part cannot be negative." );
+ throw new IllegalArgumentException( "The length of the fraction part cannot be negative." );
}
}
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DigitsValidatorForString.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DigitsValidatorForString.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/DigitsValidatorForString.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -71,10 +71,10 @@
private void validateParameters() {
if ( maxIntegerLength < 0 ) {
- throw new ValidationException( "The length of the interger part cannot be negative." );
+ throw new IllegalArgumentException( "The length of the integer part cannot be negative." );
}
if ( maxFractionLength < 0 ) {
- throw new ValidationException( "The length of the fraction part cannot be negative." );
+ throw new IllegalArgumentException( "The length of the fraction part cannot be negative." );
}
}
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/LengthValidator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/LengthValidator.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/LengthValidator.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -19,7 +19,6 @@
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
-import javax.validation.ValidationException;
import org.hibernate.validator.constraints.Length;
@@ -49,13 +48,13 @@
private void validateParameters() {
if ( min < 0 ) {
- throw new ValidationException( "The min parameter cannot be negative." );
+ throw new IllegalArgumentException( "The min parameter cannot be negative." );
}
if ( max < 0 ) {
- throw new ValidationException( "The max paramter cannot be negative." );
+ throw new IllegalArgumentException( "The max parameter cannot be negative." );
}
if ( max < min ) {
- throw new ValidationException( "The length cannot be negative." );
+ throw new IllegalArgumentException( "The length cannot be negative." );
}
}
}
\ No newline at end of file
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/PatternValidator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/PatternValidator.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/PatternValidator.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -19,7 +19,6 @@
import java.util.regex.Matcher;
import java.util.regex.PatternSyntaxException;
-import javax.validation.ConstraintDeclarationException;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Pattern;
@@ -42,7 +41,7 @@
pattern = java.util.regex.Pattern.compile( parameters.regexp(), intFlag );
}
catch ( PatternSyntaxException e ) {
- throw new ConstraintDeclarationException( "Invalid regular expression.", e );
+ throw new IllegalArgumentException( "Invalid regular expression.", e );
}
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForArray.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForArray.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForArray.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -20,11 +20,10 @@
import java.lang.reflect.Array;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
-import javax.validation.ValidationException;
import javax.validation.constraints.Size;
/**
- * Check that the length of an array is betweeb <i>min</i> and <i>max</i>
+ * Check that the length of an array is between <i>min</i> and <i>max</i>
*
* @author Hardy Ferentschik
*/
@@ -58,13 +57,13 @@
private void validateParameters() {
if ( min < 0 ) {
- throw new ValidationException( "The min parameter cannot be negative." );
+ throw new IllegalArgumentException( "The min parameter cannot be negative." );
}
if ( max < 0 ) {
- throw new ValidationException( "The max paramter cannot be negative." );
+ throw new IllegalArgumentException( "The max parameter cannot be negative." );
}
if ( max < min ) {
- throw new ValidationException( "The length cannot be negative." );
+ throw new IllegalArgumentException( "The length cannot be negative." );
}
}
}
\ No newline at end of file
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfPrimitives.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfPrimitives.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfPrimitives.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -17,11 +17,10 @@
*/
package org.hibernate.validator.constraints.impl;
-import javax.validation.ValidationException;
import javax.validation.constraints.Size;
/**
- * Check that the length of an array is betweeb <i>min</i> and <i>max</i>
+ * Check that the length of an array is between <i>min</i> and <i>max</i>
*
* @author Hardy Ferentschik
*/
@@ -37,13 +36,13 @@
private void validateParameters() {
if ( min < 0 ) {
- throw new ValidationException( "The min parameter cannot be negative." );
+ throw new IllegalArgumentException( "The min parameter cannot be negative." );
}
if ( max < 0 ) {
- throw new ValidationException( "The max paramter cannot be negative." );
+ throw new IllegalArgumentException( "The max parameter cannot be negative." );
}
if ( max < min ) {
- throw new ValidationException( "The length cannot be negative." );
+ throw new IllegalArgumentException( "The length cannot be negative." );
}
}
}
\ No newline at end of file
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForCollection.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForCollection.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForCollection.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -20,7 +20,6 @@
import java.util.Collection;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
-import javax.validation.ValidationException;
import javax.validation.constraints.Size;
/**
@@ -56,15 +55,15 @@
return length >= min && length <= max;
}
- private void validateParameters() {
+ private void validateParameters() {
if ( min < 0 ) {
- throw new ValidationException( "The min parameter cannot be negative." );
+ throw new IllegalArgumentException( "The min parameter cannot be negative." );
}
if ( max < 0 ) {
- throw new ValidationException( "The max paramter cannot be negative." );
+ throw new IllegalArgumentException( "The max parameter cannot be negative." );
}
if ( max < min ) {
- throw new ValidationException( "The length cannot be negative." );
+ throw new IllegalArgumentException( "The length cannot be negative." );
}
}
}
\ No newline at end of file
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForMap.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForMap.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForMap.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -20,7 +20,6 @@
import java.util.Map;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
-import javax.validation.ValidationException;
import javax.validation.constraints.Size;
/**
@@ -58,13 +57,13 @@
private void validateParameters() {
if ( min < 0 ) {
- throw new ValidationException( "The min parameter cannot be negative." );
+ throw new IllegalArgumentException( "The min parameter cannot be negative." );
}
if ( max < 0 ) {
- throw new ValidationException( "The max paramter cannot be negative." );
+ throw new IllegalArgumentException( "The max parameter cannot be negative." );
}
if ( max < min ) {
- throw new ValidationException( "The length cannot be negative." );
+ throw new IllegalArgumentException( "The length cannot be negative." );
}
}
}
\ No newline at end of file
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForString.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForString.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/SizeValidatorForString.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -19,7 +19,6 @@
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
-import javax.validation.ValidationException;
import javax.validation.constraints.Size;
/**
@@ -58,13 +57,13 @@
private void validateParameters() {
if ( min < 0 ) {
- throw new ValidationException( "The min parameter cannot be negative." );
+ throw new IllegalArgumentException( "The min parameter cannot be negative." );
}
if ( max < 0 ) {
- throw new ValidationException( "The max paramter cannot be negative." );
+ throw new IllegalArgumentException( "The max parameter cannot be negative." );
}
if ( max < min ) {
- throw new ValidationException( "The length cannot be negative." );
+ throw new IllegalArgumentException( "The length cannot be negative." );
}
}
}
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/DigitsValidatorForNumberTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/DigitsValidatorForNumberTest.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/DigitsValidatorForNumberTest.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -18,7 +18,6 @@
package org.hibernate.validator.constraints.impl;
import java.math.BigDecimal;
-import javax.validation.ValidationException;
import javax.validation.constraints.Digits;
import static org.testng.Assert.assertFalse;
@@ -80,7 +79,7 @@
assertFalse( constraint.isValid( Double.valueOf( "500.2" ), null ) );
}
- @Test(expectedExceptions = ValidationException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testNegativeIntegerLength() {
AnnotationDescriptor<Digits> descriptor = new AnnotationDescriptor<Digits>( Digits.class );
@@ -93,7 +92,7 @@
constraint.initialize( p );
}
- @Test(expectedExceptions = ValidationException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testNegativeFractionLength() {
AnnotationDescriptor<Digits> descriptor = new AnnotationDescriptor<Digits>( Digits.class );
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/DigitsValidatorForStringTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/DigitsValidatorForStringTest.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/DigitsValidatorForStringTest.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -17,7 +17,6 @@
*/
package org.hibernate.validator.constraints.impl;
-import javax.validation.ValidationException;
import javax.validation.constraints.Digits;
import static org.testng.Assert.assertFalse;
@@ -62,7 +61,7 @@
assertFalse( constraint.isValid( "12.0001", null ) );
}
- @Test(expectedExceptions = ValidationException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testNegativeIntegerLength() {
AnnotationDescriptor<Digits> descriptor = new AnnotationDescriptor<Digits>( Digits.class );
@@ -75,7 +74,7 @@
constraint.initialize( p );
}
- @Test(expectedExceptions = ValidationException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testNegativeFractionLength() {
AnnotationDescriptor<Digits> descriptor = new AnnotationDescriptor<Digits>( Digits.class );
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/LengthValidatorTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/LengthValidatorTest.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/LengthValidatorTest.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -17,8 +17,6 @@
*/
package org.hibernate.validator.constraints.impl;
-import javax.validation.ValidationException;
-
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import org.testng.annotations.Test;
@@ -51,7 +49,7 @@
assertFalse( constraint.isValid( "foobar", null ) );
}
- @Test(expectedExceptions = ValidationException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testNegativeMinValue() {
AnnotationDescriptor<Length> descriptor = new AnnotationDescriptor<Length>( Length.class );
descriptor.setValue( "min", -1 );
@@ -63,7 +61,7 @@
constraint.initialize( p );
}
- @Test(expectedExceptions = ValidationException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testNegativeMaxValue() {
AnnotationDescriptor<Length> descriptor = new AnnotationDescriptor<Length>( Length.class );
descriptor.setValue( "min", 1 );
@@ -75,7 +73,7 @@
constraint.initialize( p );
}
- @Test(expectedExceptions = ValidationException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testNegativeLength() {
AnnotationDescriptor<Length> descriptor = new AnnotationDescriptor<Length>( Length.class );
descriptor.setValue( "min", 5 );
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MaxValidatorForNumberTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MaxValidatorForNumberTest.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MaxValidatorForNumberTest.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -19,7 +19,6 @@
import java.math.BigDecimal;
import java.math.BigInteger;
-import javax.validation.ConstraintDeclarationException;
import javax.validation.ConstraintValidator;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.Max;
@@ -77,7 +76,7 @@
constraint.initialize( m );
fail();
}
- catch ( ConstraintDeclarationException e ) {
+ catch ( IllegalArgumentException e ) {
// success
}
}
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MaxValidatorForStringTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MaxValidatorForStringTest.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MaxValidatorForStringTest.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -17,7 +17,6 @@
*/
package org.hibernate.validator.constraints.impl;
-import javax.validation.ConstraintDeclarationException;
import javax.validation.ConstraintValidator;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.Max;
@@ -74,7 +73,7 @@
constraint.initialize( m );
fail();
}
- catch ( ConstraintDeclarationException e ) {
+ catch ( IllegalArgumentException e ) {
// success
}
}
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MinValidatorForNumberTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MinValidatorForNumberTest.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MinValidatorForNumberTest.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -19,7 +19,6 @@
import java.math.BigDecimal;
import java.math.BigInteger;
-import javax.validation.ConstraintDeclarationException;
import javax.validation.ConstraintValidator;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
@@ -75,7 +74,7 @@
constraint.initialize( m );
fail();
}
- catch ( ConstraintDeclarationException e ) {
+ catch ( IllegalArgumentException e ) {
// success
}
}
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MinValidatorForStringTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MinValidatorForStringTest.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/MinValidatorForStringTest.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -17,7 +17,6 @@
*/
package org.hibernate.validator.constraints.impl;
-import javax.validation.ConstraintDeclarationException;
import javax.validation.ConstraintValidator;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
@@ -73,7 +72,7 @@
constraint.initialize( m );
fail();
}
- catch ( ConstraintDeclarationException e ) {
+ catch ( IllegalArgumentException e ) {
// success
}
}
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/PatternValidatorTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/PatternValidatorTest.java 2009-09-16 09:00:15 UTC (rev 17520)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/impl/PatternValidatorTest.java 2009-09-16 12:50:41 UTC (rev 17521)
@@ -17,7 +17,6 @@
*/
package org.hibernate.validator.constraints.impl;
-import javax.validation.ValidationException;
import javax.validation.constraints.Pattern;
import static org.testng.Assert.assertFalse;
@@ -65,7 +64,7 @@
assertTrue( constraint.isValid( "a b c foo", null ) );
}
- @Test(expectedExceptions = ValidationException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
public void testInvalidRegularExpression() {
AnnotationDescriptor<Pattern> descriptor = new AnnotationDescriptor<Pattern>( Pattern.class );
descriptor.setValue( "regexp", "(unbalanced parentheses" );
16 years