|Re: Headless mode via ant or the like? [message #1062619 is a reply to message #1062403]
||Mon, 10 June 2013 06:01
| Andreas Schilling
Registered: April 2010
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
- reverse engineer an existing DB schema to .hbm.xml
- 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)
- 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:
- 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.
- 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.
- 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 )
- 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,
|Re: Headless mode via ant or the like? [message #1062812 is a reply to message #1062619]
||Mon, 10 June 2013 20:25
| Neil Hauge
Registered: July 2009
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. 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.
Hope this helps,
Powered by FUDForum
. Page generated in 0.01979 seconds