Hibernate SVN: r16631 - in search/branches/Branch_3_1/hibernate-search-archetype: src/main/resources/META-INF/maven and 5 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-05-28 18:30:05 -0400 (Thu, 28 May 2009)
New Revision: 16631
Added:
search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/Author.java
search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/Book.java
search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/test/java/IndexAndSearchTest.java
Removed:
search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/example/Author.java
search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/example/Book.java
search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/test/java/java/example/IndexAndSearchTest.java
Modified:
search/branches/Branch_3_1/hibernate-search-archetype/pom.xml
search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/META-INF/maven/archetype.xml
search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/pom.xml
Log:
udated the archetype project
Modified: search/branches/Branch_3_1/hibernate-search-archetype/pom.xml
===================================================================
--- search/branches/Branch_3_1/hibernate-search-archetype/pom.xml 2009-05-28 15:04:28 UTC (rev 16630)
+++ search/branches/Branch_3_1/hibernate-search-archetype/pom.xml 2009-05-28 22:30:05 UTC (rev 16631)
@@ -3,5 +3,5 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-quickstart</artifactId>
<packaging>jar</packaging>
- <version>3.1.0.GA</version>
+ <version>3.1.1.GA</version>
</project>
Modified: search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/META-INF/maven/archetype.xml
===================================================================
--- search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/META-INF/maven/archetype.xml 2009-05-28 15:04:28 UTC (rev 16630)
+++ search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/META-INF/maven/archetype.xml 2009-05-28 22:30:05 UTC (rev 16631)
@@ -1,15 +1,15 @@
<archetype>
<id>hibernate-search-quickstart</id>
<sources>
- <source>src/main/java/example/Book.java</source>
- <source>src/main/java/example/Author.java</source>
+ <source>src/main/java/Book.java</source>
+ <source>src/main/java/Author.java</source>
</sources>
<resources>
<resource>src/main/resources/log4j.properties</resource>
<resource>src/main/resources/META-INF/persistence.xml</resource>
</resources>
<testSources>
- <source>src/test/java/java/example/IndexAndSearchTest.java</source>
+ <source>src/test/java/IndexAndSearchTest.java</source>
</testSources>
<testResources>
<resource>src/test/resources/import.sql</resource>
Modified: search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/pom.xml
===================================================================
--- search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/pom.xml 2009-05-28 15:04:28 UTC (rev 16630)
+++ search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/pom.xml 2009-05-28 22:30:05 UTC (rev 16631)
@@ -1,5 +1,7 @@
<?xml version="1.0"?>
-<project>
+<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">
<modelVersion>4.0.0</modelVersion>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
@@ -11,13 +13,13 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.1.1.GA</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.1_3</version>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
@@ -38,7 +40,7 @@
<artifactId>solr-core</artifactId>
<version>1.3.0</version>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-snowball</artifactId>
<version>2.4.0</version>
@@ -66,6 +68,18 @@
</dependency>
</dependencies>
<build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav</artifactId>
+ <version>1.0-beta-2</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-4</version>
+ </extension>
+ </extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -76,6 +90,11 @@
<target>1.5</target>
</configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-4</version>
+ <extensions>true</extensions>
+ </plugin>
</plugins>
</build>
</project>
Copied: search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/Author.java (from rev 16630, search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/example/Author.java)
===================================================================
--- search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/Author.java (rev 0)
+++ search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/Author.java 2009-05-28 22:30:05 UTC (rev 16631)
@@ -0,0 +1,35 @@
+package ${package};
+
+import org.hibernate.search.annotations.*;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+/*
+ *
+ */
+@Entity
+public class Author {
+ @Id
+ @GeneratedValue
+ private Integer id;
+ private String name;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ @Field(index = Index.TOKENIZED, store = Store.YES)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Copied: search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/Book.java (from rev 16630, search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/example/Book.java)
===================================================================
--- search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/Book.java (rev 0)
+++ search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/Book.java 2009-05-28 22:30:05 UTC (rev 16631)
@@ -0,0 +1,86 @@
+package ${package};
+
+import org.hibernate.search.annotations.*;
+import org.apache.solr.analysis.*;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.ManyToMany;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ *
+ */
+@Entity
+@AnalyzerDef(name = "customanalyzer",
+ tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
+ filters = {
+ @TokenFilterDef(factory = LowerCaseFilterFactory.class),
+ @TokenFilterDef(factory = SnowballPorterFilterFactory.class, params = {
+ @Parameter(name = "language", value = "English")
+ })
+ })
+@Indexed
+public class Book {
+
+ private Integer id;
+ private String title;
+ private String subtitle;
+ private Set<Author> authors = new HashSet<Author>();
+ private Date publicationDate;
+
+ @IndexedEmbedded
+ @ManyToMany
+ public Set<Author> getAuthors() {
+ return authors;
+ }
+
+ public void setAuthors(Set<Author> authors) {
+ this.authors = authors;
+ }
+
+ public Book() {
+ }
+
+ @Field(index = Index.TOKENIZED, store = Store.YES)
+ @Analyzer(definition = "customanalyzer")
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ @Id
+ @DocumentId
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ @Field(index = Index.TOKENIZED, store = Store.NO)
+ @Analyzer(definition = "customanalyzer")
+ public String getSubtitle() {
+ return subtitle;
+ }
+
+ public void setSubtitle(String subtitle) {
+ this.subtitle = subtitle;
+ }
+
+ @Field(index = Index.UN_TOKENIZED, store = Store.YES)
+ @DateBridge(resolution = Resolution.DAY)
+ public Date getPublicationDate() {
+ return publicationDate;
+ }
+
+ public void setPublicationDate(Date publicationDate) {
+ this.publicationDate = publicationDate;
+ }
+}
Deleted: search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/example/Author.java
===================================================================
--- search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/example/Author.java 2009-05-28 15:04:28 UTC (rev 16630)
+++ search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/example/Author.java 2009-05-28 22:30:05 UTC (rev 16631)
@@ -1,35 +0,0 @@
-package example;
-
-import org.hibernate.search.annotations.*;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-
-/*
- *
- */
-@Entity
-public class Author {
- @Id
- @GeneratedValue
- private Integer id;
- private String name;
-
- public Integer getId() {
- return id;
- }
-
- public void setId(Integer id) {
- this.id = id;
- }
-
- @Field(index = Index.TOKENIZED, store = Store.YES)
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
Deleted: search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/example/Book.java
===================================================================
--- search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/example/Book.java 2009-05-28 15:04:28 UTC (rev 16630)
+++ search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/main/java/example/Book.java 2009-05-28 22:30:05 UTC (rev 16631)
@@ -1,88 +0,0 @@
-package example;
-
-import org.hibernate.search.annotations.*;
-import org.apache.solr.analysis.*;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.ManyToMany;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
-
-import example.Author;
-
-/**
- *
- */
-@Entity
-@AnalyzerDef(name = "customanalyzer",
- tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
- filters = {
- @TokenFilterDef(factory = LowerCaseFilterFactory.class),
- @TokenFilterDef(factory = SnowballPorterFilterFactory.class, params = {
- @Parameter(name = "language", value = "English")
- })
- })
-@Indexed
-public class Book {
-
- private Integer id;
- private String title;
- private String subtitle;
- private Set<Author> authors = new HashSet<Author>();
- private Date publicationDate;
-
- @IndexedEmbedded
- @ManyToMany
- public Set<Author> getAuthors() {
- return authors;
- }
-
- public void setAuthors(Set<Author> authors) {
- this.authors = authors;
- }
-
- public Book() {
- }
-
- @Field(index = Index.TOKENIZED, store = Store.YES)
- @Analyzer(definition = "customanalyzer")
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- @Id
- @DocumentId
- public Integer getId() {
- return id;
- }
-
- public void setId(Integer id) {
- this.id = id;
- }
-
- @Field(index = Index.TOKENIZED, store = Store.NO)
- @Analyzer(definition = "customanalyzer")
- public String getSubtitle() {
- return subtitle;
- }
-
- public void setSubtitle(String subtitle) {
- this.subtitle = subtitle;
- }
-
- @Field(index = Index.UN_TOKENIZED, store = Store.YES)
- @DateBridge(resolution = Resolution.DAY)
- public Date getPublicationDate() {
- return publicationDate;
- }
-
- public void setPublicationDate(Date publicationDate) {
- this.publicationDate = publicationDate;
- }
-}
Copied: search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/test/java/IndexAndSearchTest.java (from rev 16630, search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/test/java/java/example/IndexAndSearchTest.java)
===================================================================
--- search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/test/java/IndexAndSearchTest.java (rev 0)
+++ search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/test/java/IndexAndSearchTest.java 2009-05-28 22:30:05 UTC (rev 16631)
@@ -0,0 +1,141 @@
+package ${package};
+
+import org.apache.lucene.queryParser.MultiFieldQueryParser;
+import org.apache.lucene.queryParser.ParseException;
+import org.apache.lucene.queryParser.QueryParser;
+import org.hibernate.Session;
+import org.hibernate.ejb.Ejb3Configuration;
+import org.hibernate.search.FullTextSession;
+import org.hibernate.search.jpa.FullTextEntityManager;
+import org.hibernate.search.jpa.FullTextQuery;
+import org.junit.After;
+import static org.junit.Assert.assertEquals;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Query;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class IndexAndSearchTest {
+
+ private EntityManagerFactory emf;
+
+ private EntityManager em;
+
+ private static Logger log = LoggerFactory.getLogger(IndexAndSearchTest.class);
+
+ @Before
+ public void setUp() {
+ initHibernate();
+ }
+
+ @After
+ public void tearDown() {
+ purge();
+ }
+
+ @Test
+ public void testIndexAndSearch() throws Exception {
+ List<Book> books = search("hibernate");
+ assertEquals("Should get empty list since nothing is indexed yet", 0, books.size());
+
+ index();
+
+ // search by title
+ books = search("hibernate");
+ assertEquals("Should find one book", 1, books.size());
+ assertEquals("Wrong title", "Java Persistence with Hibernate", books.get(0).getTitle());
+
+ // search author
+ books = search("\"Gavin King\"");
+ assertEquals("Should find one book", 1, books.size());
+ assertEquals("Wrong title", "Java Persistence with Hibernate", books.get(0).getTitle());
+ }
+
+ @Test
+ public void testStemming() throws Exception {
+
+ index();
+
+ List<Book> books = search("refactor");
+ assertEquals("Wrong title", "Refactoring: Improving the Design of Existing Code", books.get(0).getTitle());
+
+ books = search("refactors");
+ assertEquals("Wrong title", "Refactoring: Improving the Design of Existing Code", books.get(0).getTitle());
+
+ books = search("refactored");
+ assertEquals("Wrong title", "Refactoring: Improving the Design of Existing Code", books.get(0).getTitle());
+
+ books = search("refactoring");
+ assertEquals("Wrong title", "Refactoring: Improving the Design of Existing Code", books.get(0).getTitle());
+ }
+
+
+ private void initHibernate() {
+ Ejb3Configuration config = new Ejb3Configuration();
+ config.configure("hibernate-search-example", new HashMap());
+ emf = config.buildEntityManagerFactory();
+ em = emf.createEntityManager();
+ }
+
+ private void index() {
+ em.getTransaction().begin();
+ FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession((Session) em.getDelegate());
+ List<Book> results = ftSession.createCriteria(Book.class).list();
+ for (Object obj : results) {
+ ftSession.index(obj);
+ }
+ em.getTransaction().commit();
+ }
+
+ private void purge() {
+ em.getTransaction().begin();
+ FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession((Session) em.getDelegate());
+ ftSession.purgeAll(Book.class);
+ em.getTransaction().commit();
+ }
+
+ private List<Book> search(String searchQuery) throws ParseException {
+ Query query = searchQuery(searchQuery);
+
+ List<Book> books = query.getResultList();
+
+ for (Book b : books) {
+ log.info("Title: " + b.getTitle());
+ }
+ return books;
+ }
+
+ private Query searchQuery(String searchQuery) throws ParseException {
+
+ String[] bookFields = {"title", "subtitle", "authors.name", "publicationDate"};
+
+ //lucene part
+ Map<String, Float> boostPerField = new HashMap<String, Float>(4);
+ boostPerField.put(bookFields[0], (float) 4);
+ boostPerField.put(bookFields[1], (float) 3);
+ boostPerField.put(bookFields[2], (float) 4);
+ boostPerField.put(bookFields[3], (float) .5);
+
+ FullTextEntityManager ftEm = org.hibernate.search.jpa.Search.getFullTextEntityManager((EntityManager) em);
+
+ QueryParser parser = new MultiFieldQueryParser(bookFields, ftEm.getSearchFactory().getAnalyzer("customanalyzer"),
+ boostPerField);
+
+ org.apache.lucene.search.Query luceneQuery;
+ luceneQuery = parser.parse(searchQuery);
+
+ final FullTextQuery query = ftEm.createFullTextQuery(luceneQuery, Book.class);
+
+ return query;
+ }
+
+}
+
Deleted: search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/test/java/java/example/IndexAndSearchTest.java
===================================================================
--- search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/test/java/java/example/IndexAndSearchTest.java 2009-05-28 15:04:28 UTC (rev 16630)
+++ search/branches/Branch_3_1/hibernate-search-archetype/src/main/resources/archetype-resources/src/test/java/java/example/IndexAndSearchTest.java 2009-05-28 22:30:05 UTC (rev 16631)
@@ -1,138 +0,0 @@
-package example;
-
-import org.apache.lucene.queryParser.MultiFieldQueryParser;
-import org.apache.lucene.queryParser.ParseException;
-import org.apache.lucene.queryParser.QueryParser;
-import org.hibernate.Session;
-import org.hibernate.ejb.Ejb3Configuration;
-import org.hibernate.search.FullTextSession;
-import org.hibernate.search.jpa.FullTextEntityManager;
-import org.hibernate.search.jpa.FullTextQuery;
-import org.junit.After;
-import static org.junit.Assert.assertEquals;
-import org.junit.Before;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Query;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- *
- */
-public class IndexAndSearchTest {
-
- private EntityManagerFactory emf;
-
- private EntityManager em;
-
- private static Logger log = LoggerFactory.getLogger(IndexAndSearchTest.class);
-
- @Before
- public void setUp() {
- initHibernate();
- }
-
- @After
- public void tearDown() {
- purge();
- }
-
- @Test
- public void testIndexAndSearch() throws Exception {
- List<Book> books = search("hibernate");
- assertEquals("Should get empty list since nothing is indexed yet", 0, books.size());
-
- index();
-
- // search by title
- books = search("hibernate");
- assertEquals("Should find one book", 1, books.size());
- assertEquals("Wrong title", "Java Persistence with Hibernate", books.get(0).getTitle());
-
- // search author
- books = search("\"Gavin King\"");
- assertEquals("Should find one book", 1, books.size());
- assertEquals("Wrong title", "Java Persistence with Hibernate", books.get(0).getTitle());
- }
-
- @Test
- public void testStemming() throws Exception {
-
- index();
-
- List<Book> books = search("refactor");
- assertEquals("Wrong title", "Refactoring: Improving the Design of Existing Code", books.get(0).getTitle());
-
- books = search("refactors");
- assertEquals("Wrong title", "Refactoring: Improving the Design of Existing Code", books.get(0).getTitle());
-
- books = search("refactored");
- assertEquals("Wrong title", "Refactoring: Improving the Design of Existing Code", books.get(0).getTitle());
-
- books = search("refactoring");
- assertEquals("Wrong title", "Refactoring: Improving the Design of Existing Code", books.get(0).getTitle());
- }
-
-
- private void initHibernate() {
- Ejb3Configuration config = new Ejb3Configuration();
- config.configure("hibernate-search-example", new HashMap());
- emf = config.buildEntityManagerFactory();
- em = emf.createEntityManager();
- }
-
- private void index() {
- FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession((Session) em.getDelegate());
- List results = ftSession.createCriteria(Book.class).list();
- for (Object obj : results) {
- ftSession.index(obj);
- }
- }
-
- private void purge() {
- FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession((Session) em.getDelegate());
- ftSession.purgeAll(Book.class);
- }
-
- private List<Book> search(String searchQuery) throws ParseException {
- Query query = searchQuery(searchQuery);
-
- List<Book> books = query.getResultList();
-
- for (Book b : books) {
- log.info("Title: " + b.getTitle());
- }
- return books;
- }
-
- private Query searchQuery(String searchQuery) throws ParseException {
-
- String[] bookFields = {"title", "subtitle", "authors.name", "publicationDate"};
-
- //lucene part
- Map<String, Float> boostPerField = new HashMap<String, Float>(4);
- boostPerField.put(bookFields[0], (float) 4);
- boostPerField.put(bookFields[1], (float) 3);
- boostPerField.put(bookFields[2], (float) 4);
- boostPerField.put(bookFields[3], (float) .5);
-
- FullTextEntityManager ftEm = org.hibernate.search.jpa.Search.getFullTextEntityManager((EntityManager) em);
-
- QueryParser parser = new MultiFieldQueryParser(bookFields, ftEm.getSearchFactory().getAnalyzer("customanalyzer"),
- boostPerField);
-
- org.apache.lucene.search.Query luceneQuery;
- luceneQuery = parser.parse(searchQuery);
-
- final FullTextQuery query = ftEm.createFullTextQuery(luceneQuery, Book.class);
-
- return query;
- }
-
-}
15 years, 6 months
Hibernate SVN: r16630 - search/tags.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-05-28 11:04:28 -0400 (Thu, 28 May 2009)
New Revision: 16630
Added:
search/tags/v3_1_1_GA/
Log:
tag HSearch 3.1.1.GA
Copied: search/tags/v3_1_1_GA (from rev 16629, search/branches/Branch_3_1)
15 years, 6 months
Hibernate SVN: r16629 - in search/branches/Branch_3_1: src/main/docbook/en-US and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-05-28 11:03:17 -0400 (Thu, 28 May 2009)
New Revision: 16629
Modified:
search/branches/Branch_3_1/changelog.txt
search/branches/Branch_3_1/pom.xml
search/branches/Branch_3_1/readme.txt
search/branches/Branch_3_1/src/main/docbook/en-US/master.xml
search/branches/Branch_3_1/src/main/docbook/en-US/modules/getting-started.xml
search/branches/Branch_3_1/src/main/java/org/hibernate/search/Version.java
Log:
release of HSearch 3.1.1
Modified: search/branches/Branch_3_1/changelog.txt
===================================================================
--- search/branches/Branch_3_1/changelog.txt 2009-05-28 09:09:50 UTC (rev 16628)
+++ search/branches/Branch_3_1/changelog.txt 2009-05-28 15:03:17 UTC (rev 16629)
@@ -1,8 +1,33 @@
Hibernate Search Changelog
==========================
+3.1.1.GA (28-05-2009)
+---------------------
+
+** Bug
+ * [HSEARCH-178] - Out of transaction work causes collection lazy loading to throw AssertionFailure
+ * [HSEARCH-310] - Out of Memory on ScrollableResults
+ * [HSEARCH-325] - FullTextQuery.iterate() skips last result.
+ * [HSEARCH-330] - NegativeArraySizeException if you use FullTextQuery.setMaxResults(Integer.MAX_VALUE)
+ * [HSEARCH-338] - ScrollableResults initial position not coherent to core Hibernate
+ * [HSEARCH-339] - ScrollableResults may return unmanaged entities from it's own cache
+ * [HSEARCH-342] - Delete on unindexed entities referenced by indexed entities with ContainedIn annotation failed
+ * [HSEARCH-355] - FilterOptimizationHelper was improperly using method overloading
+ * [HSEARCH-357] - IdBridge being applied on null entity during purgeAll()
+ * [HSEARCH-360] - Hibernate Search 3.1.0GA Bugs after HSEARCH-160
+
+
+** Improvement
+ * [HSEARCH-340] - ScrollableResults exploits batch loading for backwards and random order scrolling
+ * [HSEARCH-369] - typos in documentation
+
+
+** Task
+ * [HSEARCH-348] - Upgrade to Lucene 2.4.1
+
+
3.1.0.GA (4-12-2008)
-------------------------
+--------------------
** Bug
* [HSEARCH-233] - EntityNotFoundException during indexing
Modified: search/branches/Branch_3_1/pom.xml
===================================================================
--- search/branches/Branch_3_1/pom.xml 2009-05-28 09:09:50 UTC (rev 16628)
+++ search/branches/Branch_3_1/pom.xml 2009-05-28 15:03:17 UTC (rev 16629)
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
- <version>3.1.1-SNAPSHOT</version>
+ <version>3.1.1.GA</version>
<name>Hibernate Search</name>
<description>Hibernate Search</description>
<url>http://search.hibernate.org</url>
Modified: search/branches/Branch_3_1/readme.txt
===================================================================
--- search/branches/Branch_3_1/readme.txt 2009-05-28 09:09:50 UTC (rev 16628)
+++ search/branches/Branch_3_1/readme.txt 2009-05-28 15:03:17 UTC (rev 16629)
@@ -1,6 +1,6 @@
Hibernate Search
==================================================
-Version: 3.1.0.GA, 4.12.2008
+Version: 3.1.1.GA, 28.05.2009
Description
-----------
Modified: search/branches/Branch_3_1/src/main/docbook/en-US/master.xml
===================================================================
--- search/branches/Branch_3_1/src/main/docbook/en-US/master.xml 2009-05-28 09:09:50 UTC (rev 16628)
+++ search/branches/Branch_3_1/src/main/docbook/en-US/master.xml 2009-05-28 15:03:17 UTC (rev 16629)
@@ -25,7 +25,7 @@
-->
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY versionNumber "3.1.0.GA">
+<!ENTITY versionNumber "3.1.1.GA">
<!ENTITY copyrightYear "2004">
<!ENTITY copyrightHolder "Red Hat Middleware, LLC.">
]>
Modified: search/branches/Branch_3_1/src/main/docbook/en-US/modules/getting-started.xml
===================================================================
--- search/branches/Branch_3_1/src/main/docbook/en-US/modules/getting-started.xml 2009-05-28 09:09:50 UTC (rev 16628)
+++ search/branches/Branch_3_1/src/main/docbook/en-US/modules/getting-started.xml 2009-05-28 15:03:17 UTC (rev 16629)
@@ -129,7 +129,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.1.1.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
@@ -154,7 +154,7 @@
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-snowball</artifactId>
- <version>2.4.0</version>
+ <version>2.4.1</version>
</dependency>
</programlisting>
</example>
@@ -639,7 +639,7 @@
<programlisting>mvn archetype:create \
-DarchetypeGroupId=org.hibernate \
-DarchetypeArtifactId=hibernate-search-quickstart \
- -DarchetypeVersion=3.1.0.GA \
+ -DarchetypeVersion=3.1.1.GA \
-DgroupId=my.company -DartifactId=quickstart</programlisting>
</example>
Modified: search/branches/Branch_3_1/src/main/java/org/hibernate/search/Version.java
===================================================================
--- search/branches/Branch_3_1/src/main/java/org/hibernate/search/Version.java 2009-05-28 09:09:50 UTC (rev 16628)
+++ search/branches/Branch_3_1/src/main/java/org/hibernate/search/Version.java 2009-05-28 15:03:17 UTC (rev 16629)
@@ -8,7 +8,7 @@
*/
public class Version {
- public static final String VERSION = "3.1.1-SNAPSHOT";
+ public static final String VERSION = "3.1.1.GA";
static {
LoggerFactory.make().info( "Hibernate Search {}", VERSION );
15 years, 6 months
Hibernate SVN: r16628 - in annotations/branches/v3_3_1_GA_CP: doc/reference/en and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2009-05-28 05:09:50 -0400 (Thu, 28 May 2009)
New Revision: 16628
Modified:
annotations/branches/v3_3_1_GA_CP/build.xml
annotations/branches/v3_3_1_GA_CP/changelog.txt
annotations/branches/v3_3_1_GA_CP/doc/reference/en/master.xml
annotations/branches/v3_3_1_GA_CP/readme.txt
annotations/branches/v3_3_1_GA_CP/src/java/org/hibernate/cfg/annotations/Version.java
Log:
JBPAPP-2038 : Upgrade Hibernate Annotations to 3.3.1.GA.CP01 for EAP 4.2 CP07 / 4.3 CP05
Modified: annotations/branches/v3_3_1_GA_CP/build.xml
===================================================================
--- annotations/branches/v3_3_1_GA_CP/build.xml 2009-05-28 02:31:44 UTC (rev 16627)
+++ annotations/branches/v3_3_1_GA_CP/build.xml 2009-05-28 09:09:50 UTC (rev 16628)
@@ -17,7 +17,7 @@
<!-- Name of project and version, used to create filenames -->
<property name="Name" value="Hibernate Annotations"/>
<property name="name" value="hibernate-annotations"/>
- <property name="version" value="3.3.1.GA"/>
+ <property name="version" value="3.3.1.GA.CP01"/>
<property name="javadoc.packagenames" value="org.hibernate.*"/>
<property name="jdbc.dir" value="jdbc"/>
<property name="copy.test" value="true"/>
Modified: annotations/branches/v3_3_1_GA_CP/changelog.txt
===================================================================
--- annotations/branches/v3_3_1_GA_CP/changelog.txt 2009-05-28 02:31:44 UTC (rev 16627)
+++ annotations/branches/v3_3_1_GA_CP/changelog.txt 2009-05-28 09:09:50 UTC (rev 16628)
@@ -1,6 +1,23 @@
Hibernate Annotations Changelog
===============================
+3.3.1.GA.CP01
+---------------------
+
+** Bug
+ * [JBPAPP-1069] - Annotations - MSSQL/Oracle - Reserved word "File" causes test to fail
+ * [JBPAPP-1070] - Annotations - MSSQL/Sybase - Duplicate fields in "order by"
+ * [JBPAPP-1072] - Annotations - Oracle - "date"/"number" is reserved in Oracle
+ * [JBPAPP-1073] - Annotations - Oracle - "size" is reserved in Oracle
+ * [JBPAPP-1124 / ANN-779] - Oracle/DB2 - Identifier is too long
+ * [JBPAPP-1852 / ANN-778] - Test hangs if an exception is thrown, due to unclosed transaction
+ * [JBPAPP-1859 / ANN-742] - Primary key should not be set on nullable column
+ * [JBPAPP-1878 / ANN-817] - 8-bit characters in string values cause unit test failures
+ * [JBPAPP-1879 / ANN-818] - @DiscriminatorFormula for an integer column with default discriminator type causes failure for DB2/Sybase
+ * [JBPAPP-1890 / ANN-821] - org.hibernate.test.annotations.manytomany.ManyToManyTest fails on sybase due to index too large
+ * [JBPAPP-1894 / ANN-822] - org.hibernate.test.annotations.EntityTest fails because DB2 does not support unique constraints on nullable columns
+ * [JBPAPP-2032] - Annotations - Upgrading from 3.2.x to 3.3.x may cause backward-compatibility issue due to ANN-683
+
3.3.1.GA (14-03-2008)
---------------------
@@ -683,4 +700,4 @@
- use of referencedColumnName for column other than the PK ones @ManyToMany (HBX-62)
- Support for a true bidirectional one to one relationship (HBX-177)
- support for initialValue and allocationSize in @SequenceGenerator (HBX-59)
- - finish support of optional=false (HBX-190)
\ No newline at end of file
+ - finish support of optional=false (HBX-190)
Modified: annotations/branches/v3_3_1_GA_CP/doc/reference/en/master.xml
===================================================================
--- annotations/branches/v3_3_1_GA_CP/doc/reference/en/master.xml 2009-05-28 02:31:44 UTC (rev 16627)
+++ annotations/branches/v3_3_1_GA_CP/doc/reference/en/master.xml 2009-05-28 09:09:50 UTC (rev 16628)
@@ -12,7 +12,7 @@
<subtitle>Reference Guide</subtitle>
- <releaseinfo>3.3.1.GA</releaseinfo>
+ <releaseinfo>3.3.1.GA.CP01</releaseinfo>
<mediaobject>
<imageobject>
@@ -74,4 +74,4 @@
&additionalmodules;
-</book>
\ No newline at end of file
+</book>
Modified: annotations/branches/v3_3_1_GA_CP/readme.txt
===================================================================
--- annotations/branches/v3_3_1_GA_CP/readme.txt 2009-05-28 02:31:44 UTC (rev 16627)
+++ annotations/branches/v3_3_1_GA_CP/readme.txt 2009-05-28 09:09:50 UTC (rev 16628)
@@ -1,6 +1,6 @@
Hibernate Annotations
==================================================
-Version: 3.3.1.GA, 14.03.2008
+Version: 3.3.1.GA.CP01
THIS RELEASE OF HIBERNATE ANNOTATIONS REQUIRES HIBERNATE CORE 3.2.0.GA (and above)
@@ -52,4 +52,4 @@
If you want to contribute, go to http://www.hibernate.org/
This software and its documentation are distributed under the terms of the
-FSF Lesser Gnu Public License (see lgpl.txt).
\ No newline at end of file
+FSF Lesser Gnu Public License (see lgpl.txt).
Modified: annotations/branches/v3_3_1_GA_CP/src/java/org/hibernate/cfg/annotations/Version.java
===================================================================
--- annotations/branches/v3_3_1_GA_CP/src/java/org/hibernate/cfg/annotations/Version.java 2009-05-28 02:31:44 UTC (rev 16627)
+++ annotations/branches/v3_3_1_GA_CP/src/java/org/hibernate/cfg/annotations/Version.java 2009-05-28 09:09:50 UTC (rev 16628)
@@ -8,7 +8,7 @@
* @author Emmanuel Bernard
*/
public class Version {
- public static final String VERSION = "3.3.1.GA";
+ public static final String VERSION = "3.3.1.GA.CP01";
private static Log log = LogFactory.getLog( Version.class );
static {
15 years, 6 months
Hibernate SVN: r16627 - core/tags.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2009-05-27 22:31:44 -0400 (Wed, 27 May 2009)
New Revision: 16627
Added:
core/tags/JBOSS_EAP_3_2_4_SP1_CP08/
Log:
JBPAPP-2037 : Create tag for Hibernate Core for EAP 4.2 CP07 / 4.3 CP05 (JBOSS_EAP_3_2_4_SP1_CP08)
Copied: core/tags/JBOSS_EAP_3_2_4_SP1_CP08 (from rev 16626, core/branches/Branch_3_2_4_SP1_CP)
15 years, 6 months
Hibernate SVN: r16626 - in core/branches/Branch_3_2_4_SP1_CP: lib and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2009-05-27 22:29:52 -0400 (Wed, 27 May 2009)
New Revision: 16626
Modified:
core/branches/Branch_3_2_4_SP1_CP/build.xml
core/branches/Branch_3_2_4_SP1_CP/changelog.txt
core/branches/Branch_3_2_4_SP1_CP/lib/version-dist.properties
core/branches/Branch_3_2_4_SP1_CP/lib/version.properties
core/branches/Branch_3_2_4_SP1_CP/readme.txt
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/cfg/Environment.java
Log:
JBPAPP-2037 : Update version to 3.2.4.SP1_CP08
Modified: core/branches/Branch_3_2_4_SP1_CP/build.xml
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/build.xml 2009-05-27 20:26:32 UTC (rev 16625)
+++ core/branches/Branch_3_2_4_SP1_CP/build.xml 2009-05-28 02:29:52 UTC (rev 16626)
@@ -24,7 +24,7 @@
<property name="version.minor" value="2"/>
<property name="version.micro" value="4"/>
<property name="version.qualifier" value="sp1"/>
- <property name="version.cp" value="cp07"/>
+ <property name="version.cp" value="cp08"/>
<property name="version.full" value="${version.major}.${version.minor}.${version.micro}.${version.qualifier}.${version.cp}"/>
<property name="version.major_minor" value="${version.major}.${version.minor}"/>
<property name="fullname" value="${name}-${version.full}"/>
Modified: core/branches/Branch_3_2_4_SP1_CP/changelog.txt
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/changelog.txt 2009-05-27 20:26:32 UTC (rev 16625)
+++ core/branches/Branch_3_2_4_SP1_CP/changelog.txt 2009-05-28 02:29:52 UTC (rev 16626)
@@ -5,6 +5,18 @@
refer to the particular case on JIRA using the issue tracking number to learn
more about each case.
+Changes in version 3.2.4.sp1.cp08
+-------------------------------------------
+
+** Bug
+ * [JBPAPP-1563 / HHH-3640] - Some standard SQL functions are not implemented in Sybase
+ * [JBPAPP-1564 / HHH-3701] - SQL function "trim" is not available in Sybase Dialect
+ * [JBPAPP-1748 / HHH-3662] - Merging read-only entities causes AssertionError("Merged entity does not have status set to MANAGED...")
+ * [JBPAPP-1797 / HHH-3810] - Transient entities can be inserted twice on merge
+ * [JBPAPP-1922 / HHH-2645] - Synchronization bottleneck in EntityModeToTuplizerMapping
+ * [JBPAPP-1930 / HHH-2745] - NullPointerException when eager fetching joined many-to-many with native SQL query
+ * [JBPAPP-2036 / HHH-3621] - Assertion failure in MigrationTest
+
Changes in version 3.2.4.sp1.cp07
-------------------------------------------
Modified: core/branches/Branch_3_2_4_SP1_CP/lib/version-dist.properties
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/lib/version-dist.properties 2009-05-27 20:26:32 UTC (rev 16625)
+++ core/branches/Branch_3_2_4_SP1_CP/lib/version-dist.properties 2009-05-28 02:29:52 UTC (rev 16626)
@@ -1,6 +1,6 @@
hibernate.lib=hibernate3.jar
hibernate.ignorecheck=true
-hibernate.version=3.2.4.SP1_CP07-brew
+hibernate.version=3.2.4.SP1_CP08-brew
hibernate.name=Hibernate core
hibernate.when=runtime, required
Modified: core/branches/Branch_3_2_4_SP1_CP/lib/version.properties
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/lib/version.properties 2009-05-27 20:26:32 UTC (rev 16625)
+++ core/branches/Branch_3_2_4_SP1_CP/lib/version.properties 2009-05-28 02:29:52 UTC (rev 16626)
@@ -39,7 +39,7 @@
cleanimports.name=cleanimports
cleanimports.when=buildtime
-hibernate.version=3.2.4.SP1_CP07-brew
+hibernate.version=3.2.4.SP1_CP08-brew
hibernate.name=Hibernate core
hibernate.when=runtime, required
Modified: core/branches/Branch_3_2_4_SP1_CP/readme.txt
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/readme.txt 2009-05-27 20:26:32 UTC (rev 16625)
+++ core/branches/Branch_3_2_4_SP1_CP/readme.txt 2009-05-28 02:29:52 UTC (rev 16626)
@@ -1,6 +1,6 @@
Hibernate - Relational Persistence for Idiomatic Java
=====================================================
-version 3.2.4.sp1.cp07
+version 3.2.4.sp1.cp08
Copyright © 2009 Red Hat, Inc.
@@ -37,7 +37,7 @@
"ant junitreport-dist -Dhibernate.test.validatefailureexpected=true"
(4) see build/test-reports/index.html
-Note: The unit tests are expected to have 7 failures and 10 errors in:
+Note: The unit tests are expected to have 8 failures and 10 errors in:
Ehcache tests (Ehcache is not provided in this distribution):
org.hibernate.test.cache.ehcache.EhCacheTest.testQueryCacheInvalidation
@@ -45,6 +45,7 @@
org.hibernate.test.cache.ehcache.EhCacheTest.testStaleWritesLeaveCacheConsistent
"FailureExpected" tests (known issues to be addressed in the future):
+org.hibernate.test.component.basic.ComponentTest.testComponentQueryMethodNoParensFailureExpected
org.hibernate.test.event.collection.BrokenCollectionEventTest.testUpdateDetachedParentNoChildrenToNullFailureExpected
org.hibernate.test.event.collection.BrokenCollectionEventTest.testSaveParentNullChildrenFailureExpected
org.hibernate.test.event.collection.BrokenCollectionEventTest.testUpdateParentNoChildrenToNullFailureExpected
Modified: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/cfg/Environment.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/cfg/Environment.java 2009-05-27 20:26:32 UTC (rev 16625)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/cfg/Environment.java 2009-05-28 02:29:52 UTC (rev 16626)
@@ -153,7 +153,7 @@
*/
public final class Environment {
- public static final String VERSION = "3.2.4.sp1.cp07";
+ public static final String VERSION = "3.2.4.sp1.cp08";
/**
* <tt>ConnectionProvider</tt> implementor to use when obtaining connections
15 years, 6 months
Hibernate SVN: r16625 - core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/event/def.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2009-05-27 16:26:32 -0400 (Wed, 27 May 2009)
New Revision: 16625
Added:
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/event/def/EventCache.java
Removed:
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/event/def/CopyCache.java
Modified:
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/event/def/DefaultMergeEventListener.java
Log:
JBPAPP-1797 HHH-3810 : rename CopyCache to EventCache to be more generic
Deleted: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/event/def/CopyCache.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/event/def/CopyCache.java 2009-05-27 12:01:15 UTC (rev 16624)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/event/def/CopyCache.java 2009-05-27 20:26:32 UTC (rev 16625)
@@ -1,244 +0,0 @@
-//$Id: $
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- *
- */
-package org.hibernate.event.def;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.Iterator;
-import java.util.Collection;
-
-import org.hibernate.util.IdentityMap;
-import org.hibernate.AssertionFailure;
-
-/**
- * CopyCache is intended to be the Map implementation used by
- * {@link DefaultMergeEventListener} to keep track of entities and their copies
- * being merged into the session. This implementation also tracks whether a
- * an entity in the CopyCache is included in the merge. This allows a
- * an entity and its copy to be added to a CopyCache before merge has cascaded
- * to that entity.
- *
- * @author Gail Badner
- */
-class CopyCache implements Map {
- private Map entityToCopyMap = IdentityMap.instantiate(10);
- // key is an entity involved with the merge;
- // value can be either a copy of the entity or the entity itself
-
- private Map entityToIncludeInMergeFlagMap = IdentityMap.instantiate(10);
- // key is an entity involved with the merge;
- // value is a flag indicating if the entity is included in the merge
-
- /**
- * Clears the CopyCache.
- */
- public void clear() {
- entityToCopyMap.clear();
- entityToIncludeInMergeFlagMap.clear();
- }
-
- /**
- * Returns true if this CopyCache contains a mapping for the specified entity.
- * @param entity must be non-null
- * @return true if this CopyCache contains a mapping for the specified entity
- * @throws NullPointerException if entity is null
- */
- public boolean containsKey(Object entity) {
- if ( entity == null ) {
- throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
- }
- return entityToCopyMap.containsKey( entity );
- }
-
- /**
- * Returns true if this CopyCache maps one or more entities to the specified copy.
- * @param copy must be non-null
- * @return true if this CopyCache maps one or more entities to the specified copy
- * @throws NullPointerException if copy is null
- */
- public boolean containsValue(Object copy) {
- if ( copy == null ) {
- throw new NullPointerException( "null copies are not supported by " + getClass().getName() );
- }
- return entityToCopyMap.containsValue( copy );
- }
-
- /**
- * Returns a set view of the entity-to-copy mappings contained in this CopyCache.
- * @return set view of the entity-to-copy mappings contained in this CopyCache
- */
- public Set entrySet() {
- return entityToCopyMap.entrySet();
- }
-
- /**
- * Returns the copy to which this CopyCache maps the specified entity.
- * @param entity must be non-null
- * @return the copy to which this CopyCache maps the specified entity
- * @throws NullPointerException if entity is null
- */
- public Object get(Object entity) {
- if ( entity == null ) {
- throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
- }
- return entityToCopyMap.get( entity );
- }
-
- /**
- * Returns true if this CopyCache contains no entity-copy mappings.
- * @return true if this CopyCache contains no entity-copy mappings
- */
- public boolean isEmpty() {
- return entityToCopyMap.isEmpty();
- }
-
- /**
- * Returns a set view of the entities contained in this CopyCache
- * @return a set view of the entities contained in this CopyCache
- */
- public Set keySet() {
- return entityToCopyMap.keySet();
- }
-
- /**
- * Associates the specified entity with the specified copy in this CopyCache;
- * @param entity must be non-null
- * @param copy must be non- null
- * @return previous copy associated with specified entity, or null if
- * there was no mapping for entity.
- * @throws NullPointerException if entity or copy is null
- */
- public Object put(Object entity, Object copy) {
- if ( entity == null || copy == null ) {
- throw new NullPointerException( "null entities and copies are not supported by " + getClass().getName() );
- }
- entityToIncludeInMergeFlagMap.put( entity, Boolean.FALSE );
- return entityToCopyMap.put( entity, copy );
- }
-
- /**
- * Associates the specified entity with the specified copy in this CopyCache;
- * @param entity must be non-null
- * @param copy must be non- null
- * @param isIncludedInMerge indicates if the entity is included in merge
- *
- * @return previous copy associated with specified entity, or null if
- * there was no mapping for entity.
- * @throws NullPointerException if entity or copy is null
- */
- /* package-private */ Object put(Object entity, Object copy, boolean isIncludedInMerge) {
- if ( entity == null || copy == null ) {
- throw new NullPointerException( "null entities and copies are not supported by " + getClass().getName() );
- }
- entityToIncludeInMergeFlagMap.put( entity, Boolean.valueOf( isIncludedInMerge ) );
- return entityToCopyMap.put( entity, copy );
- }
-
- /**
- * Copies all of the mappings from the specified map to this CopyCache
- * @param map keys and values must be non-null
- * @throws NullPointerException if any map keys or values are null
- */
- public void putAll(Map map) {
- for ( Iterator it=map.entrySet().iterator(); it.hasNext(); ) {
- Map.Entry entry = ( Map.Entry ) it.next();
- if ( entry.getKey() == null || entry.getValue() == null ) {
- throw new NullPointerException( "null entities and copies are not supported by " + getClass().getName() );
- }
- entityToCopyMap.put( entry.getKey(), entry.getValue() );
- entityToIncludeInMergeFlagMap.put( entry.getKey(), Boolean.FALSE );
- }
- }
-
- /**
- * Removes the mapping for this entity from this CopyCache if it is present
- * @param entity must be non-null
- * @return previous value associated with specified entity, or null if there was no mapping for entity.
- * @throws NullPointerException if entity is null
- */
- public Object remove(Object entity) {
- if ( entity == null ) {
- throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
- }
- entityToIncludeInMergeFlagMap.remove( entity );
- return entityToCopyMap.remove( entity );
- }
-
- /**
- * Returns the number of entity-copy mappings in this CopyCache
- * @return the number of entity-copy mappings in this CopyCache
- */
- public int size() {
- return entityToCopyMap.size();
- }
-
- /**
- * Returns a collection view of the entity copies contained in this CopyCache.
- * @return a collection view of the entity copies contained in this CopyCache
- */
- public Collection values() {
- return entityToCopyMap.values();
- }
-
- /**
- * Returns true if the specified entity is included in the merge.
- * @param entity must be non-null
- * @return true if the specified entity is included in the merge.
- * @throws NullPointerException if entity is null
- */
- public boolean isIncludedInMerge(Object entity) {
- if ( entity == null ) {
- throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
- }
- return ( ( Boolean ) entityToIncludeInMergeFlagMap.get( entity ) ).booleanValue();
- }
-
- /**
- * Set flag to indicate if an entity is included in the merge.
- * @param entity must be non-null and this CopyCache must contain a mapping for this entity
- * @return true if the specified entity is included in the merge
- * @throws NullPointerException if entity is null
- * @throws AssertionFailure if this CopyCache does not contain a mapping for the specified entity
- */
- /* package-private */ void setIncludedInMerge(Object entity, boolean isIncludedInMerge) {
- if ( entity == null ) {
- throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
- }
- if ( ! entityToIncludeInMergeFlagMap.containsKey( entity ) ||
- ! entityToCopyMap.containsKey( entity ) ) {
- throw new AssertionFailure( "called CopyCache.setInMergeProcess() for entity not found in CopyCache" );
- }
- entityToIncludeInMergeFlagMap.put( entity, Boolean.valueOf( isIncludedInMerge ) );
- }
-
- /**
- * Returns the copy-entity mappings
- * @return the copy-entity mappings
- */
- public Map getMergeMap() {
- return IdentityMap.invert( entityToCopyMap );
- }
-}
\ No newline at end of file
Modified: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/event/def/DefaultMergeEventListener.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/event/def/DefaultMergeEventListener.java 2009-05-27 12:01:15 UTC (rev 16624)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/event/def/DefaultMergeEventListener.java 2009-05-27 20:26:32 UTC (rev 16625)
@@ -71,7 +71,7 @@
private static final Log log = LogFactory.getLog(DefaultMergeEventListener.class);
protected Map getMergeMap(Object anything) {
- return ( ( CopyCache ) anything ).getMergeMap();
+ return ( ( EventCache ) anything ).invertMap();
}
/**
@@ -81,7 +81,7 @@
* @throws HibernateException
*/
public void onMerge(MergeEvent event) throws HibernateException {
- CopyCache copyCache = new CopyCache();
+ EventCache copyCache = new EventCache();
onMerge( event, copyCache );
// TODO: iteratively get transient entities and retry merge until one of the following conditions:
// 1) transientCopyCache.size() == 0
@@ -111,8 +111,8 @@
copyCache = null;
}
- protected CopyCache getTransientCopyCache(MergeEvent event, CopyCache copyCache) {
- CopyCache transientCopyCache = new CopyCache();
+ protected EventCache getTransientCopyCache(MergeEvent event, EventCache copyCache) {
+ EventCache transientCopyCache = new EventCache();
for ( Iterator it=copyCache.entrySet().iterator(); it.hasNext(); ) {
Map.Entry mapEntry = ( Map.Entry ) it.next();
Object entity = mapEntry.getKey();
@@ -132,7 +132,7 @@
);
}
else if ( copyEntry.getStatus() == Status.SAVING ) {
- transientCopyCache.put( entity, copy, copyCache.isIncludedInMerge( entity ) );
+ transientCopyCache.put( entity, copy, copyCache.isOperatedOn( entity ) );
}
else if ( copyEntry.getStatus() != Status.MANAGED && copyEntry.getStatus() != Status.READ_ONLY ) {
throw new AssertionFailure( "Merged entity does not have status set to MANAGED or READ_ONLY; "+copy+" status="+copyEntry.getStatus() );
@@ -141,7 +141,7 @@
return transientCopyCache;
}
- protected void retryMergeTransientEntities(MergeEvent event, Map transientCopyCache, CopyCache copyCache) {
+ protected void retryMergeTransientEntities(MergeEvent event, Map transientCopyCache, EventCache copyCache) {
// TODO: The order in which entities are saved may matter (e.g., a particular transient entity
// may need to be saved before other transient entities can be saved;
// Keep retrying the batch of transient entities until either:
@@ -170,7 +170,7 @@
*/
public void onMerge(MergeEvent event, Map copiedAlready) throws HibernateException {
- final CopyCache copyCache = ( CopyCache ) copiedAlready;
+ final EventCache copyCache = ( EventCache ) copiedAlready;
final EventSource source = event.getSession();
final Object original = event.getOriginal();
@@ -193,14 +193,14 @@
}
if ( copyCache.containsKey( entity ) &&
- ( copyCache.isIncludedInMerge( entity ) ) ) {
+ ( copyCache.isOperatedOn( entity ) ) ) {
log.trace("already in merge process");
event.setResult( entity );
}
else {
if ( copyCache.containsKey( entity ) ) {
log.trace("already in copyCache; setting in merge process");
- copyCache.setIncludedInMerge( entity, true );
+ copyCache.setOperatedOn( entity, true );
}
event.setEntity( entity );
int entityState = -1;
@@ -262,7 +262,7 @@
final EventSource source = event.getSession();
final EntityPersister persister = source.getEntityPersister( event.getEntityName(), entity );
- ( ( CopyCache ) copyCache ).put( entity, entity, true ); //before cascade!
+ ( ( EventCache ) copyCache ).put( entity, entity, true ); //before cascade!
cascadeOnMerge(source, persister, entity, copyCache);
copyValues(persister, entity, entity, source, copyCache);
@@ -296,7 +296,7 @@
persister.setIdentifier( copyCache.get( entity ), id, source.getEntityMode() );
}
else {
- ( ( CopyCache ) copyCache ).put( entity, persister.instantiate( id, source.getEntityMode() ), true ); //before cascade!
+ ( ( EventCache ) copyCache ).put( entity, persister.instantiate( id, source.getEntityMode() ), true ); //before cascade!
//TODO: should this be Session.instantiate(Persister, ...)?
}
final Object copy = copyCache.get( entity );
@@ -334,7 +334,7 @@
"' from original entity is not in copyCache; " + propertyName + " =["+propertyFromEntity+"]");
throw ex;
}
- if ( ( ( CopyCache ) copyCache ).isIncludedInMerge( propertyFromEntity ) ) {
+ if ( ( ( EventCache ) copyCache ).isOperatedOn( propertyFromEntity ) ) {
log.trace( "property '" + copyEntry.getEntityName() + "." + propertyName +
"' from original entity is in copyCache and is in the process of being merged; " +
propertyName + " =["+propertyFromEntity+"]");
@@ -398,7 +398,7 @@
entityIsTransient(event, copyCache);
}
else {
- ( ( CopyCache ) copyCache ).put( entity, result, true ); //before cascade!
+ ( ( EventCache ) copyCache ).put( entity, result, true ); //before cascade!
final Object target = source.getPersistenceContext().unproxy(result);
if ( target == entity ) {
Copied: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/event/def/EventCache.java (from rev 16624, core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/event/def/CopyCache.java)
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/event/def/EventCache.java (rev 0)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/event/def/EventCache.java 2009-05-27 20:26:32 UTC (rev 16625)
@@ -0,0 +1,253 @@
+//$Id: $
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ *
+ */
+package org.hibernate.event.def;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.Iterator;
+import java.util.Collection;
+
+import org.hibernate.util.IdentityMap;
+import org.hibernate.AssertionFailure;
+
+/**
+ * EventCache is a Map implementation that can be used by an event
+ * listener to keep track of entities involved in the operation
+ * being performed. This implementation allows entities to be added
+ * to the EventCache before the operation has cascaded to that
+ * entity.
+ * <p/>
+ * The following methods can be used by event listeners (and other
+ * classes) in the same package to add entities to an EventCache
+ * and indicate if the operation is being performed on the entity:<p/>
+ * {@link EventCache#put(Object entity, Object copy, boolean isOperatedOn)}
+ * <p/>
+ * The following method can be used by event listeners (and other
+ * classes) in the same package to indicate that the operation is being
+ * performed on an entity already in the EventCache:
+ * {@link EventCache#setOperatedOn(Object entity, boolean isOperatedOn)
+ *
+ * @author Gail Badner
+ */
+class EventCache implements Map {
+ private Map entityToCopyMap = IdentityMap.instantiate(10);
+ // key is an entity involved with the operation performed by the listener;
+ // value can be either a copy of the entity or the entity itself
+
+ private Map entityToOperatedOnFlagMap = IdentityMap.instantiate(10);
+ // key is an entity involved with the operation performed by the listener;
+ // value is a flag indicating if the listener explicitly operates on the entity
+
+ /**
+ * Clears the EventCache.
+ */
+ public void clear() {
+ entityToCopyMap.clear();
+ entityToOperatedOnFlagMap.clear();
+ }
+
+ /**
+ * Returns true if this EventCache contains a mapping for the specified entity.
+ * @param entity must be non-null
+ * @return true if this EventCache contains a mapping for the specified entity
+ * @throws NullPointerException if entity is null
+ */
+ public boolean containsKey(Object entity) {
+ if ( entity == null ) {
+ throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
+ }
+ return entityToCopyMap.containsKey( entity );
+ }
+
+ /**
+ * Returns true if this EventCache maps one or more entities to the specified copy.
+ * @param copy must be non-null
+ * @return true if this EventCache maps one or more entities to the specified copy
+ * @throws NullPointerException if copy is null
+ */
+ public boolean containsValue(Object copy) {
+ if ( copy == null ) {
+ throw new NullPointerException( "null copies are not supported by " + getClass().getName() );
+ }
+ return entityToCopyMap.containsValue( copy );
+ }
+
+ /**
+ * Returns a set view of the entity-to-copy mappings contained in this EventCache.
+ * @return set view of the entity-to-copy mappings contained in this EventCache
+ */
+ public Set entrySet() {
+ return entityToCopyMap.entrySet();
+ }
+
+ /**
+ * Returns the copy to which this EventCache maps the specified entity.
+ * @param entity must be non-null
+ * @return the copy to which this EventCache maps the specified entity
+ * @throws NullPointerException if entity is null
+ */
+ public Object get(Object entity) {
+ if ( entity == null ) {
+ throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
+ }
+ return entityToCopyMap.get( entity );
+ }
+
+ /**
+ * Returns true if this EventCache contains no entity-copy mappings.
+ * @return true if this EventCache contains no entity-copy mappings
+ */
+ public boolean isEmpty() {
+ return entityToCopyMap.isEmpty();
+ }
+
+ /**
+ * Returns a set view of the entities contained in this EventCache
+ * @return a set view of the entities contained in this EventCache
+ */
+ public Set keySet() {
+ return entityToCopyMap.keySet();
+ }
+
+ /**
+ * Associates the specified entity with the specified copy in this EventCache;
+ * @param entity must be non-null
+ * @param copy must be non- null
+ * @return previous copy associated with specified entity, or null if
+ * there was no mapping for entity.
+ * @throws NullPointerException if entity or copy is null
+ */
+ public Object put(Object entity, Object copy) {
+ if ( entity == null || copy == null ) {
+ throw new NullPointerException( "null entities and copies are not supported by " + getClass().getName() );
+ }
+ entityToOperatedOnFlagMap.put( entity, Boolean.FALSE );
+ return entityToCopyMap.put( entity, copy );
+ }
+
+ /**
+ * Associates the specified entity with the specified copy in this EventCache;
+ * @param entity must be non-null
+ * @param copy must be non- null
+ * @param isOperatedOn indicates if the operation is performed on the entity
+ *
+ * @return previous copy associated with specified entity, or null if
+ * there was no mapping for entity.
+ * @throws NullPointerException if entity or copy is null
+ */
+ /* package-private */ Object put(Object entity, Object copy, boolean isOperatedOn) {
+ if ( entity == null || copy == null ) {
+ throw new NullPointerException( "null entities and copies are not supported by " + getClass().getName() );
+ }
+ entityToOperatedOnFlagMap.put( entity, Boolean.valueOf( isOperatedOn ) );
+ return entityToCopyMap.put( entity, copy );
+ }
+
+ /**
+ * Copies all of the mappings from the specified map to this EventCache
+ * @param map keys and values must be non-null
+ * @throws NullPointerException if any map keys or values are null
+ */
+ public void putAll(Map map) {
+ for ( Iterator it=map.entrySet().iterator(); it.hasNext(); ) {
+ Map.Entry entry = ( Map.Entry ) it.next();
+ if ( entry.getKey() == null || entry.getValue() == null ) {
+ throw new NullPointerException( "null entities and copies are not supported by " + getClass().getName() );
+ }
+ entityToCopyMap.put( entry.getKey(), entry.getValue() );
+ entityToOperatedOnFlagMap.put( entry.getKey(), Boolean.FALSE );
+ }
+ }
+
+ /**
+ * Removes the mapping for this entity from this EventCache if it is present
+ * @param entity must be non-null
+ * @return previous value associated with specified entity, or null if there was no mapping for entity.
+ * @throws NullPointerException if entity is null
+ */
+ public Object remove(Object entity) {
+ if ( entity == null ) {
+ throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
+ }
+ entityToOperatedOnFlagMap.remove( entity );
+ return entityToCopyMap.remove( entity );
+ }
+
+ /**
+ * Returns the number of entity-copy mappings in this EventCache
+ * @return the number of entity-copy mappings in this EventCache
+ */
+ public int size() {
+ return entityToCopyMap.size();
+ }
+
+ /**
+ * Returns a collection view of the entity copies contained in this EventCache.
+ * @return a collection view of the entity copies contained in this EventCache
+ */
+ public Collection values() {
+ return entityToCopyMap.values();
+ }
+
+ /**
+ * Returns true if the listener is performing the operation on the specified entity.
+ * @param entity must be non-null
+ * @return true if the listener is performing the operation on the specified entity.
+ * @throws NullPointerException if entity is null
+ */
+ public boolean isOperatedOn(Object entity) {
+ if ( entity == null ) {
+ throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
+ }
+ return ( ( Boolean ) entityToOperatedOnFlagMap.get( entity ) ).booleanValue();
+ }
+
+ /**
+ * Set flag to indicate if the listener is performing the operation on the specified entity.
+ * @param entity must be non-null and this EventCache must contain a mapping for this entity
+ * @return true if the listener is performing the operation on the specified entity
+ * @throws NullPointerException if entity is null
+ * @throws AssertionFailure if this EventCache does not contain a mapping for the specified entity
+ */
+ /* package-private */ void setOperatedOn(Object entity, boolean isOperatedOn) {
+ if ( entity == null ) {
+ throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
+ }
+ if ( ! entityToOperatedOnFlagMap.containsKey( entity ) ||
+ ! entityToCopyMap.containsKey( entity ) ) {
+ throw new AssertionFailure( "called EventCache.setOperatedOn() for entity not found in EventCache" );
+ }
+ entityToOperatedOnFlagMap.put( entity, Boolean.valueOf( isOperatedOn ) );
+ }
+
+ /**
+ * Returns the copy-entity mappings
+ * @return the copy-entity mappings
+ */
+ public Map invertMap() {
+ return IdentityMap.invert( entityToCopyMap );
+ }
+}
\ No newline at end of file
15 years, 6 months
Hibernate SVN: r16624 - validator/trunk/hibernate-validator.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-05-27 08:01:15 -0400 (Wed, 27 May 2009)
New Revision: 16624
Modified:
validator/trunk/hibernate-validator/pom.xml
Log:
add maven CLI
Modified: validator/trunk/hibernate-validator/pom.xml
===================================================================
--- validator/trunk/hibernate-validator/pom.xml 2009-05-27 09:58:33 UTC (rev 16623)
+++ validator/trunk/hibernate-validator/pom.xml 2009-05-27 12:01:15 UTC (rev 16624)
@@ -232,6 +232,11 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.twdata.maven</groupId>
+ <artifactId>maven-cli-plugin</artifactId>
+ <version>0.6.3.CR3</version>
+ </plugin>
</plugins>
</build>
<reporting>
15 years, 6 months
Hibernate SVN: r16623 - validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-05-27 05:58:33 -0400 (Wed, 27 May 2009)
New Revision: 16623
Modified:
beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pattern.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PatternValidator.java
Log:
BVAL-156 Pattern.flag supports an int
Modified: beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pattern.java
===================================================================
--- beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pattern.java 2009-05-27 07:16:01 UTC (rev 16622)
+++ beanvalidation/trunk/validation-api/src/main/java/javax/validation/constraints/Pattern.java 2009-05-27 09:58:33 UTC (rev 16623)
@@ -64,47 +64,62 @@
* Possible Regexp flags
*/
public static enum Flag {
+
/**
* Enables Unix lines mode
* @see java.util.regex.Pattern#UNIX_LINES
*/
- UNIX_LINES,
+ UNIX_LINES(java.util.regex.Pattern.UNIX_LINES),
/**
* Enables case-insensitive matching
* @see java.util.regex.Pattern#CASE_INSENSITIVE
*/
- CASE_INSENSITIVE,
+ CASE_INSENSITIVE(java.util.regex.Pattern.CASE_INSENSITIVE),
/**
* Permits whitespace and comments in pattern
* @see java.util.regex.Pattern#COMMENTS
*/
- COMMENTS,
+ COMMENTS(java.util.regex.Pattern.COMMENTS),
/**
* Enables multiline mode
* @see java.util.regex.Pattern#MULTILINE
*/
- MULTILINE,
+ MULTILINE(java.util.regex.Pattern.MULTILINE),
/**
* Enables dotall mode
* @see java.util.regex.Pattern#DOTALL
*/
- DOTALL,
+ DOTALL(java.util.regex.Pattern.DOTALL),
/**
* Enables Unicode-aware case folding
* @see java.util.regex.Pattern#UNICODE_CASE
*/
- UNICODE_CASE,
+ UNICODE_CASE(java.util.regex.Pattern.UNICODE_CASE),
/**
* Enables canonical equivalence
* @see java.util.regex.Pattern#CANON_EQ
*/
- CANON_EQ
+ CANON_EQ(java.util.regex.Pattern.CANON_EQ);
+
+ //JDK flag value
+ private int value;
+
+ private Flag(int value) {
+ this.value = value;
+ }
+
+ /**
+ * @return flag value as defined in {@link java.util.regex.Pattern}
+ */
+ public int getValue() {
+ return value;
+ }
}
/**
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PatternValidator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PatternValidator.java 2009-05-27 07:16:01 UTC (rev 16622)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/constraints/PatternValidator.java 2009-05-27 09:58:33 UTC (rev 16623)
@@ -35,7 +35,7 @@
Pattern.Flag flags[] = parameters.flags();
int intFlag = 0;
for ( Pattern.Flag flag : flags ) {
- intFlag = intFlag | mapFlagToInt( flag );
+ intFlag = intFlag | flag.getValue();
}
try {
@@ -53,39 +53,4 @@
Matcher m = pattern.matcher( value );
return m.matches();
}
-
- private int mapFlagToInt(Pattern.Flag flag) {
- int intFlag = 0;
- switch ( flag ) {
- case UNIX_LINES: {
- intFlag = java.util.regex.Pattern.UNIX_LINES;
- break;
- }
- case CASE_INSENSITIVE: {
- intFlag = java.util.regex.Pattern.CASE_INSENSITIVE;
- break;
- }
- case COMMENTS: {
- intFlag = java.util.regex.Pattern.COMMENTS;
- break;
- }
- case MULTILINE: {
- intFlag = java.util.regex.Pattern.MULTILINE;
- break;
- }
- case DOTALL: {
- intFlag = java.util.regex.Pattern.DOTALL;
- break;
- }
- case UNICODE_CASE: {
- intFlag = java.util.regex.Pattern.UNICODE_CASE;
- break;
- }
- case CANON_EQ: {
- intFlag = java.util.regex.Pattern.CANON_EQ;
- break;
- }
- }
- return intFlag;
- }
}
15 years, 6 months