Hi,
I am sure this is a fairly simple question but I can't seem to phrase it in a way google can help.
In the hibernate-search docs there is a programmatic API (
http://docs.jboss.org/hibernate/search/3.2/reference/en-US/html/search-mapping.html#hsearch-mapping-programmaticapi),
I am trying to create a search mapping as per :
Code:
SearchMapping mapping = new SearchMapping();
[...]
configuration.setProperty( Environment.MODEL_MAPPING, mapping );
But I dont really understand what the configuration object is and how i would obtain it. I am using spring and the org.springframework.orm.hibernate3.support.HibernateDaoSupport package for my DAO so is it something I need to inject somehow in the form of a bean? I will pop this on a spring forum as well as it might be more spring related.
Any help and suggestions would be much appreciated.
Spring setup is here is it is useful, if other code would help just let me know
Code:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="annotatedClasses">
<list>
<value>com.ActivityGB.client.domain.Provider</value>
<value>com.ActivityGB.client.domain.Activity</value>
<value>com.ActivityGB.client.domain.Location</value>
<value>com.ActivityGB.client.domain.Address</value>
<value>com.ActivityGB.client.domain.Category</value>
</list>
</property>
<property name="mappingResources">
<list>
<value>com/ActivityGB/client/domain/Provider.hbm.xml</value>
....
<value>com/ActivityGB/client/domain/UserWall.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.bytecode.provider">cglib</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
<!-- <prop key="hibernate.use_sql_comments">true</prop> -->
<prop key="hibernate.bytecode.use_reflection_optimizer">true</prop>
<prop key="hibernate.jdbc.batch_size">20</prop>
<prop key="hibernate.c3p0.min_size">10</prop>
<prop key="hibernate.c3p0.max_size">100</prop>
<prop key="hibernate.c3p0.timeout">10</prop>
<prop key="hibernate.c3p0.acquireRetryAttempts">30</prop>
<prop key="hibernate.c3p0.acquireIncrement">5</prop>
<prop key="hibernate.c3p0.idleConnectionTestPeriod">100</prop>
<prop key="hibernate.c3p0.initialPoolSize">20</prop>
<prop key="hibernate.c3p0.maxPoolSize">100</prop>
<prop key="hibernate.c3p0.maxIdleTime">300</prop>
<prop key="hibernate.c3p0.maxStatements">50</prop>
<prop key="hibernate.c3p0.minPoolSize">10</prop>
<prop key="hibernate.c3p0.preferredTestQuery">SELECT 1</prop>
<prop key="hibernate.c3p0.testConnectionOnCheckout">true</prop>
<prop key="show_sql">true</prop>
<prop key="hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</prop>
<prop key="hibernate.search.default.indexBase">d:\luceneFinal\</prop>
</props>
</property>
</bean>