0 Replies Latest reply on Aug 1, 2014 2:37 AM by wingswong

    Wildfly + Spring + Hibernate

    wingswong

      I would like to use webservice subsystem with spring , but i do not know how to connect hibernate sessionFactory.

       

      Does anyone has idea how to config it, thank you very much.

       

      .

      hibernate.xml

      <bean id="sf" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">

        <property name="dataSource" ref="dataSource" />

        <property name="hibernateProperties">

        <props>

        <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.dialect">org.hibernate.dialect.Oracle10gDialect</prop>

        <prop key="hibernate.connection.characterEncoding">utf-8</prop>

        </props>

        </property>

        <property name="packagesToScan">

        <list>

        <value>com.demo.model</value>

        </list>

        </property>

        </bean>

       

       

        <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">

        <property name="jndiName">

        <value>java:jboss/datasources/OracleDSJNDI</value>

        </property>

        </bean>

        <bean id="transactionManager"

        class="org.springframework.orm.hibernate4.HibernateTransactionManager"

        autowire="byType" />

        <tx:annotation-driven />

       

      This is my configuration, hope to hear your voice.