开发者

How to get Hibernate object relations dynamically? [closed]

开发者 https://www.devze.com 2022-12-31 17:00 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

I'm using Hibernate and I need to f开发者_开发技巧ind a way of retrieving the relations for an object dynamically at run-time. I can't find this in the API.

Can anyone point me in the right direction?


My best recommendation is to use plain JDBC DatabaseMetaData

DatabaseMetaData.getCrossReference

DatabaseMetaData.getImportedKeys

DatabaseMetaData.getExportedKeys

Examples


What You look for is SessionFactory's getClassMetadata() method. It returns ClassMetadata object describing given entity.

0

精彩评论

暂无评论...
验证码 换一张
取 消