Results 1 to 6 of 6

Thread: [SOLVED] hibernate - eclipse plugins - several .hbm.xml

  1. #1
    Join Date
    Aug 2005
    Location
    paris
    Posts
    20

    Default [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. #2
    Join Date
    Aug 2005
    Location
    paris
    Posts
    20

    Default

    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>

  3. #3
    Join Date
    Aug 2004
    Posts
    1,905

    Default

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

  4. #4
    Join Date
    Aug 2005
    Location
    paris
    Posts
    20

    Default

    Quote 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.

  5. #5
    Join Date
    Aug 2004
    Posts
    1,905

    Default

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

  6. #6
    Join Date
    Aug 2005
    Location
    paris
    Posts
    20

    Default

    Quote 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 )

Similar Threads

  1. Hibernate Long Session Per Flow?
    By akw in forum Web Flow
    Replies: 21
    Last Post: Dec 12th, 2005, 08:06 PM
  2. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  3. Replies: 0
    Last Post: Feb 3rd, 2005, 02:03 PM
  4. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM
  5. Replies: 7
    Last Post: Aug 21st, 2004, 03:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •