Announcement Announcement Module
Collapse
No announcement yet.
database reverse engineer doesn't generate json mappings Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • database reverse engineer doesn't generate json mappings

    I'm trying to generate json rest bindings for an existing postgresql database.
    It works fine, except for the json mapping. There are no *_Roo_Controller_Json.aj files generated after running "web mvc json all".
    Is this expected, or are json mappings not yet supported for the dbre plugin?

    Here's my script:

    Code:
    // Create a new project
    project com.foo.dbre
    addon install bundle --bundleSymbolicName org.springframework.roo.wrapping.postgresql-jdbc3
    jpa setup --provider HIBERNATE --database POSTGRES --databaseName foo --hostName localhost --userName dmin --password foo9 --transactionManager 
    database reverse engineer --schema public --package ~.domain
    
    // Offer JSON remoting for all domain types trough Spring MVC
    json all --deepSerialize
    web mvc json setup
    web mvc json all
    Thanks in advance.

    -Bruce

  • #2
    It appears to work for me using one of my sample Postgres db's. I am using the latest 1.2.0 build snapshot.

    Code:
    1a48d10 Created SRC_MAIN_RESOURCES/dbre.xml
    11d55ce Updated ROOT/pom.xml
    01ee955 Updated SRC_MAIN_RESOURCES/META-INF/persistence.xml
    Created SRC_MAIN_JAVA/com/foo/dbretest/domain
    f7a6b62 Created SRC_MAIN_JAVA/com/foo/dbretest/domain/T2jason.java
    d3401d3 Created SRC_MAIN_JAVA/com/foo/dbretest/domain/T2jason_Roo_Configurable.aj
    a6b27df Created SRC_MAIN_JAVA/com/foo/dbretest/domain/T2jason_Roo_Jpa_Entity.aj
    5bb0d4c Created SRC_MAIN_JAVA/com/foo/dbretest/domain/T2jason_Roo_DbManaged.aj
    cb6b51e Created SRC_MAIN_JAVA/com/foo/dbretest/domain/T2jason_Roo_Entity.aj
    ed733e9 Created SRC_MAIN_JAVA/com/foo/dbretest/domain/T2jason_Roo_ToString.aj
    com.foo.dbretest roo> 
    com.foo.dbretest roo> json all --deepSerialize 
    c3f23e4 Updated SRC_MAIN_JAVA/com/foo/dbretest/domain/T2jason.java
    e761e17 Created SRC_MAIN_JAVA/com/foo/dbretest/domain/T2jason_Roo_Json.aj
    com.foo.dbretest roo> 
    com.foo.dbretest roo> web mvc json setup
    Created SRC_MAIN_WEBAPP/WEB-INF/spring
    829190e Created SRC_MAIN_WEBAPP/WEB-INF/spring/webmvc-config.xml
    2451afb Created SRC_MAIN_WEBAPP/WEB-INF/web.xml
    ab78e5d Updated SRC_MAIN_WEBAPP/WEB-INF/web.xml
    09f58b5 Updated ROOT/pom.xml [added dependencies org.springframework:spring-web:${spring.version}, org.springframework:spring-webmvc:${spring.version}; updated project type to war]
    com.foo.dbretest roo> 
    com.foo.dbretest.web roo> web mvc json all 
    a58d8fe Created SRC_MAIN_JAVA/com/foo/dbretest/T2jasonController.java
    05a141f Created SRC_MAIN_JAVA/com/foo/dbretest/T2jasonController_Roo_Controller_Json.aj
    com.foo.dbretest.web roo>
    Perhaps you can attach your dbre.xml file so I can test using it
    Alan

    Comment


    • #3
      Looks like it is fixed in the latest snapshot. After I updated roo to the 0907 snapshot it gave me a bunch of warnings about some batch_job tables that I didn't really need anyway so I added a --excludeTables to remove the offending items and it dis generate the json mappings.
      Let me know if you want the dbre.xml for the failed tables and I can send it to you.

      Thanks to whomever recently fixed this. My guess is it was in the validation and that if I had excluded the same tables from an earlier version it may have worked too. In any case, this is very cool, this just saved me a huge amount of work!!

      Now if I can just get ROO-2716 added, I'll be home free :-)

      -Bruce

      Comment

      Working...
      X