Announcement Announcement Module
No announcement yet.
can i reuse xdocled generated cfg-files? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • can i reuse xdocled generated cfg-files?

    hi @ all

    i'm planing to use spring in my project which has already a stable access to a database
    which use hibernate as or/mapper. all the config files for hibernate are generated automatically
    by xdoclet and stored in a seperated diretory.

    am i able to reuse these config-files to configure the spring framework for hibernate access
    or must i rewrite everythin in the xml-files readed by spring?

    has anybody the same idear or have i made a big mistake?
    i'm just very new to spring

    thanks for response

  • #2
    Yes you can re-use it. You just have to refer to it. Look at Spring's petclinic sample applicationContext-hibernate.xml.


    • #3
      sorry i found the part in the config file after i have posted the text


      • #4
        Originally posted by psychorav
        sorry i found the part in the config file after i have posted the text
        What about the hibernate.cfg.xml file? Do I really need to enter
        all info already generated by XDoclet? Didn't find anything useful
        in the petclinic app. It still contained info from that file..



        • #5
          i told xdoclet to generate all the hbm.xml file plus the hibernate.cfg.xml in the /WEB-INF/classes directory of the webmodule. then i told spring to initialise the sessionFactory
          	<bean id="sessionFactory"
          	      <property name="dataSource"><ref local="dataSource"/> </property>
          	      <property name="configLocation"><value>classpath&#58;hibernate.cfg.xml</value></property>
          	 	 <property name="hibernateProperties">
          	        <prop key="hibernate.dialect">$&#123;db.dialect&#125;</prop>
          so everything is done automatically


          • #6
            There is a thread on the dev list discussing this.