Middlegen is a timesave. Although it’s not the perfect solution to generate Hibernate mapping files and hence POJOs, yet, it saved me a lot of time.
I was about to quit playing with it as it wouldn’t read foreign key names with the exception: `java.lang.IllegalArgumentException: There is no column named
in the table named` It seemed that Middlegen was reading the DB2 AS/400-assigned Foreign Key short table names (
_00001) and not the long names (). I doubt the reason is because of discrepancies in DB2/400 (again:I hate DB2/400). Anyway, after the folks here decided to go with short table names (because of other reasons) everything went fine. For those of you who want to generate Hibernate mapping files and POJOs from an existing database, here's a SIMPLE middlegen build file (other than the long build sample file supplied with middlegen solution):(Running first middlegen, then hbm2java)Now, I'd love to see the following improvements on middlegen; Ability to configure custom id generators. (I now have to run an ant task that replaces the “assigned” id generator with my custom one). Resolving the issue of strange generated property names when having multiple fields referencing the same table as a foreign key (dual foreign keys) (I have to replace them by hand so far) Improvements on the UI when having more than 10 tables (it's like hell when you're having 50+ ones). Any other improvements would be fine (looks like middlegen development is coming to a stop)