facebook

Spring/Hibernate DAO Beans in ApplicationContext.xml

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #245413 Reply

    rzarob
    Member

    I noticed that only the last DAO object is added as a bean in the ApplicationContext.xml after creating Hibernate Mappings (with Spring DAO classes). I believe it is a bug where only the last mapping is added as a bean in the ApplicationContext.xml configuration file. Please let me know if/when there is a fix to this. Thanks in advance.

    #245432 Reply

    Riyad Kalla
    Member

    If you remove it manually from the applicationContext and then regenerate the mappings, is it re-added?

    #245522 Reply

    rzarob
    Member

    I removed the one DAO generated bean from the applicationContext file then regenerated the hibernate mappings. I got the same result after doing this. All of the hibernate mappings are added to the list of mapping resources under the SessionFactory bean, but it only creates a DAO bean in the applicationContext for the last item in that list. I am assuming the code that handles this automation is writing over the previous DAO bean as opposed to adding it which would leave a DAO bean for the last item in the list. Thanks

    #245528 Reply

    Riyad Kalla
    Member

    Can you paste the result of MyEclipse > About > Configuration Summary for me?

    #245533 Reply

    rzarob
    Member

    *** Date: Fri Jan 27 12:37:38 EST 2006

    *** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.4.2_08

    *** MyEclipse details:
    MyEclipse Enterprise Workbench

    Version: 4.1.0 GA
    Build id: 20060122-4.1-GA

    *** Eclipse details:
    Eclipse SDK

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Platform

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Java Development Tools

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Project SDK

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse RCP

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Plug-in Development Environment

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Graphical Editing Framework

    Version: 3.1
    Build id: 200509301327

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\data\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    d30_6c
    -vm
    C:\WINDOWS\system32\javaw.exe

    #245566 Reply

    Brian Fernandes
    Moderator

    Rzarob,

    I investigated this an there is indeed a bug in this behaviour.
    If a bean for that DAO already exists, it will not be overwritten (which is by design) – you will notice this if you modify an existing DAO bean definition and then regenerate, the bean will not be touched.

    Having said that, the workaround until 4.1.1 is to reverse engineer your tables one at a time so that the DAO beans definitions are created and inserted into your applicationContext.xml file correctly. Thereafter, you can reverse engineer a bunch of tables becuase we aren’t going to be updating the DAO bean definitions anyway.

    Thank you for reporting this, we’re sorry you had to run into it. Please let us know if you need further assistance or have any suggestions to improve the process.

    Best,
    Brian.

    MyEclispe 4.1.1 will be out late Feb or early March.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Spring/Hibernate DAO Beans in ApplicationContext.xml

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