Hi George,
If you still want/need the Rails style of scaffolding, and are using
Cayenne for persistence, than it's possible to make your own Cayenne
Modeler templates, that will e.g. generate for each Entity: the code you
desire. See in Cayenne Modeler -> Preferences -> Templates -> Add
Template (you can take a look at the actual velocity templates used by
Cayenne to generate the entity java code - and in the same manner to
generate your extra code).
I couldn't find any examples/docs on the Cayenne site about how to do my own
templates :( :
I doesn't seem to be explained anywhere how to do custom templates, what
goes where, what files get generated and when, what are the allowed
variables in the templates, how to access from one entity the fields of the
other entities. Besides, there doesn't seem to be in CM any possible
interaction with the user besides starting the generation process - or I
couldn't find the API/config required for it :(.
I suppose, maybe you might want to bringing some of these issues on the
Cayenne lists :).
Also note that Cayenne Modeler is being constantly improved, so you
might also want to try the latest nightly versions.
For now, even if it's complicated, it's doable: you have to take a look
at the cayenne source code, and at the 'dotemplates' directory to get an
idea how the pieces fit together:
- the templates contain a short description of the variables/classes
in use (you need to deactivate the code folding for *.vm file headers in
your IDE - otherwise you might miss that part).
- from those class names, you can navigate into the source code, and
with an UML tool, get some nice diagrams - if it helps you understand
faster.
- note that the generation process, can be started not just from CM
but from ANT too, so as an alternative you could make an extra ANT task
to get the desired extra user input.
After that, try to make you own small templates, to see how it works,
and if it does, put more template code in them.
If you get stuck, post the code here (if it's possible) to see if we can
make it work.
I hope this helps,
Adrian.