Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-435

Introspect an existing database to support simple automatic JPA entities

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Complete
    • None
    • 1.1.0.M3
    • PERSISTENCE
    • None

    Description

      Most real-world enterprise applications are built in one of two ways:

      1. Starting with the relational schema and then building the application on top of it.
      2. Starting with the required web views and then building the application to support them.

      It would be nice if Roo offered extended support for #1, as many people have existing databases they wish to introspect and then "web expose". The usage scenario would be Roo commands like:

      project com.foo.helloworld
      persistence setup --provider OPENJPA --database POSTGRESQL
      database properties set --key database.url --value jdbc:postgresql://localhost:mydb
      database reverse
      controller all

      In this example "database reverse" would scan all tables in the localhost:mydb database and create an entity for each table. Unlike a normal entity, though, the fields would be added to a EntityName_Roo_Reverse.aj ITD. The benefit of adding the fields into an ITD is "database reverse" can automatically remove or update the EntityName_Roo_Reverse.aj with each subsequent execution. This is very useful if the database is changing.

      Attachments

        Activity

          People

            stewarta Alan Stewart
            balex Ben Alex
            Votes:
            129 Vote for this issue
            Watchers:
            92 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: