Hibernate SVN: r17550 - in search/branches/Branch_3_1/src: test/java/org/hibernate/search/test/embedded and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: sannegrinovero
Date: 2009-09-27 08:49:54 -0400 (Sun, 27 Sep 2009)
New Revision: 17550
Added:
search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/
search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Address.java
search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Attribute.java
search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/AttributeValue.java
…
[View More]search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/NestedEmbeddedTest.java
search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Person.java
search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Place.java
search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Product.java
Modified:
search/branches/Branch_3_1/src/main/java/org/hibernate/search/engine/DocumentBuilderContainedEntity.java
Log:
porting HSEARCH-391 from trunk to branch 3.1
Modified: search/branches/Branch_3_1/src/main/java/org/hibernate/search/engine/DocumentBuilderContainedEntity.java
===================================================================
--- search/branches/Branch_3_1/src/main/java/org/hibernate/search/engine/DocumentBuilderContainedEntity.java 2009-09-25 13:23:40 UTC (rev 17549)
+++ search/branches/Branch_3_1/src/main/java/org/hibernate/search/engine/DocumentBuilderContainedEntity.java 2009-09-27 12:49:54 UTC (rev 17550)
@@ -574,62 +574,79 @@
}
if ( member.isArray() ) {
- for ( Object arrayValue : ( Object[] ) value ) {
- //highly inneficient but safe wrt the actual targeted class
- Class<?> valueClass = Hibernate.getClass( arrayValue );
- DocumentBuilderIndexedEntity<?> builderIndexedEntity = searchFactoryImplementor.getDocumentBuilderIndexedEntity(
- valueClass
- );
- if ( builderIndexedEntity == null ) {
- continue;
- }
- processContainedInValue(
- arrayValue, queue, valueClass,
- builderIndexedEntity, searchFactoryImplementor
- );
+ @SuppressWarnings("unchecked")
+ T[] array = ( T[] ) value;
+ for ( T arrayValue : array ) {
+ processSingleContainedInInstance( queue, searchFactoryImplementor, arrayValue );
}
}
else if ( member.isCollection() ) {
- Collection collection;
- if ( Map.class.equals( member.getCollectionClass() ) ) {
- //hum
- collection = ( ( Map ) value ).values();
+ Collection<T> collection = getActualCollection( member, value );
+ for ( T collectionValue : collection ) {
+ processSingleContainedInInstance( queue, searchFactoryImplementor, collectionValue );
}
- else {
- collection = ( Collection ) value;
- }
- for ( Object collectionValue : collection ) {
- //highly inneficient but safe wrt the actual targeted class
- Class<?> valueClass = Hibernate.getClass( collectionValue );
- DocumentBuilderIndexedEntity<?> builderIndexedEntity = searchFactoryImplementor.getDocumentBuilderIndexedEntity(
- valueClass
- );
- if ( builderIndexedEntity == null ) {
- continue;
- }
- processContainedInValue(
- collectionValue, queue, valueClass,
- builderIndexedEntity, searchFactoryImplementor
- );
- }
}
else {
- Class<?> valueClass = Hibernate.getClass( value );
- DocumentBuilderIndexedEntity<?> builderIndexedEntity = searchFactoryImplementor.getDocumentBuilderIndexedEntity(
- valueClass
- );
- if ( builderIndexedEntity == null ) {
- continue;
- }
- processContainedInValue( value, queue, valueClass, builderIndexedEntity, searchFactoryImplementor );
+ processSingleContainedInInstance( queue, searchFactoryImplementor, value );
}
}
- //an embedded cannot have a useful @ContainedIn (no shared reference)
- //do not walk through them
}
- private void processContainedInValue(Object value, List<LuceneWork> queue, Class<?> valueClass,
- DocumentBuilderIndexedEntity builderIndexedEntity, SearchFactoryImplementor searchFactoryImplementor) {
+ /**
+ * A {@code XMember } instance treats a map as a collection as well in which case the map values are returned as
+ * collection.
+ *
+ * @param member The member instance
+ * @param value The value
+ *
+ * @return The {@code value} casted to collection or in case of {@code value} being a map the map values as collection.
+ */
+ private <T> Collection<T> getActualCollection(XMember member, Object value) {
+ Collection<T> collection;
+ if ( Map.class.equals( member.getCollectionClass() ) ) {
+ //hum
+ @SuppressWarnings("unchecked")
+ Collection<T> tmpCollection = ( ( Map<?, T> ) value ).values();
+ collection = tmpCollection;
+ }
+ else {
+ @SuppressWarnings("unchecked")
+ Collection<T> tmpCollection = ( Collection<T> ) value;
+ collection = tmpCollection;
+ }
+ return collection;
+ }
+
+ private <T> void processSingleContainedInInstance(List<LuceneWork> queue, SearchFactoryImplementor searchFactoryImplementor, T value) {
+ @SuppressWarnings("unchecked")
+ Class<T> valueClass = Hibernate.getClass( value );
+ DocumentBuilderIndexedEntity<T> builderIndexedEntity =
+ searchFactoryImplementor.getDocumentBuilderIndexedEntity( valueClass );
+
+ // it could be we have a nested @IndexedEmbedded chain in which case we have to find the top level @Indexed entities
+ if ( builderIndexedEntity == null ) {
+ DocumentBuilderContainedEntity<T> builderContainedEntity =
+ searchFactoryImplementor.getDocumentBuilderContainedEntity( valueClass );
+ if ( builderContainedEntity != null ) {
+ processContainedIn( value, queue, builderContainedEntity.metadata, searchFactoryImplementor );
+ }
+ }
+ else {
+ addWorkForEmbeddedValue( value, queue, valueClass, builderIndexedEntity, searchFactoryImplementor );
+ }
+ }
+
+ /**
+ * Create a {@code LuceneWork} instance of the entity which needs updating due to the embedded instance change.
+ *
+ * @param value The value to index
+ * @param queue The current (Lucene) work queue
+ * @param valueClass The class of the value
+ * @param builderIndexedEntity the document builder for the entity which needs updating due to a update event of the embedded instance
+ * @param searchFactoryImplementor the search factory.
+ */
+ private <T> void addWorkForEmbeddedValue(T value, List<LuceneWork> queue, Class<T> valueClass,
+ DocumentBuilderIndexedEntity<T> builderIndexedEntity, SearchFactoryImplementor searchFactoryImplementor) {
Serializable id = ( Serializable ) ReflectionHelper.getMemberValue( value, builderIndexedEntity.idGetter );
builderIndexedEntity.addWorkToQueue( valueClass, value, id, WorkType.UPDATE, queue, searchFactoryImplementor );
}
Added: search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Address.java
===================================================================
--- search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Address.java (rev 0)
+++ search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Address.java 2009-09-27 12:49:54 UTC (rev 17550)
@@ -0,0 +1,87 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.search.test.embedded.nested;
+
+import java.util.HashSet;
+import java.util.Set;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+
+import org.hibernate.search.annotations.ContainedIn;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Index;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class Address {
+ @Id
+ @GeneratedValue
+ private Long id;
+
+ @Field(index = Index.TOKENIZED)
+ private String street;
+
+ @Field(index = Index.TOKENIZED)
+ private String city;
+
+ @ContainedIn
+ @OneToMany(mappedBy = "address")
+ private Set<Place> places;
+
+ public Address(String street, String city) {
+ this();
+ this.street = street;
+ this.city = city;
+ }
+
+ private Address() {
+ places = new HashSet<Place>();
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public String getStreet() {
+ return street;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public Set<Place> getPlaces() {
+ return places;
+ }
+
+ public void addPlace(Place place) {
+ places.add( place );
+ }
+
+ public void setStreet(String street) {
+ this.street = street;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+}
Property changes on: search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Address.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Attribute.java
===================================================================
--- search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Attribute.java (rev 0)
+++ search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Attribute.java 2009-09-27 12:49:54 UTC (rev 17550)
@@ -0,0 +1,79 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.search.test.embedded.nested;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+
+import org.hibernate.search.annotations.ContainedIn;
+import org.hibernate.search.annotations.IndexedEmbedded;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class Attribute {
+
+ @Id
+ @GeneratedValue
+ private long id;
+
+ @ManyToOne
+ @ContainedIn
+ private Product product;
+
+ @OneToMany(mappedBy = "attribute", fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.REMOVE })
+ @IndexedEmbedded
+ private List<AttributeValue> values;
+
+ private Attribute() {
+ values = new ArrayList<AttributeValue>();
+ }
+
+ public Attribute(Product product) {
+ this.product = product;
+ values = new ArrayList<AttributeValue>();
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public Product getProduct() {
+ return product;
+ }
+
+ public void setProduct(Product product) {
+ this.product = product;
+ }
+
+ public List<AttributeValue> getValues() {
+ return values;
+ }
+
+ public void setValue(AttributeValue value) {
+ values.add( value );
+ }
+}
Property changes on: search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Attribute.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/AttributeValue.java
===================================================================
--- search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/AttributeValue.java (rev 0)
+++ search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/AttributeValue.java 2009-09-27 12:49:54 UTC (rev 17550)
@@ -0,0 +1,77 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.search.test.embedded.nested;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+
+import org.hibernate.search.annotations.ContainedIn;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Store;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class AttributeValue {
+
+ @Id
+ @GeneratedValue
+ private long id;
+
+ @ManyToOne(targetEntity = Attribute.class, fetch = FetchType.EAGER)
+ @ContainedIn
+ private Attribute attribute;
+
+ @Column(name = "_value")
+ @Field(index = Index.TOKENIZED, store = Store.YES)
+ private String value;
+
+ private AttributeValue() {
+ }
+
+ public AttributeValue(Attribute attribute, String value) {
+ this.attribute = attribute;
+ this.value = value;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public Attribute getAttribute() {
+ return attribute;
+ }
+
+ public void setAttribute(Attribute attribute) {
+ this.attribute = attribute;
+ }
+}
\ No newline at end of file
Property changes on: search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/AttributeValue.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/NestedEmbeddedTest.java
===================================================================
--- search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/NestedEmbeddedTest.java (rev 0)
+++ search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/NestedEmbeddedTest.java 2009-09-27 12:49:54 UTC (rev 17550)
@@ -0,0 +1,138 @@
+//$Id$
+package org.hibernate.search.test.embedded.nested;
+
+import java.util.List;
+
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.search.Query;
+
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.search.FullTextSession;
+import org.hibernate.search.Search;
+import org.hibernate.search.test.SearchTestCase;
+
+
+/**
+ * @author Emmanuel Bernard
+ * @author Hardy Ferentschik
+ */
+public class NestedEmbeddedTest extends SearchTestCase {
+
+ /**
+ * HSEARCH-391
+ *
+ * @throws Exception in case the tests fails
+ */
+ public void testNestedEmbeddedIndexing() throws Exception {
+ Product product = new Product();
+ Attribute attribute = new Attribute( product );
+ product.setAttribute( attribute );
+ AttributeValue value = new AttributeValue( attribute, "foo" );
+ attribute.setValue( value );
+
+ Session s = openSession();
+ Transaction tx = s.beginTransaction();
+ s.persist( product );
+ tx.commit();
+
+ FullTextSession session = Search.getFullTextSession( s );
+ QueryParser parser = new QueryParser( "attributes.values.value", new StandardAnalyzer() );
+ Query query;
+ List<?> result;
+
+
+ query = parser.parse( "foo" );
+ result = session.createFullTextQuery( query ).list();
+ assertEquals( "unable to find property in attribute value", 1, result.size() );
+
+
+ s.clear();
+ tx = s.beginTransaction();
+
+ product = ( Product ) s.get( Product.class, product.getId() );
+ product.getAttributes().get( 0 ).getValues().get( 0 ).setValue( "bar" );
+ tx.commit();
+
+ s.clear();
+
+ session = Search.getFullTextSession( s );
+
+ query = parser.parse( "foo" );
+ result = session.createFullTextQuery( query, Product.class ).list();
+ assertEquals( "change in embedded not reflected in root index", 0, result.size() );
+
+ query = parser.parse( "bar" );
+ result = session.createFullTextQuery( query, Product.class ).list();
+ assertEquals( "change in embedded not reflected in root index", 1, result.size() );
+
+ s.close();
+ }
+
+
+ /**
+ * HSEARCH-391
+ *
+ * @throws Exception in case the tests fails
+ */
+ public void testNestedEmbeddedIndexingWithContainedInOnCollection() throws Exception {
+ Person john = new Person( "John Doe" );
+ Place eiffelTower = new Place( "Eiffel Tower" );
+ Address addressEiffel = new Address( "Avenue Gustave Eiffel", "London" );
+ addressEiffel.addPlace( eiffelTower );
+ eiffelTower.setAddress( addressEiffel );
+ john.addPlaceVisited( eiffelTower );
+ eiffelTower.visitedBy( john );
+
+
+ Session s = openSession();
+ Transaction tx = s.beginTransaction();
+ s.persist( john );
+ tx.commit();
+
+ FullTextSession session = Search.getFullTextSession( s );
+ QueryParser parser = new QueryParser( "placesVisited.address.city", new StandardAnalyzer() );
+ Query query;
+ List<?> result;
+
+
+ query = parser.parse( "London" );
+ result = session.createFullTextQuery( query ).list();
+ assertEquals( "unable to find nested indexed value", 1, result.size() );
+
+
+ s.clear();
+ tx = s.beginTransaction();
+
+ john = ( Person ) s.get( Person.class, john.getId() );
+ john.getPlacesVisited().get( 0 ).getAddress().setCity( "Paris" );
+ tx.commit();
+
+ s.clear();
+
+ john = ( Person ) s.get( Person.class, john.getId() );
+
+ session = Search.getFullTextSession( s );
+
+ query = parser.parse( "London" );
+ result = session.createFullTextQuery( query, Person.class ).list();
+ assertEquals( "change in embedded not reflected in root index", 0, result.size() );
+
+ query = parser.parse( "Paris" );
+ result = session.createFullTextQuery( query, Person.class ).list();
+ assertEquals( "change in embedded not reflected in root index", 1, result.size() );
+
+ s.close();
+ }
+
+ protected void configure(org.hibernate.cfg.Configuration cfg) {
+ super.configure( cfg );
+ }
+
+ protected Class<?>[] getMappings() {
+ return new Class[] {
+ Product.class, Attribute.class, AttributeValue.class, Person.class, Place.class, Address.class
+ };
+ }
+}
\ No newline at end of file
Property changes on: search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/NestedEmbeddedTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Person.java
===================================================================
--- search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Person.java (rev 0)
+++ search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Person.java 2009-09-27 12:49:54 UTC (rev 17550)
@@ -0,0 +1,71 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.search.test.embedded.nested;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToMany;
+
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.IndexedEmbedded;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+@Indexed
+public class Person {
+ @Id
+ @GeneratedValue
+ private long id;
+
+ String name;
+
+ @IndexedEmbedded
+ @ManyToMany(cascade = { CascadeType.ALL })
+ private List<Place> placesVisited;
+
+ private Person() {
+ placesVisited = new ArrayList<Place>( 0 );
+ }
+
+ public Person(String name) {
+ this();
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public List<Place> getPlacesVisited() {
+ return placesVisited;
+ }
+
+ public void addPlaceVisited(Place place) {
+ placesVisited.add( place );
+ }
+
+ public long getId() {
+ return id;
+ }
+}
Property changes on: search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Person.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Place.java
===================================================================
--- search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Place.java (rev 0)
+++ search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Place.java 2009-09-27 12:49:54 UTC (rev 17550)
@@ -0,0 +1,87 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.search.test.embedded.nested;
+
+import java.util.HashSet;
+import java.util.Set;
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToMany;
+import javax.persistence.OneToOne;
+
+import org.hibernate.search.annotations.ContainedIn;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.IndexedEmbedded;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class Place {
+ @Id
+ @GeneratedValue
+ private Long id;
+
+ @Field(index = Index.TOKENIZED)
+ private String name;
+
+ @OneToOne(cascade = { CascadeType.PERSIST, CascadeType.REMOVE })
+ @IndexedEmbedded
+ private Address address;
+
+ @ContainedIn
+ @ManyToMany(cascade = { CascadeType.ALL }, mappedBy = "placesVisited")
+ private Set<Person> visitedBy;
+
+ private Place() {
+ this.visitedBy = new HashSet<Person>();
+ }
+
+ public Place(String name) {
+ this();
+ this.name = name;
+ }
+
+ public Address getAddress() {
+ return address;
+ }
+
+ public String getName() {
+
+ return name;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setAddress(Address address) {
+ this.address = address;
+ }
+
+ public void visitedBy(Person person) {
+ visitedBy.add( person );
+ }
+
+ public Set<Person> getVisitedBy() {
+ return visitedBy;
+ }
+}
Property changes on: search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Place.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Product.java
===================================================================
--- search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Product.java (rev 0)
+++ search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Product.java 2009-09-27 12:49:54 UTC (rev 17550)
@@ -0,0 +1,61 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.search.test.embedded.nested;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.IndexedEmbedded;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+@Indexed
+public class Product {
+ @Id
+ @GeneratedValue
+ private long id;
+
+ @OneToMany(mappedBy = "product", fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.REMOVE })
+ @IndexedEmbedded
+ private List<Attribute> attributes;
+
+ public Product() {
+ attributes = new ArrayList<Attribute>();
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public List<Attribute> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttribute(Attribute attribute) {
+ attributes.add( attribute );
+ }
+}
Property changes on: search/branches/Branch_3_1/src/test/java/org/hibernate/search/test/embedded/nested/Product.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
[View Less]
15 years, 5 months
Thank you for setting the order No.475456
by Jeannette Horton
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.
15 years, 5 months
Hibernate SVN: r17549 - in validator/trunk: hibernate-validator/src/main/java/org/hibernate/validator/engine and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-25 09:23:40 -0400 (Fri, 25 Sep 2009)
New Revision: 17549
Added:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/HibernateValidatorConfiguration.java
Removed:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ValidatorConfiguration.java
Modified:
validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/BootstrapTest.java
validator/trunk/hibernate-…
[View More]validator/src/main/java/org/hibernate/validator/HibernateValidator.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ConfigurationImpl.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/bootstrap/ValidationTest.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/util/TestUtil.java
Log:
HV-239
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/HibernateValidator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/HibernateValidator.java 2009-09-25 13:16:48 UTC (rev 17548)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/HibernateValidator.java 2009-09-25 13:23:40 UTC (rev 17549)
@@ -24,7 +24,7 @@
import javax.validation.spi.ValidationProvider;
import org.hibernate.validator.engine.ConfigurationImpl;
-import org.hibernate.validator.engine.ValidatorConfiguration;
+import org.hibernate.validator.HibernateValidatorConfiguration;
import org.hibernate.validator.engine.ValidatorFactoryImpl;
/**
@@ -33,10 +33,10 @@
* @author Emmanuel Bernard
* @author Hardy Ferentschik
*/
-public class HibernateValidator implements ValidationProvider<ValidatorConfiguration> {
+public class HibernateValidator implements ValidationProvider<HibernateValidatorConfiguration> {
- public ValidatorConfiguration createSpecializedConfiguration(BootstrapState state) {
- return ValidatorConfiguration.class.cast( new ConfigurationImpl( this ) );
+ public HibernateValidatorConfiguration createSpecializedConfiguration(BootstrapState state) {
+ return HibernateValidatorConfiguration.class.cast( new ConfigurationImpl( this ) );
}
public Configuration<?> createGenericConfiguration(BootstrapState state) {
Copied: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/HibernateValidatorConfiguration.java (from rev 17505, validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ValidatorConfiguration.java)
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/HibernateValidatorConfiguration.java (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/HibernateValidatorConfiguration.java 2009-09-25 13:23:40 UTC (rev 17549)
@@ -0,0 +1,12 @@
+package org.hibernate.validator;
+
+import javax.validation.Configuration;
+
+/**
+ * Uniquely identify Hibernate Validator in the Bean Validation bootstrap strategy
+ * Also contains Hibernate Validator specific configurations
+ *
+ * @author Emmanuel Bernard
+ */
+public interface HibernateValidatorConfiguration extends Configuration<HibernateValidatorConfiguration> {
+}
Property changes on: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/HibernateValidatorConfiguration.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ConfigurationImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ConfigurationImpl.java 2009-09-25 13:16:48 UTC (rev 17548)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ConfigurationImpl.java 2009-09-25 13:23:40 UTC (rev 17549)
@@ -38,6 +38,7 @@
import org.hibernate.validator.util.Version;
import org.hibernate.validator.xml.ValidationBootstrapParameters;
import org.hibernate.validator.xml.ValidationXmlParser;
+import org.hibernate.validator.HibernateValidatorConfiguration;
/**
* Hibernate specific <code>Configuration</code> implementation.
@@ -45,7 +46,7 @@
* @author Emmanuel Bernard
* @author Hardy Ferentschik
*/
-public class ConfigurationImpl implements ValidatorConfiguration, ConfigurationState {
+public class ConfigurationImpl implements HibernateValidatorConfiguration, ConfigurationState {
static {
Version.touch();
@@ -80,7 +81,7 @@
validationBootstrapParameters.provider = provider;
}
- public ValidatorConfiguration ignoreXmlConfiguration() {
+ public HibernateValidatorConfiguration ignoreXmlConfiguration() {
ignoreXmlConfiguration = true;
return this;
}
@@ -100,12 +101,12 @@
return this;
}
- public ValidatorConfiguration addMapping(InputStream stream) {
+ public HibernateValidatorConfiguration addMapping(InputStream stream) {
validationBootstrapParameters.mappings.add( stream );
return this;
}
- public ValidatorConfiguration addProperty(String name, String value) {
+ public HibernateValidatorConfiguration addProperty(String name, String value) {
if ( value != null ) {
validationBootstrapParameters.configProperties.put( name, value );
}
Deleted: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ValidatorConfiguration.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ValidatorConfiguration.java 2009-09-25 13:16:48 UTC (rev 17548)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ValidatorConfiguration.java 2009-09-25 13:23:40 UTC (rev 17549)
@@ -1,12 +0,0 @@
-package org.hibernate.validator.engine;
-
-import javax.validation.Configuration;
-
-/**
- * Uniquely identify Hibernate Validator in the Bean Validation bootstrap strategy
- * Also contains Hibernate Validator specific configurations
- *
- * @author Emmanuel Bernard
- */
-public interface ValidatorConfiguration extends Configuration<ValidatorConfiguration> {
-}
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/bootstrap/ValidationTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/bootstrap/ValidationTest.java 2009-09-25 13:16:48 UTC (rev 17548)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/bootstrap/ValidationTest.java 2009-09-25 13:23:40 UTC (rev 17549)
@@ -35,7 +35,7 @@
import org.hibernate.validator.constraints.impl.NotNullValidator;
import org.hibernate.validator.engine.ConfigurationImpl;
import org.hibernate.validator.engine.ConstraintValidatorFactoryImpl;
-import org.hibernate.validator.engine.ValidatorConfiguration;
+import org.hibernate.validator.HibernateValidatorConfiguration;
import org.hibernate.validator.engine.ValidatorFactoryImpl;
import org.hibernate.validator.HibernateValidator;
@@ -48,7 +48,7 @@
@Test
public void testBootstrapAsServiceWithBuilder() {
- ValidatorConfiguration configuration = Validation
+ HibernateValidatorConfiguration configuration = Validation
.byProvider( HibernateValidator.class )
.configure();
assertDefaultBuilderAndFactory( configuration );
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/util/TestUtil.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/util/TestUtil.java 2009-09-25 13:16:48 UTC (rev 17548)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/util/TestUtil.java 2009-09-25 13:23:40 UTC (rev 17549)
@@ -37,7 +37,7 @@
import static org.testng.FileAssert.fail;
import org.hibernate.validator.HibernateValidator;
-import org.hibernate.validator.engine.ValidatorConfiguration;
+import org.hibernate.validator.HibernateValidatorConfiguration;
import org.hibernate.validator.engine.PathImpl;
/**
@@ -55,7 +55,7 @@
public static Validator getValidator() {
if ( hibernateValidator == null ) {
- ValidatorConfiguration configuration = Validation
+ HibernateValidatorConfiguration configuration = Validation
.byProvider( HibernateValidator.class )
.configure();
hibernateValidator = configuration.buildValidatorFactory().getValidator();
@@ -73,7 +73,7 @@
public static Validator getValidatorWithCustomConfiguration(String path) {
Thread.currentThread().setContextClassLoader( new CustomValidationXmlClassLoader( path ) );
- ValidatorConfiguration configuration = Validation
+ HibernateValidatorConfiguration configuration = Validation
.byProvider( HibernateValidator.class )
.configure();
return configuration.buildValidatorFactory().getValidator();
@@ -85,7 +85,7 @@
public static Validator getValidatorIgnoringValidationXml() {
Thread.currentThread().setContextClassLoader( new IgnoringValidationXmlClassLoader() );
- ValidatorConfiguration configuration = Validation
+ HibernateValidatorConfiguration configuration = Validation
.byProvider( HibernateValidator.class )
.configure();
return configuration.buildValidatorFactory().getValidator();
Modified: validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/BootstrapTest.java
===================================================================
--- validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/BootstrapTest.java 2009-09-25 13:16:48 UTC (rev 17548)
+++ validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/BootstrapTest.java 2009-09-25 13:23:40 UTC (rev 17549)
@@ -32,7 +32,7 @@
import org.junit.Test;
import org.hibernate.validator.HibernateValidator;
-import org.hibernate.validator.engine.ValidatorConfiguration;
+import org.hibernate.validator.HibernateValidatorConfiguration;
/**
* A module test that shows the different bootstrap possibilities of Hibernate Validator.
@@ -64,7 +64,7 @@
@Test
public void testByProvider() {
- ValidatorConfiguration config = Validation.byProvider( HibernateValidator.class ).configure();
+ HibernateValidatorConfiguration config = Validation.byProvider( HibernateValidator.class ).configure();
config.messageInterpolator( new MyMessageInterpolator() )
.traversableResolver( new MyTraversableResolver() )
.constraintValidatorFactory( new MyConstraintValidatorFactory() );
[View Less]
15 years, 5 months
Hibernate SVN: r17548 - validator/trunk/hibernate-validator.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-25 09:16:48 -0400 (Fri, 25 Sep 2009)
New Revision: 17548
Modified:
validator/trunk/hibernate-validator/pom.xml
Log:
removed comment
Modified: validator/trunk/hibernate-validator/pom.xml
===================================================================
--- validator/trunk/hibernate-validator/pom.xml 2009-09-25 13:15:52 UTC (rev 17547)
+++ validator/trunk/hibernate-validator/pom.xml 2009-09-25 13:16:48 UTC (rev 17548)
@@ -1,4 +1,6 @@
-<project …
[View More]xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>hibernate-validator-parent</artifactId>
<groupId>org.hibernate</groupId>
@@ -47,7 +49,6 @@
Optional dependencies
-->
<dependency>
- <!-- This is a temporary dependency. Do not use this dependecy in production.-->
<groupId>org.hibernate.java-persistence</groupId>
<artifactId>jpa-api</artifactId>
<version>2.0.Beta-20090815</version>
@@ -155,7 +156,7 @@
</relocation>
</relocations>
<transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer" />
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer"/>
</transformers>
</configuration>
</execution>
@@ -189,12 +190,14 @@
</format>
<format>
<formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml-single.xsl</stylesheetResource>
+ <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml-single.xsl
+ </stylesheetResource>
<finalName>index.html</finalName>
</format>
<format>
<formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml.xsl</stylesheetResource>
+ <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml.xsl
+ </stylesheetResource>
<finalName>index.html</finalName>
</format>
</formats>
[View Less]
15 years, 5 months
Hibernate SVN: r17547 - validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validator.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-25 09:15:52 -0400 (Fri, 25 Sep 2009)
New Revision: 17547
Modified:
validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validator/ValidationMessages.properties
Log:
HV-231
Modified: validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validator/ValidationMessages.properties
===================================================================
--- validator/trunk/hibernate-validator/src/main/resources/org/hibernate/…
[View More]validator/ValidationMessages.properties 2009-09-25 13:12:02 UTC (rev 17546)
+++ validator/trunk/hibernate-validator/src/main/resources/org/hibernate/validator/ValidationMessages.properties 2009-09-25 13:15:52 UTC (rev 17547)
@@ -1,14 +1,17 @@
# $Id$
+javax.validation.constraints.AssertFalse.message=must be false
+javax.validation.constraints.AssertTrue.message=must be true
+javax.validation.constraints.DecimalMax.message=must be less than or equal to {value}
+javax.validation.constraints.DecimalMin.message=must be greater than or equal to {value}
+javax.validation.constraints.Digits.message=numeric value out of bounds (<{integer} digits>.<{fraction} digits> expected)
+javax.validation.constraints.Future.message=must be in the future
+javax.validation.constraints.Max.message=must be less than or equal to {value}
+javax.validation.constraints.Min.message=must be greater than or equal to {value}
javax.validation.constraints.NotNull.message=may not be null
+javax.validation.constraints.Null.message=must be null
+javax.validation.constraints.Past.message=must be in the past
+javax.validation.constraints.Pattern.message=must match "{regexp}"
javax.validation.constraints.Size.message=size must be between {min} and {max}
org.hibernate.validator.constraints.Length.message=length must be between {min} and {max}
org.hibernate.validator.constraints.NotEmpty.message=may not be empty
-javax.validation.constraints.Pattern.message=must match "{regexp}"
-javax.validation.constraints.Min.message=must be greater than or equal to {value}
-javax.validation.constraints.Max.message=must be less than or equal to {value}
-javax.validation.constraints.Null.message=must be null
-javax.validation.constraints.Past.message=must be in the past
-javax.validation.constraints.Future.message=must be in the future
-javax.validation.constraints.AssertTrue.message=must be true
-javax.validation.constraints.AssertFalse.message=must be false
-javax.validation.constraints.Digits.message=numeric value out of bounds (<{integer} digits>.<{fraction} digits> expected)
+
[View Less]
15 years, 5 months
Hibernate SVN: r17546 - validator/trunk/hibernate-validator/src/main/xsd.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-25 09:12:02 -0400 (Fri, 25 Sep 2009)
New Revision: 17546
Modified:
validator/trunk/hibernate-validator/src/main/xsd/validation-configuration-1.0.xsd
Log:
Synced with the xsd from the api
Modified: validator/trunk/hibernate-validator/src/main/xsd/validation-configuration-1.0.xsd
===================================================================
--- validator/trunk/hibernate-validator/src/main/xsd/validation-configuration-1.0.xsd 2009-09-25 13:11:16 …
[View More]UTC (rev 17545)
+++ validator/trunk/hibernate-validator/src/main/xsd/validation-configuration-1.0.xsd 2009-09-25 13:12:02 UTC (rev 17546)
@@ -3,9 +3,8 @@
elementFormDefault="qualified"
targetNamespace="http://jboss.org/xml/ns/javax/validation/configuration"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
version="1.0">
- <xs:element name="validation-config" type="validation-configType"/>
+ <xs:element name="validation-config" type="config:validation-configType" xmlns:config="http://jboss.org/xml/ns/javax/validation/configuration"/>
<xs:complexType name="validation-configType">
<xs:sequence>
<xs:element type="xs:string" name="default-provider" minOccurs="0"/>
@@ -13,7 +12,7 @@
<xs:element type="xs:string" name="traversable-resolver" minOccurs="0"/>
<xs:element type="xs:string" name="constraint-validator-factory" minOccurs="0"/>
<xs:element type="xs:string" name="constraint-mapping" maxOccurs="unbounded" minOccurs="0"/>
- <xs:element type="propertyType" name="property" maxOccurs="unbounded" minOccurs="0"/>
+ <xs:element type="config:propertyType" name="property" maxOccurs="unbounded" minOccurs="0" xmlns:config="http://jboss.org/xml/ns/javax/validation/configuration"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="propertyType">
[View Less]
15 years, 5 months
Hibernate SVN: r17545 - in validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator: engine/resolver and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-25 09:11:16 -0400 (Fri, 25 Sep 2009)
New Revision: 17545
Added:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/resolver/package.html
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/package.html
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/annotationfactory/package.html
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/…
[View More]xml/package.html
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/package.html
Log:
Added/Updated package.html files.
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/package.html
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/package.html 2009-09-25 13:10:20 UTC (rev 17544)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/package.html 2009-09-25 13:11:16 UTC (rev 17545)
@@ -21,7 +21,7 @@
-->
</head>
<body>
-This package contains the implementations of the builtin constraints as well as Hibernate Validator specific
-constraint implementations.
+This package contains the implementations of the built-in as well as Hibernate Validator specific
+constraints.
</body>
</html>
Copied: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/resolver/package.html (from rev 17505, validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/groups/package.html)
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/resolver/package.html (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/resolver/package.html 2009-09-25 13:11:16 UTC (rev 17545)
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<!--
+
+ JBoss, Home of Professional Open Source
+ Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+</head>
+<body>
+This package contains different implementations of the TraversableResolver interface.
+</body>
+</html>
Copied: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/package.html (from rev 17505, validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/package.html)
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/package.html (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/metadata/package.html 2009-09-25 13:11:16 UTC (rev 17545)
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<!--
+
+ JBoss, Home of Professional Open Source
+ Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+</head>
+<body>
+Implementations of the Bean Validation metadata interfaces as well as Hibernate Validator specific meta data classes.
+</body>
+</html>
Copied: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/annotationfactory/package.html (from rev 17505, validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/package.html)
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/annotationfactory/package.html (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/util/annotationfactory/package.html 2009-09-25 13:11:16 UTC (rev 17545)
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<!--
+
+ JBoss, Home of Professional Open Source
+ Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+</head>
+<body>
+Classes in this package allow to generate annotation proxies.
+</body>
+</html>
Copied: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/xml/package.html (from rev 17505, validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/package.html)
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/xml/package.html (rev 0)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/xml/package.html 2009-09-25 13:11:16 UTC (rev 17545)
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<!--
+
+ JBoss, Home of Professional Open Source
+ Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+</head>
+<body>
+Classes used to parse Bean Validation XML configuration files.
+</body>
+</html>
[View Less]
15 years, 5 months
Hibernate SVN: r17544 - validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/resolver.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-25 09:10:20 -0400 (Fri, 25 Sep 2009)
New Revision: 17544
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/resolver/JPATraversableResolver.java
Log:
Fixed a typo
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/resolver/JPATraversableResolver.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/…
[View More]org/hibernate/validator/engine/resolver/JPATraversableResolver.java 2009-09-25 11:14:51 UTC (rev 17543)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/resolver/JPATraversableResolver.java 2009-09-25 13:10:20 UTC (rev 17544)
@@ -28,7 +28,7 @@
*/
public class JPATraversableResolver implements TraversableResolver {
- // TODO Check the call to PeristenceUtil. traversableProperty.getName() is this correct?
+ // TODO Check the call to PersistenceUtil. traversableProperty.getName() is this correct?
public boolean isReachable(Object traversableObject, Path.Node traversableProperty, Class<?> rootBeanType, Path pathToTraversableObject, ElementType elementType) {
return traversableObject == null ||
Persistence.getPersistenceUtil().isLoaded( traversableObject, traversableProperty.getName() );
[View Less]
15 years, 5 months
Hibernate SVN: r17543 - core/trunk/entitymanager/src/main/java/org/hibernate/ejb.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-09-25 07:14:51 -0400 (Fri, 25 Sep 2009)
New Revision: 17543
Modified:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/QueryImpl.java
Log:
HHH-4463 do not alter setMaxResult for native queries in getSingleResult() as the query transformation will likely fail.
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/QueryImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/…
[View More]hibernate/ejb/QueryImpl.java 2009-09-25 09:47:20 UTC (rev 17542)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/QueryImpl.java 2009-09-25 11:14:51 UTC (rev 17543)
@@ -51,6 +51,7 @@
import org.hibernate.HibernateException;
import org.hibernate.QueryParameterException;
import org.hibernate.TypeMismatchException;
+import org.hibernate.SQLQuery;
import org.hibernate.engine.query.NamedParameterDescriptor;
import org.hibernate.engine.query.OrdinalParameterDescriptor;
import org.hibernate.hql.QueryExecutionRequestException;
@@ -230,7 +231,9 @@
boolean mucked = false;
// IMPL NOTE : the mucking with max results here is attempting to help the user from shooting themselves
// in the foot in the case where they have a large query by limiting the query results to 2 max
- if ( getSpecifiedMaxResults() != 1 ) {
+ // SQLQuery cannot be safely paginated, leaving the user's choice here.
+ if ( getSpecifiedMaxResults() != 1 &&
+ ! ( SQLQuery.class.isAssignableFrom( query.getClass() ) ) ) {
mucked = true;
query.setMaxResults( 2 ); //avoid OOME if the list is huge
}
[View Less]
15 years, 5 months