• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

any mapper code generation tools?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are many mapper tools available for pojo and DTO. Check the link: any tool for java object to object mapping? But is there any open-source tools that generate the DAO, Service classes automatically?

Dozer Sample:



Here the xml configuration is fine, but can I skip the code part and just specify the POJO-DTO configuration or POJO-DTO along-with filter configuration. And some tool should be able to automatically generate intermediate translation code in the form of DAO and Service classes. Are there any such open-source tools available?
 
Saloon Keeper
Posts: 24557
168
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Pankaj!

The DAO and service components are difficult to generate automatically because they typically have application and schema-specific logic in them.

In the cases where I have had predictable functions (such as elementary CRUD method) in DAOs, I'd just create a generic base class for all affected DAOs.
 
pankaj pandit
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim.

That's right, Services and Daos have application and schema-specific logic in them. But can a tool do some sort of initial bootstrapping by building Dao and Service class and stub methods. These will not exactly be stubs but actual functional methods, which will need a fill in the gaps type of job by a developer. I am trying to develop such a tool here: https://github.com/pankaj-creativitis/bcg

I think this could save a lot of monotonous translation time for a developer. Would definitely like to hear about the feasibility and utility of this tool.
 
Tim Holloway
Saloon Keeper
Posts: 24557
168
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been known to do that as well. But I just roll my own. Either by writing a short script that takes a list of names and generates files from a prototype or - if I'm using an IDE, I might just setup a "new class" template that I can use as a basis.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic