Get all join tables managed by the SessionFactory
This is a continuation of a question I posed earlier.
Currently when I get all tables managed by the SessionFactory using the technique in the solution to my previous post, it (as expected) does not include any join tables. Is there an easy way to retrieve all join tables known to the SessionFactory or would I have to go through all Entity classes and reflectively find all @JoinTable 开发者_如何学Cannotations?
Here is howto
ClassMetadata cm = sessionFactory.getClassMetadata(className);
if (Joinable.class.isInstance(cm)) ...
精彩评论