GavinLas wrote:
Hello,
I would love to share the code with the Hibernate team (and anyone else who is interested). I will spend a day or two cleaning / documenting it and then send it to you.
great - but it would really be nice if could just get a glimpse of it - after tomorrow it's going to happen a 1000's things the next 5-6 days and here i probably can't find much time to look at it......but then again, it is also fully ok if you don't feel like sharing it yet ;)
Quote:
Quote:
Sounds very interesting - and the result from these "parses" are available to the other generators...
At the moment I have a simple hbm parser. But there is nothing to stop you writing a simple parser that chains / invokes other parsers or even parses different types of xml files
cool
Quote:
Quote:
- Complete control over the files that are generated. Developers should be able to add new templates for things like dao's, unit test, ddl, etc by simply changing a template file
The nice thing is the templates look almost like the final java files.
yes - it's one of the good wins.
Quote:
Quote:
This is already in hbm2java - it's one of the main reasons for <meta>!
I hope/wish you would use the existing way to define it since it allows for really flexible control on this generation....
Not sure if it is in the version of hbm2java I have seen Hibernate 2.1 b1.
It is - it was the first tag for <meta> ;)
Look at meta attribute "generated-class"
Quote:
I will try use the existing way. I am note sure if hbm2java generates all files or only the ones for the xml that has changed.
Currently it generates for all the .xml files you give it.
Quote:
I normally mark all generated files as "read-only". That way the user (1) is reminded that the java is generated and should not be altered lightly (2) if changed to write-able, the generator does not overwrite it (a bit backwards, but works like a charm with IDEs and CVS)
It's cool - and one should not add complety automatically generated files to cvs - one should just add the hbm.xml files, right ?
Quote:
Quote:
All of this is of course true - (but I would say the same thing about hbm2java, one does not need to think about the generation mechanisms - at least not what I know ;)
If you look at hbm2java, the renderers are quite large classes. With velocity, these disappear and you can spend the time on other (more interesting) parts of the system.
Yes - and it's why I was about to add the contributed velocity renderer, so we would not require people to code/compile stuff to make changes to the generated code.
Quote:
I can handle any state of the code ;) I would just love to see it.
Quote:
As I said at the start, give me a day or two to clean it up. I will then send it to you. Maybe we could even pair on the development. Particularly as I am very new to Hibernate and it takes me a long time to figure out how to parse the hbm file and what the resulting template should look like. However, the velocity / ant / code generation part I can do in my sleep.
Sounds great - looking forward to it.