facebook

Support for Spring & Hibernate combo

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #243769 Reply

    Michael J Caughey
    Participant

    Given that there is support for both Hibernate and Spring, it would be nice to have support for Hibernate in Spring.

    Would be nice if DBExplorer modified beans.xml

    
        <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiName">
                <value>java/PPOCDS</value>
            </property>
        </bean>
    
        <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
            <property name="dataSource">
                <ref local="dataSource" />
            </property>
            <property name="mappingResources">
                <list>
                    <value>com/wellpoint/ref/data/hibernate/domain/Address.hbm.xml</value>
                    <value>com/wellpoint/ref/data/hibernate/domain/Addresses.hbm.xml</value>
                    <value>com/wellpoint/ref/data/hibernate/domain/Addresstype.hbm.xml</value>
                    <value>com/wellpoint/ref/data/hibernate/domain/Person.hbm.xml</value>
                    <value>com/wellpoint/ref/data/hibernate/domain/Phone.hbm.xml</value>
                    <value>com/wellpoint/ref/data/hibernate/domain/Phones.hbm.xml</value>
                    <value>com/wellpoint/ref/data/hibernate/domain/Phonetype.hbm.xml</value>
                </list>
            </property>
            <property name="hibernateProperties">
                <props>
                    <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
                </props>
            </property>
        </bean>
    
    

    or does it andI’m missing it some how?

    Thanks,
    Michael

    #243780 Reply

    Brian Fernandes
    Moderator

    Michael,

    Actually we do modify your bean configuration file. I assume you are talking about the LocalSessionFactoryBean and the mappingResources element?

    If you check your project properties, and set the bean XML file in question as the active configuration file, when you generate mappings, they will automatically be added to the mappingResources element.
    Otherwise, the spring beans editor’s datasource wizard allows you to create a datasource bean which can be filled in with information from an existing DataSource profile.

    Let us know if you need further assistance or have other ideas 🙂
    Best,
    Brian.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Support for Spring & Hibernate combo

You must be logged in to post in the forum log in