i have built a small code generator based on the hibernate mapping file.
it enables us to automatically generate the classes specified in the
mapping file (no hand writing all those getters and setters :-)).  i
have tried to make it extendable and configurable so that other classes
(eg. data access or business logic) or web pages, etc could also be
automatically generated.

so far, it has been a tool that has been built and added to as we have
needed, and therefore doesn't support all the mapping features
available.  for example it doesn't do:
        toplevel collections
        components
        primitive types

but it does do:
        nested collections
        one-to-many
        many-to-one

there is also no concept of regenerating changed existing classes and
automatically merging the changes.  finally, as this has not been a big
focus for us, the code/docs r not always very pretty.

in light of all that, i use it regulary and find it saves me time.  our
company (workingmouse.com) has decided that should there be any
interest, we can contribute it to the hibernate project.

in light of the recent discussions on automatic generation from a
database, i can't c y the code generator could not be extended to use
the mapping file, or an existing database.  currently, the code
generator processes the mapping file into it's own internal structure
(it can't use the existing hibernate code that does this as it relies on
reflection and the classes don't exist yet).  this initial processing
component could be made configurable and one that generates the internal
structure from an existing database be written.

brad

> _______________________________
> brad clow
> chief technical officer
> workingmouse
> 
> email: [EMAIL PROTECTED]
> web:   http://www.workingmouse.com
> 

_______________________________________________
Hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Reply via email to