[hibernate-commits] Hibernate SVN: r19873 - in search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory: generated and 1 other directory.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Wed Jun 30 09:46:13 EDT 2010


Author: epbernard
Date: 2010-06-30 09:46:13 -0400 (Wed, 30 Jun 2010)
New Revision: 19873

Added:
   search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/
   search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generated.java
   search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generator.java
Modified:
   search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java
Log:
HSEARCH-397 Add performance and concurrency tests for mutating search factory

Test on FSDirectory around 20ms per class addition (mainly the index creation)
Test on RAMDirectory not noticeable
Tested on 100 classes, 10 threads adding 10 classes one by one

Modified: search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java
===================================================================
--- search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java	2010-06-30 13:45:30 UTC (rev 19872)
+++ search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java	2010-06-30 13:46:13 UTC (rev 19873)
@@ -1,28 +1,42 @@
 package org.hibernate.search.test.configuration.mutablefactory;
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ThreadPoolExecutor;
+
 import junit.framework.TestCase;
 import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.TopDocs;
+import org.slf4j.Logger;
 
-import org.hibernate.search.spi.SearchFactoryIntegrator;
+import org.hibernate.annotations.common.util.ReflectHelper;
 import org.hibernate.search.backend.Work;
 import org.hibernate.search.backend.WorkType;
+import org.hibernate.search.batchindexing.Executors;
 import org.hibernate.search.engine.SearchFactoryImplementor;
 import org.hibernate.search.impl.MutableSearchFactory;
 import org.hibernate.search.impl.SearchFactoryBuilder;
+import org.hibernate.search.spi.SearchFactoryIntegrator;
 import org.hibernate.search.store.DirectoryProvider;
+import org.hibernate.search.store.FSDirectoryProvider;
 import org.hibernate.search.store.RAMDirectoryProvider;
 import org.hibernate.search.test.SearchTestCase;
+import org.hibernate.search.test.configuration.mutablefactory.generated.Generated;
 import org.hibernate.search.test.util.ManualConfiguration;
 import org.hibernate.search.test.util.ManualTransactionContext;
+import org.hibernate.search.util.FileHelper;
+import org.hibernate.search.util.LoggerFactory;
 
 /**
  * @author Emmanuel Bernard
  */
 public class MutableFactoryTest extends TestCase {
 
+	public static final Logger log = LoggerFactory.make();
+
 	public void testCreateEmptyFactory() throws Exception {
 		final ManualConfiguration configuration = new ManualConfiguration();
 		SearchFactoryImplementor sf = new SearchFactoryBuilder().configuration( configuration ).buildSearchFactory();
@@ -83,7 +97,6 @@
 	public void testAddingClassSimpleAPI() throws Exception {
 		ManualConfiguration configuration = new ManualConfiguration()
 				.addProperty( "hibernate.search.default.directory_provider", RAMDirectoryProvider.class.getName() );
-
 		SearchFactoryIntegrator sf = new SearchFactoryBuilder().configuration( configuration ).buildSearchFactory();
 
 		sf.addClasses( A.class );
@@ -135,8 +148,153 @@
 		sf.close();
 	}
 
-	private void doIndexWork(Object entity, Integer id, SearchFactoryIntegrator sfi, ManualTransactionContext tc) {
+	private static void doIndexWork(Object entity, Integer id, SearchFactoryIntegrator sfi, ManualTransactionContext tc) {
 		Work<?> work = new Work<Object>( entity, id, WorkType.INDEX );
 		sfi.getWorker().performWork( work, tc );
 	}
+
+	public void testMultiThreadedAddClasses() throws Exception {
+
+		File indexDir = initIndexDirectory();
+		try {
+			doTestMultiThreadedClasses(indexDir);
+		}
+		finally {
+			cleanIndexDir( indexDir );
+		}
+	}
+
+	private void doTestMultiThreadedClasses(File indexDir) throws Exception {
+		QueryParser parser = new QueryParser( SearchTestCase.getTargetLuceneVersion(), "name", SearchTestCase.standardAnalyzer );
+		ManualConfiguration configuration = new ManualConfiguration()
+				.addProperty( "hibernate.search.default.directory_provider", FSDirectoryProvider.class.getName() )
+				.addProperty( "hibernate.search.default.indexBase", indexDir.getAbsolutePath() );
+		SearchFactoryIntegrator sf = new SearchFactoryBuilder().configuration( configuration ).buildSearchFactory();
+		List<DoAddClasses> runnables = new ArrayList<DoAddClasses>(10);
+		final int nbrOfThread = 10;
+		final int nbrOfClassesPerThread = 10;
+		for (int i = 0 ; i < nbrOfThread; i++) {
+			runnables.add( new DoAddClasses( sf, i, nbrOfClassesPerThread ) );
+		}
+		final ThreadPoolExecutor poolExecutor = Executors.newFixedThreadPool( nbrOfThread, "SFI classes addition" );
+		poolExecutor.prestartAllCoreThreads();
+		for (Runnable runnable : runnables) {
+			poolExecutor.execute( runnable );
+		}
+
+		//poolExecutor.awaitTermination( 1, TimeUnit.MINUTES );
+		boolean inProgress;
+		do {
+			Thread.sleep( 100 );
+			inProgress = false;
+			for ( DoAddClasses runnable : runnables) {
+				inProgress = inProgress || runnable.isFailure() == null;
+			}
+		} while (inProgress);
+
+		for ( DoAddClasses runnable : runnables) {
+			assertNotNull( "Threads not run # " + runnable.getWorkNumber(), runnable.isFailure() );
+			assertFalse( "thread failed #" + runnable.getWorkNumber() + " Failure: " + runnable.getFailureInfo(), runnable.isFailure() );
+		}
+
+		poolExecutor.shutdown();
+
+		for (int i = 0 ; i < nbrOfThread*nbrOfClassesPerThread ; i++) {
+			Query luceneQuery = parser.parse( "Emmanuel" + i);
+			final Class<?> classByNumber = getClassAByNumber( i );
+			DirectoryProvider<?> provider = sf.getDirectoryProviders( classByNumber )[0];
+			IndexSearcher searcher = new IndexSearcher( provider.getDirectory(), true );
+			TopDocs hits = searcher.search( luceneQuery, 1000 );
+			assertEquals( 1, hits.totalHits );
+		}
+	}
+
+	private void cleanIndexDir(File indexDir) {
+		FileHelper.delete( indexDir );
+	}
+
+	private File initIndexDirectory() {
+		String buildDir = System.getProperty( "build.dir" );
+		if ( buildDir == null ) {
+			buildDir = ".";
+		}
+		File current = new File( buildDir );
+		File indexDir = new File( current, "indextemp" );
+		boolean created = indexDir.mkdir();
+		if (!created) {
+			FileHelper.delete( indexDir );
+			indexDir.mkdir();
+		}
+		return indexDir;
+	}
+
+	private static Class<?> getClassAByNumber(int i) throws ClassNotFoundException {
+		final Class<?> aClass = ReflectHelper.classForName(
+				Generated.A0.class.getName().replace(
+						"A0", "A" + i
+				)
+		);
+		return aClass;
+	}
+
+	private static class DoAddClasses implements Runnable {
+		private final SearchFactoryIntegrator factory;
+		private final int factorOfClassesPerThread;
+		private final QueryParser parser;
+		private final int nbrOfClassesPerThread;
+		private volatile Boolean failure;
+		private volatile String failureInfo;
+
+		public String getFailureInfo() {
+			return failureInfo;
+		}
+
+		public Boolean isFailure() {
+			return failure;
+		}
+
+		public int getWorkNumber() {
+			return factorOfClassesPerThread;
+		}
+
+		public DoAddClasses(SearchFactoryIntegrator factory, int factorOfClassesPerThread, int nbrOfClassesPerThread) {
+			this.factory = factory;
+			this.factorOfClassesPerThread = factorOfClassesPerThread;
+			this.parser = new QueryParser( SearchTestCase.getTargetLuceneVersion(), "name", SearchTestCase.standardAnalyzer );
+			this.nbrOfClassesPerThread = nbrOfClassesPerThread;
+		}
+
+		public void run() {
+
+			try {
+				for (int index = 0 ; index < 10 ; index++) {
+					final int i = factorOfClassesPerThread*nbrOfClassesPerThread + index;
+					final Class<?> aClass = MutableFactoryTest.getClassAByNumber( i );
+					factory.addClasses( aClass );
+					Object entity = aClass.getConstructor( Integer.class, String.class ).newInstance(i, "Emmanuel" + i);
+					ManualTransactionContext context = new ManualTransactionContext();
+					MutableFactoryTest.doIndexWork(entity, i, factory, context );
+					context.end();
+
+					Query luceneQuery = parser.parse( "Emmanuel" + i);
+					DirectoryProvider<?> provider = factory.getDirectoryProviders( aClass )[0];
+					IndexSearcher searcher = new IndexSearcher( provider.getDirectory(), true );
+					TopDocs hits = searcher.search( luceneQuery, 1000 );
+					if ( hits.totalHits != 1 ) {
+						failure = true;
+						failureInfo = "failure: Emmanuel" + i + " for " + aClass.getName();
+						return;
+					}
+					//System.out.println("success: Emmanuel" + i + " for " + aClass.getName() );
+				}
+				//System.out.println("success: Emmanuel" + factorOfClassesPerThread );
+				failure = false;
+			}
+			catch ( Exception e ) {
+				this.failure = true;
+				e.printStackTrace(  );
+				failureInfo = "failure: Emmanuel" + factorOfClassesPerThread + " exception: " + e.toString();
+			}
+		}
+	}
 }

Added: search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generated.java
===================================================================
--- search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generated.java	                        (rev 0)
+++ search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generated.java	2010-06-30 13:46:13 UTC (rev 19873)
@@ -0,0 +1,1508 @@
+package org.hibernate.search.test.configuration.mutablefactory.generated;
+
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Indexed;
+
+/** Class generated container 100 inner classes */public class Generated {
+	@Indexed
+	public static class A0 {
+		public A0(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A1 {
+		public A1(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A2 {
+		public A2(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A3 {
+		public A3(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A4 {
+		public A4(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A5 {
+		public A5(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A6 {
+		public A6(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A7 {
+		public A7(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A8 {
+		public A8(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A9 {
+		public A9(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A10 {
+		public A10(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A11 {
+		public A11(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A12 {
+		public A12(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A13 {
+		public A13(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A14 {
+		public A14(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A15 {
+		public A15(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A16 {
+		public A16(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A17 {
+		public A17(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A18 {
+		public A18(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A19 {
+		public A19(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A20 {
+		public A20(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A21 {
+		public A21(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A22 {
+		public A22(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A23 {
+		public A23(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A24 {
+		public A24(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A25 {
+		public A25(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A26 {
+		public A26(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A27 {
+		public A27(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A28 {
+		public A28(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A29 {
+		public A29(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A30 {
+		public A30(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A31 {
+		public A31(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A32 {
+		public A32(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A33 {
+		public A33(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A34 {
+		public A34(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A35 {
+		public A35(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A36 {
+		public A36(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A37 {
+		public A37(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A38 {
+		public A38(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A39 {
+		public A39(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A40 {
+		public A40(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A41 {
+		public A41(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A42 {
+		public A42(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A43 {
+		public A43(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A44 {
+		public A44(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A45 {
+		public A45(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A46 {
+		public A46(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A47 {
+		public A47(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A48 {
+		public A48(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A49 {
+		public A49(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A50 {
+		public A50(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A51 {
+		public A51(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A52 {
+		public A52(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A53 {
+		public A53(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A54 {
+		public A54(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A55 {
+		public A55(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A56 {
+		public A56(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A57 {
+		public A57(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A58 {
+		public A58(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A59 {
+		public A59(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A60 {
+		public A60(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A61 {
+		public A61(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A62 {
+		public A62(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A63 {
+		public A63(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A64 {
+		public A64(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A65 {
+		public A65(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A66 {
+		public A66(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A67 {
+		public A67(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A68 {
+		public A68(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A69 {
+		public A69(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A70 {
+		public A70(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A71 {
+		public A71(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A72 {
+		public A72(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A73 {
+		public A73(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A74 {
+		public A74(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A75 {
+		public A75(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A76 {
+		public A76(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A77 {
+		public A77(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A78 {
+		public A78(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A79 {
+		public A79(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A80 {
+		public A80(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A81 {
+		public A81(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A82 {
+		public A82(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A83 {
+		public A83(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A84 {
+		public A84(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A85 {
+		public A85(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A86 {
+		public A86(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A87 {
+		public A87(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A88 {
+		public A88(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A89 {
+		public A89(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A90 {
+		public A90(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A91 {
+		public A91(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A92 {
+		public A92(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A93 {
+		public A93(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A94 {
+		public A94(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A95 {
+		public A95(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A96 {
+		public A96(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A97 {
+		public A97(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A98 {
+		public A98(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+	@Indexed
+	public static class A99 {
+		public A99(Integer id, String name) { this.id = id; this.name = name; }
+
+		@DocumentId
+		public Integer getId() {return id;}
+		public void setId(Integer id) { this.id = id; }
+		private Integer id;
+
+		@Field
+		public String getName() {return name;}
+		public void setName(String name) { this.name = name; }
+		private String name;
+	}
+
+}
\ No newline at end of file

Added: search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generator.java
===================================================================
--- search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generator.java	                        (rev 0)
+++ search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generator.java	2010-06-30 13:46:13 UTC (rev 19873)
@@ -0,0 +1,52 @@
+package org.hibernate.search.test.configuration.mutablefactory.generated;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class Generator {
+
+	public static void main(String[] args) {
+		StringBuilder generated = new StringBuilder( );
+		generated.append( "package org.hibernate.search.test.configuration.mutablefactory.generated;\n\n" )
+			.append("import org.hibernate.search.annotations.DocumentId;\n")
+			.append( "import org.hibernate.search.annotations.Field;\n" )
+			.append( "import org.hibernate.search.annotations.Indexed;\n\n" )
+			.append( "/** Class generated container 100 inner classes */" )	
+			.append("public class Generated {\n");
+
+		StringBuilder inner = new StringBuilder( );
+		inner.append("\t").append( "@Indexed").append( "\n" )
+				.append( "\t" ).append( "public static class Ax {" ).append( "\n" )
+				.append("\t").append("\t").append( "public Ax(Integer id, String name) { this.id = id; this.name = name; }" ).append( "\n\n" )
+				.append("\t").append("\t").append( "@DocumentId" ).append( "\n" )
+				.append("\t").append("\t").append( "public Integer getId() {return id;}" ).append( "\n" )
+				.append("\t").append("\t").append( "public void setId(Integer id) { this.id = id; }" ).append( "\n" )
+				.append("\t").append("\t").append( "private Integer id;" ).append( "\n\n" )
+				.append("\t").append("\t").append( "@Field" ).append( "\n" )
+				.append("\t").append("\t").append( "public String getName() {return name;}" ).append( "\n" )
+				.append("\t").append("\t").append( "public void setName(String name) { this.name = name; }" ).append( "\n" )
+				.append("\t").append("\t").append( "private String name;" ).append( "\n" )
+				.append( "\t}\n\n" );
+		String innerString = inner.toString();
+		for (int i = 0 ; i < 100 ; i++) {
+			generated.append( innerString.replace("Ax", "A"+i ) );
+		}
+
+		generated.append( "}" );
+		File f = new File("./Generated.java");
+		try {
+			FileWriter fw = new FileWriter( f );
+			fw.write( generated.toString() );
+			fw.close();
+		}
+		catch ( IOException e ) {
+			System.out.println("Error while generating classes" );
+			e.printStackTrace(  );
+		}
+		System.out.println("Generated in :" + f.getAbsolutePath() );
+	}
+}



More information about the hibernate-commits mailing list