Announcement Announcement Module
Collapse
No announcement yet.
Spring 2.5 Hibernate Search Configuration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring 2.5 Hibernate Search Configuration

    Hello, I have searched throughly for Spring 2.5 Hibernate Search 3 integration but I have found only scarce answers. Is there any tutorials for this? The project uses Spring 2.5 and the only configuration file is located under source name applicationContext.xml which i will post below. The hibernate version is 3.0, hibernate-search version 3.1.1, hibernate-annotartions version, hibernate-core version. I have looked for the solution on hibernate forums and they say it's a spring configuration issue. If you post a solution please be very specific [for instance under which key the property should be placed etc] because I'm new to Spring. Thanks in advance.

    applcationContext.xml:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
     	<!-- Um dataSource tem como objetivo armazenar configurações de acesso ao BD -->
     	<!-- Pacote do Spring: dao -> Spring JDBC -->
    	<bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource"><!-- Objeto Criado -->
    		<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    		<property name="url" value="jdbc:mysql://localhost:3306/clio-j"/>
    		<property name="username" value="root"/>
        	<property name="password" value="root"/>
    		</bean>
    
    	<!-- Um sessionFactory(Cria um objeto do tipo sessionFactory, com os dados do dataSource) -->
    	<!-- Pacote do Spring: ORM -> Hibernate -->
        <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    		<property name="dataSource" ref="dataSource"/>
    		<property name="hibernateProperties">
    			<props>
    				<!-- Dialeto(idioma que vai utilizar para conversar com o BD) -->
    				<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
    				<!-- Estratégia de criação do BD -->
    				<prop key="hibernate.show_sql">true</prop>
    				<!-- Estratégia de configuração do hibernate -->
    				<prop key="use_outer_join">true</prop>
    			</props>
    		</property>
    		
    		<property name="eventListeners">
    			<map/>
    			<entry/>
    			<key/>
    			<value>post-update</value>
    			<bean class="org.hibernate.search.event.FullTextIndexEventListener" />
    		</property>
    		<!-- Cria a estrutura do BD caso não exista -->
        	<property name="schemaUpdate" value="true" />
        	
        	<property name="annotatedClasses">
        		<list>
        			<value>br.ufpe.liber.clioj.dominio.Administrador</value>
        			<value>br.ufpe.liber.clioj.dominio.Assunto</value>
        			<value>br.ufpe.liber.clioj.dominio.Audio</value>
        			<value>br.ufpe.liber.clioj.dominio.Autor</value>
        			<value>br.ufpe.liber.clioj.dominio.Citacao</value>
        			<value>br.ufpe.liber.clioj.dominio.Colecao</value>
        			<value>br.ufpe.liber.clioj.dominio.Contribuidor</value>
        			<value>br.ufpe.liber.clioj.dominio.Documento</value>
        			<value>br.ufpe.liber.clioj.dominio.Editor</value>
        			<value>br.ufpe.liber.clioj.dominio.Formato</value>
        			<value>br.ufpe.liber.clioj.dominio.Grupo</value>
        			<value>br.ufpe.liber.clioj.dominio.Historico</value>
        			<value>br.ufpe.liber.clioj.dominio.Imagem</value>
        			<value>br.ufpe.liber.clioj.dominio.Lingua</value>
        			<value>br.ufpe.liber.clioj.dominio.Local</value>
        			<value>br.ufpe.liber.clioj.dominio.Lingua</value>
        			<value>br.ufpe.liber.clioj.dominio.Notas</value>
        			<value>br.ufpe.liber.clioj.dominio.Permissao</value>
        			<value>br.ufpe.liber.clioj.dominio.Proveniencia</value>
        			<value>br.ufpe.liber.clioj.dominio.Refinemento</value>
        			<value>br.ufpe.liber.clioj.dominio.Texto</value>
        			<value>br.ufpe.liber.clioj.dominio.Tipo</value>
        			<value>br.ufpe.liber.clioj.dominio.Usuario</value>
        			<value>br.ufpe.liber.clioj.dominio.Video</value>
        		</list>
        	</property>
        </bean>
        <!-- Criando objetos da DAO -->
        <bean id="AdministradorDao" class="br.ufpe.liber.clioj.dao.hibernate.AdministradorDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="AssuntoDao" class="br.ufpe.liber.clioj.dao.hibernate.AssuntoDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="AudioDao" class="br.ufpe.liber.clioj.dao.hibernate.AudioDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="AutorDao" class="br.ufpe.liber.clioj.dao.hibernate.AutorDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="CitacaoDao" class="br.ufpe.liber.clioj.dao.hibernate.CitacaoDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="ColecaoDao" class="br.ufpe.liber.clioj.dao.hibernate.ColecaoDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="ContribuidorDao" class="br.ufpe.liber.clioj.dao.hibernate.ContribuidorDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="DocumentoDao" class="br.ufpe.liber.clioj.dao.hibernate.DocumentoDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="EditorDao" class="br.ufpe.liber.clioj.dao.hibernate.EditorDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="FormatoDao" class="br.ufpe.liber.clioj.dao.hibernate.FormatoDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="GrupoDao" class="br.ufpe.liber.clioj.dao.hibernate.GrupoDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="HistoricoDao" class="br.ufpe.liber.clioj.dao.hibernate.HistoricoDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="ImagemDao" class="br.ufpe.liber.clioj.dao.hibernate.ImagemDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="LinguaDao" class="br.ufpe.liber.clioj.dao.hibernate.LinguaDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="LocalDao" class="br.ufpe.liber.clioj.dao.hibernate.LocalDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="NotasDao" class="br.ufpe.liber.clioj.dao.hibernate.NotasDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="PermissaoDao" class="br.ufpe.liber.clioj.dao.hibernate.PermissaoDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="ProvenienciaDao" class="br.ufpe.liber.clioj.dao.hibernate.ProvenienciaDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="RefinamentoDao" class="br.ufpe.liber.clioj.dao.hibernate.RefinamentoDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="TextoDao" class="br.ufpe.liber.clioj.dao.hibernate.TextoDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="TipoDao" class="br.ufpe.liber.clioj.dao.hibernate.TipoDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"></property>
        </bean>
        <bean id="UsuarioDao" class="br.ufpe.liber.clioj.dao.hibernate.UsuarioDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <bean id="VideoDao" class="br.ufpe.liber.clioj.dao.hibernate.VideoDaoImpl">
        	<property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        
        <!-- Criar os objetos da Facade -->
        <bean id="AdministradorFacade" class="br.ufpe.liber.clioj.facade.AdministradorFacade">
        	<property name="dao" ref="AdministradorDao" />
        </bean>
        <bean id="AssuntoFacade" class="br.ufpe.liber.clioj.facade.AssuntoFacade">
        	<property name="dao" ref="AssuntoDao" />
        </bean>
        <bean id="AudioFacade" class="br.ufpe.liber.clioj.facade.AudioFacade">
        	<property name="dao" ref="AudioDao" />
        </bean>
        <bean id="AutorFacade" class="br.ufpe.liber.clioj.facade.AutorFacade">
        	<property name="dao" ref="AutorDao" />
        </bean>
        <bean id="CitacaoFacade" class="br.ufpe.liber.clioj.facade.CitacaoFacade">
        	<property name="dao" ref="CitacaoDao" />
        </bean>
        <bean id="ColecaoFacade" class="br.ufpe.liber.clioj.facade.ColecaoFacade">
        	<property name="dao" ref="ColecaoDao" />
        </bean>
        <bean id="ContribuidorFacade" class="br.ufpe.liber.clioj.facade.ContribuidorFacade">
        	<property name="dao" ref="ContribuidorDao" />
        </bean>
        <bean id="DocumentoFacade" class="br.ufpe.liber.clioj.facade.DocumentoFacade">
        	<property name="dao" ref="DocumentoDao" />
        </bean>
       ....
        </bean>
    </beans>
Working...
X