facebook

Which JPA implementation is used when scaffolding a crud app

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #311467 Reply

    shaykr
    Member

    I am pretty new to this and I saw that when scaffolding, both hibernate and toplink are added as part of the libraries. What is hibernate used for in the scaffolding?

    #311468 Reply

    davemeurer
    Member

    Hello,

    Hibernate is the JPA Implementation used in the Spring CRUD applications. You’ll see this reflected in the Spring context files.

    You may be seeing toplink added as part of maven dependencies – are you working with a maven project? If not, would you be able to help us understand the steps you took to the project before scaffolding?

    Kind regards,
    Dave

    #311469 Reply

    shaykr
    Member

    Thanks for the quick reply.

    I am simply right clicking the project (web project) and selecting myeclipse->scaffold spring CRUD application, then I choose create from database Schema and as a web framework I choose Spring MVC. I do not check the add maven support option.
    I select all default and next in the wizard.

    at the end of the process I see both the following jars added to my project:

    1. Spring 2.5 Persistence Core Libraries
    2. Spring 2.5 Persistence JDBC Libraries
    3. Hibernate 3.2 Core Libraries.

    Inside the Spring 2.5 Persistence Core Libraries I can see persistence.jar whcih contains toplink packages.

    Can you explain the purpose of each set of libraries?

    Also, I see the DAOs which are created are autowired in the service impl class, but still, don’t they need to be defined in spring configuration file as a bean?

    Thanks!!!

    #311481 Reply

    davemeurer
    Member

    Hello,

    Inside the Spring 2.5 Persistence Core Libraries I can see persistence.jar whcih contains
    toplink packages.

    You are absolutely correct. Thank you for providing the steps you took and pointing this out. When scaffolding was introduced in MyEclipse, it used the existing Spring Core Persistence Libraries, which were used to bootstrap Spring projects and then contained toplink to give developers a choice of JPA implementations. In short, these toplink libraries are not used in a Scaffolded application.

    We are continuing to refine the required scaffolding classpath containers and maven dependencies each release, but you have the ability to modify the classpath containers via the Preferences panel.

    Also, I see the DAOs which are created are autowired in the service impl class, but still, don’t they need to be defined in spring configuration file as a bean?

    Yes, ME4S scaffolding uses context component-scan to define the beans. If you take a look at the [appname]-generated-dao-context.xml file, you’ll see an element: context:component-scan that scans for annotated beans.

    HTH,
    Dave

    #311493 Reply

    shaykr
    Member

    Thank you 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Which JPA implementation is used when scaffolding a crud app

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