hibernate:在运行时创建实体(带注释) [英] hibernate: create Entity(with annotations) in runtime

查看:94
本文介绍了hibernate:在运行时创建实体(带注释)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在运行时创建hibernate实体类(带注释)?它应该与运行时添加的表相关。 Hibernate可以看到实体是非常重要的。
一般情况下是否可能,请问我可否就这个问题给我一些建议?
我明白,反思是关键词,但是会寻找更多的单词。
问候。

Is it possible to create hibernate Entity class(with annotations) during runtime? It should be related with the table that is also added in runtime. It is important that the Entity should be visible by the Hibernate. Is it possible in general, could you please give me any advices on the problem? I understand, that reflection is the keyword, but looking for some more words. Regards.

推荐答案

在这种情况下,您可能希望在运行时创建Hibernate Session Factory programatic,传入您创建的新映射,请查看 http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/session-configuration.html#configuration-programmatic 了解详情。

In This scenario, you might want to create the Hibernate Session Factory programatic on the run time , passing in the new mapping that you have created , have a look at http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/session-configuration.html#configuration-programmatic for details .

这篇关于hibernate:在运行时创建实体(带注释)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆