开发者

Unknown entity problem in Hibernate with AnnotationConfiguration

I've been googling for this problem 开发者_开发技巧from last 2 days but havent found any proper solution. I am developing a desktop application with Hibernate. I am using AnnotationConfiguration for registering entities in hibernate. I am not creating xml mapping files as I am using persistence type entity beans. I've tried it with configuration xml file, properties file, programmatic registration of entity beans, but every time i am getting the same exception. I've checked the entity class. Its importing javax.persistence.Entity; I've also tried adding @org.hibernate.annotations.Entity(mutable=true, dynamicInsert=true, dynamicUpdate=true) but no success.

When I pass incorrect path of one of the entity bean, hibernate initialization fails, which means before changing path, hibernate was picking up a correct entity file.

Is there any way to get a list of registered entities in hibernate configuration?


Have you declared the entities inside Your hibernate.cfg.xml file?

example:

<mapping class="test.User"/>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜