Hibernate Mapping Madness
Here's my wild and crazy idea, which'll only make sense to people who have used Hibernate. Why not extend MapGenerator to also read the source for the classes it examines (if available) and hunt out the XDoclet tags meant for the HibernateDoclet task?
This allows for at least two things:
- The graceful handling of abstract parent classes (I happen to like the way that MapGenerator deals with them)
- Give complete control over how the generated mapping does table and column names (which is why it's not advisable to use MapGenerator without faffing with the generated files)
The Hibernate XDoclet task has some known limitations (especially when handling composite keys) that I don't think that MapGenerator suffers from (though I could be wrong!)
In fact, it should be possible to write something like MapGenerator that relies on QDox to do all the analysis without having to compile the code at all or rely on reflection. Argh! If only there were time to do that!
Posted in: /computing /java
You may comment...