Quote:
3) I would like three tables (at this point) to have cascade="" attributes on some fields. I can add it manually to the hbm.xml files, but every time we regenerate for database changes it gets overwritten. Can I do this somehow using reveng.xml?
no, not at this time. Might be added...
[/quote]
Since I will now be extending ReverseEngineeringStrategy, is there a method that I can override where I can do some matching and insert the cascades there? For those three HBM files only?
[/quote]
no, not at this time. Remember that reveng.xml is nothing else than a simplified "text" version of what can be done via RevEngStrategy..so to get it in reveng.xml the RevEngStrategy needs to get a method for it first.
Quote:
4) The current generated POJOs are inflexible (if I regenerate it will overwrite changes). I would like to generate classes that extend from the generated pojos that can be updated and changed and not be overwritten (a la Hibernate Synchronizer). It looks like I will need some new templates and maybe a new Exporter. How do I set these up? Or has someone done this?
i plan on implementing this soon.
can be done today by adding <meta attribute="generated-class">PersonBase</meta> to the hbm.xml.
This is just not supported for reveng.xml yet.
[/quote]
So if I add this to the HBM template for all HBMs, then both the base class and the extended class will be generated automatically? Or will it only generate the base class, and I still need to generate the extended classes?
[/quote]
it only generates the baseclass as the moment.
Quote:
If I still need to generate the extended classes, how do I set it up so that it doesn't generate those classes if they exist? Is that ReverseEngineeringStrategy again? If so, can you guide me to the areas in the code to make those changes?
there is no overwrite detection build in. only way at the moment is to generate to a seperate dir and copy-no-overwrite with e.g ant.
Quote:
5) I would like to auto-generate some Spring-based DAOs, with a beans.xml file in the directory to hook them into spring. Again, how would I set up the templates/exporter? Or has someone done this?
example ( assuming you write the spring specific beans.xml template )
<hbmtemplate template="springcfgxml.ftl" templatepath="pathtoyourtemplate" filepattern="beans.xml"/>
<hbmdao/>
[/quote]
Quote:
Great. I think I can do that. A few questions, though.
a) I'm still trying to figure out what is available in the context. I see that allEntity-list.ftl has a classList that it is running off of. Should I use that same list for springcfgxml.ftl?
allentity-list.ftl is something that the DocExporter uses. Check there to see what he puts in.
but generally for a "configuration wide" file you just use $cfg to get access to what you want. e.g. $cfg.getClassMappings()
Quote:
b) In allEntity-list.ftl, what type of object is "class" and where is the API (so that I can get other values from it)?
you mean $clazz ? it is a PersistentClass.
Quote:
c) What variable can I get the package these were generated in from?
i don't understand. the package name is part of the fully qualified classname.
Quote:
d) Any chance I can run this from the UI? Everything else is running from there, and it would be a shame to go to Ant for this one thing.
the ui doesn't support arbitrary custom exporters but it does support overriding existing templates.
we will eventually get "arbitrary custom exporters" in the ui.
Quote:
6) Lastly, we are hoping to be able to publish database changes up the build chain by using the hbm.xml files as a guide. Can this be done cleanly?
Define cleanly ?
<hbm2ddl update="true" output="updatesql.txt"/> ?
OK, I'll read up on those options and see how they work. By cleanly, I mean that everything is intact (tables, PKs, FKs, indices) in the new database. I wouldn't expect triggers, stored procs, and the like to move through this (unless you can tell me a way). It will save alot on manual creation and alter scripts for publishes.[/quote]
we don't have a perfect db schema delta tool.