MyEclipse: Want to customize code generation, but can't see model
rdennisj - Dec 16, 2010 - 05:30 PM
Post subject: Want to customize code generation, but can't see model
I want to extend the code generator, to implement table columns defined with a foreign key, as a drop-down box with choices populated from the foreign key table. But I don't know how to read the ecore model to get foreign key data from the 'relationships' segment of the model. I have gone thru EMF tutorials, where an ecore model is being generated (as an example), but the XML element and attribure names don't match up to the properties you reference in your .jet files.
Is there some way we can see what you generate into an ecore model, so we can see what kinds of metadata is available to us during code generation?
Thanks! And keep up the good work!
davemeurer - Dec 17, 2010 - 06:00 PM
Post subject: RE: Want to customize code generation, but can
One way you can see the eCore models is if you Enable the Spring DSL, and then look in the folder structure under the .springDSL folder. For more about Enabling the Spring DSL, please see the tutorial: http://www.myeclipseide.com/documentation/quickstarts/ME4STutorialInitialization/me4sinitializationarticle.html
Regarding relationships, a good example in our JET templates in the customization project can be found in the GWT templates that handle creating Pickers which are used to create associations to related objects.
rdennisj - Dec 17, 2010 - 07:46 PM
Post subject: Looking at the files created under .springDSL
Thanks so much for the response. I did have the Spring DSL enabled (per an earlier post where you recommended this). I notice artifacts are created under .springDSL, in subfolders dao, domain, and service. If I have a domain file called 'item', I see there are files in the domain subfolder, named:
Which of these files is used as the model source when the FLEX client generation is executed?
davemeurer - Dec 17, 2010 - 07:52 PM
The main model used in Flex is item.datatype.
item.datatypebinding is the model that holds information for JPA related information and persisting to the database.
item.gwtdatatype as you would expect is a model for GWT.
and, item.jaxbdatatype is used to hold the XML annotation information on the domain object.
rdennisj - Dec 17, 2010 - 08:13 PM
jkennedy - Jan 12, 2011 - 02:57 PM
Let me know if you need anything else.
All times are GMT - 6 Hours
Powered by PNphpBB2
© 2003-2004 The PNphpBB GroupCredits