Announcement Announcement Module
Collapse
No announcement yet.
[SOLVED] hibernate - eclipse plugins - several .hbm.xml Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • [SOLVED] hibernate - eclipse plugins - several .hbm.xml

    Hi,
    I use Eclipse to build my .hbm.xml files.

    But now i dont know what / how i can put thoses ones in the bean sessionFactory.

    Currently i've put the hibernate.cfg.xml file but i meet a dataaccess problem when i try to acces one of my tables.
    Code:
    	<!-- Hibernate SessionFactory -->
    	<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    		<property name="dataSource" ref="dataSource"/>
    		<property name="mappingResources">
    	        <value>hibernate.cfg.xml</value>
    		</property>
    		<property name="hibernateProperties">
    			<props>
    				<prop key="hibernate.dialect">$&#123;hibernate.dialect&#125;</prop>
    				<prop key="hibernate.show_sql">true</prop>
    				<prop key="hibernate.generate_statistics">true</prop>
    			</props>
    		</property>
    		<property name="eventListeners">
    			<map>
    				<entry key="merge">
    					<bean class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
    				</entry>
    			</map>
    		</property>
    	</bean>
    Does someone know how i can put all my .hbm.xml in this bean ?
    or do i have to generate one .hbm.xml from all the others ?


    regards.

  • #2
    Solution is :
    Code:
    	<!-- Hibernate SessionFactory -->
    	<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    		<property name="dataSource" ref="dataSource"/>
    		<property name="mappingResources">
    		    <list>
    		        <value>Appli.hbm.xml</value>
                    <value>AppServer.hbm.xml</value>                		        
                    <value>Env.hbm.xml</value>		        
                    <value>Install.hbm.xml</value>		                        
                    <value>Oracle.hbm.xml</value>                                
    	            <value>Server.hbm.xml</value>
    		    </list>
    		</property>
    		<property name="hibernateProperties">
    			<props>
    				<prop key="hibernate.dialect">$&#123;hibernate.dialect&#125;</prop>
    				<prop key="hibernate.show_sql">true</prop>
    				<prop key="hibernate.generate_statistics">true</prop>
    			</props>
    		</property>
    		<property name="eventListeners">
    			<map>
    				<entry key="merge">
    					<bean class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
    				</entry>
    			</map>
    		</property>
    	</bean>

    Comment


    • #3
      thanks for posting the solution Too many people ask questions and never bother updating their forums when they solved it themselves.

      Comment


      • #4
        Originally posted by yatesco
        thanks for posting the solution Too many people ask questions and never bother updating their forums when they solved it themselves.
        its because they dont have the spirit to share their experiences with each other.
        As i'm a Linux user and originally a PHP developper (and webmastered a website dedicated to PHP), i usually, of course share with other

        regards.

        Comment


        • #5
          (Completely OT) Hey, long live Linux Which distro? I am constantly switching between ubuntu, gentoo and suse

          Comment


          • #6
            Originally posted by yatesco
            (Completely OT) Hey, long live Linux Which distro? I am constantly switching between ubuntu, gentoo and suse
            lol
            GNU/Linux Debian (Sid Release ; yes i'm not afraid of SiD )

            Comment

            Working...
            X