Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » Headless mode via ant or the like?
Headless mode via ant or the like? [message #1062335] Fri, 07 June 2013 09:22 Go to next message
Andreas Schilling is currently offline Andreas Schilling
Messages: 22
Registered: April 2010
Junior Member
Hi everybody!
We're currently evaluating some possibilities to improve our model driven approach which is yet based on using hibernate mappings as a master. We want to take the next step and have a real (graphical) model as the base for everything (ORM, model java classes, custom code that is generated from the model, ...)
Dali looks really awesome, but yet we couldn't find any information whether it is possible to trigger the generation features also in a headless mode.
This is crucial for us as we want to embedd it into our buildserver (Jenkins) process. In an ideal case the only thing we check into our SCM concerning the model is some file(s) containing it and then generate everything from there on. We do not want to check in generated code that comes from whatever tooling.
Is it possible to integrate Dali in such a way? Preferably via ant, in a way you can e.g. do it with the hbm2java tools from hibernate.

Any hints are appreciated!

Regards,

Andreas
Re: Headless mode via ant or the like? [message #1062403 is a reply to message #1062335] Fri, 07 June 2013 14:31 Go to previous messageGo to next message
Neil Hauge is currently offline Neil Hauge
Messages: 469
Registered: July 2009
Senior Member
Hi Andreas,

Which aspects of Dali would you like to use in a headless fashion? Are you thinking about our entity generation from tables? There are several API's currently available in our EclipseLink Tools bundles that do some amount of headless generation of mapping metadata, and EclipseLink has some very cool features with its Dynamic Persistence support. That said, perhaps you could tell me more about what parts of Dali you would like to use and I can point you in the right direction, or at the very least help you enter some enhancement requests. We are planning on expanding our headless Entity Generation options in the next EclipseLink release.

Neil
Re: Headless mode via ant or the like? [message #1062619 is a reply to message #1062403] Mon, 10 June 2013 06:01 Go to previous messageGo to next message
Andreas Schilling is currently offline Andreas Schilling
Messages: 22
Registered: April 2010
Junior Member
Hi Neil,

thanks for the offer. maybe I can sketch you our current process with hibernate and which parts we want to change/extend.
Currently we do

  1. reverse engineer an existing DB schema to .hbm.xml
  2. use those hibernate mappings to generate entity classes (POJOs), DAOs, derived mappings and classes and the like (well, basically anything you can generate when you have the metamodel in form of an hibernate mapping)
  3. update schema changes in the .hbm.xmls and do 2 again (actually step two is only done manually by developers, on our buildserver it is automatically done prior to the actual build)

that process works fine, however it has some drawbacks so the following list shows some things we'd like to change:

  1. sometimes we have applications without any DB but still we don't want to miss the features of generating our entities and additional code, like e.g. a static metamodel. using ORM-stuff and hibernate-mappings just to do that is at least a bit strange.
  2. using the hibernate-mappings as "master" during the lifecycle of the application is not as bad as it sounds but still a bit of a hack. however, usually we can't simply re-generate them from the database because modifications have to be done.
  3. we'd like to have the complete modeling process in the IDE at hand. we use different databases (Oracle, MySQL, ...) and using different modeling tools for all of them is annoying (also, some of them simply suck Smile)
  4. we currently imagine that we design our data model with a diagram editor (Dali), check that diagram into the SCM as part of the project and then generate in headless mode all of the above (or maybe more, best case would be that templates can be used to generate basically anything, like with the hbmtemplate stuff from hibernate) prior to the actual build

hope that clarifies it a bit.
to put it even shorter: key point is, that the only part that must be done in Eclipse is the (graphical) designing of the model. from there on everything must be available in headless mode, else we can't use it on the buildserver.

thanks alot already,

Andreas
Re: Headless mode via ant or the like? [message #1062812 is a reply to message #1062619] Mon, 10 June 2013 20:25 Go to previous message
Neil Hauge is currently offline Neil Hauge
Messages: 469
Registered: July 2009
Senior Member
Andreas,

Dali does have a Diagram Editor that can be used for entity modeling, but the output of the editor is in the form of annotated POJO's. The XML file produced by the Diagram Editor does not contain metadata that would be useful outside of the scope of the editor itself, and it is not currently capable of producing ORM XML Mapping File metadata, which could theoretically be used later for some type of model generation. As a result, I don't think the Diagram Editor will fit your needs in its current state.

Something that may be of interest to you is an EclipseLink feature called Dynamic Persistence, which is supported in Dali.[1][2] It allows you to define your mapping model in XML metadata (eclipselink-orm.xml) and does not require the maintenance of Java classes. The classes are created dynamically as needed at runtime. The XML mapping file can be generated from a database schema or created by hand.

An interesting feature idea would be to have the Diagram Editor produce ORM XML metadata, which could then theoretically be used to generate POJO's. It could also generate dynamic entities which would not require "static" classes to be involved at all. Unfortunately at this time there are no immediate plans to work on this type of functionality. If you would like to see something like this, please enter a bug request against Dali in bugzilla.

[1] http://www.eclipse.org/webtools/releases/3.4.0/NewAndNoteworthy/jpt.php
[2] http://wiki.eclipse.org/EclipseLink/Examples/JPA/Dynamic

Hope this helps,
Neil
Previous Topic:JPQL Refactoring?
Next Topic:errors in entity classes generated from Table
Goto Forum:
  


Current Time: Wed Oct 22 00:05:23 GMT 2014

Powered by FUDForum. Page generated in 0.01731 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software