Book a Demo

Author Topic: How to generate Spring Framework ROO entity specs  (Read 3683 times)

Brian Carroll

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
How to generate Spring Framework ROO entity specs
« on: February 27, 2010, 07:00:38 am »
I'm using Sparkx EA to model the class structure of a large Java application.  I've recently experimented with Spring ROO and was impressed with its capabilities, and so would like to be able to output Spring ROO statements describing entities, attributes, and relationships.  The ROO syntax for these is fairly simple: command line syntax with parameters to express Java Persistence Arch entities, attributes, and relationships.  Here are some ROO syntax examples:

entity --class ~.domain.Vet --extends ~.domain.AbstractPerson --testAutomatically
entity --class ~.domain.Owner --extends ~.domain.AbstractPerson --testAutomatically

field string --fieldName firstName --sizeMin 3 --sizeMax 30 --class ~.domain.AbstractPerson
field string --fieldName lastName --notNull --sizeMin 3 --sizeMax 30
field string --fieldName address --notNull --sizeMax 50 --sizeMin 1
field string --fieldName city --notNull --sizeMax 30
field reference --fieldName pet --type ~.domain.Pet --notNull
field reference --fieldName vet --type ~.domain.Vet

I'm looking for a way - ideally a scripting language that would navigate my UML class model and allow me to generate the Spring ROO statements from the UML Class model.

Ideally, a generation script would make two passes through the class model: once to output the ROO entity and attribute statements and a secon pass to output the relationship (reference statements).

Now, I am running the Coorporate Edition, and have been very confused by the MDG offerings (what they do, whether I need them, etc.).  So my questions are:
Is there a way to write generation scripts and run them using the Corporate Edition, or do I need to purchase an add-on or more capable edition?
Are there sample scripts that navigate top down through a class model from model, to package to class to attribute, ...?

Thanks,
Brian
Brian Carroll
B. R. Carroll & Associates, LLC
(503) 318-2017

altorion

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: How to generate Spring Framework ROO entity sp
« Reply #1 on: July 21, 2011, 01:56:15 pm »
Any update about this?

Nearly all Java developers are start considering or, at least, evaluating, Spring Roo for their future developments, and, currently, no UML solution offers support for Roo scripts generation.

Ideally, they would generate the scripts to update from the last generated version in order to avoid Spring Roo "errors", but a duplicate table, field or relationship would be detected by Roo, the error would be displayed and nothing bad would happen.

Come on, boys!!! You would be the first ones to support it!!!

Thanks,
Oscar

Brian Carroll

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: How to generate Spring Framework ROO entity sp
« Reply #2 on: July 22, 2011, 05:13:56 am »
I'm still interested in a bridge between EA object model and Spring ROO.  I've gone through the process by hand for a database with 31 entities, and am doing it again for a different application with 220 entities (which quite a chore).

The Spring ROO statements are heavily oriented around JPA, and I believe there is enough information in an EA object model to perform the transation.

Getting either a working implementation (or enough guidance on how to do it ourselves) would help and would align EA with an increasingly popular implementation platform.

--Brian

Brian Carroll
B. R. Carroll & Associates, LLC
(503) 318-2017