English 中文(简体)
在创建解放实体时,我们是否需要始终给予宽恕? 即使我从某种角度看正在建立一个实体?
原标题:do we need to an id always while creating a hibernate entity? even if I am creating an entity from a view?
  • 时间:2011-10-20 13:39:32
  •  标签:
  • hibernate

I am using MySQL 5.5 and hibernate 3. I have created a view in my database and also created an entity corresponding to it using salto db generator. When I try to execute my code the bean creation for session factory fails giving me the following error

org. Cerframework.beans.sisy.BeanCreationException: Error Creat bean with name SessionFactory defined in cell pathresource [persistence-context.xml]: 援引惯用法失败;nes例外是org.hibernate。 AnnotationException: No identification specified for entities: com.viewer.commonentity.ViewEntity

因此,我问,我们是否需要建立实体的主要关键?

最佳回答

是的,每个实体都需要补贴。 不管怎样,它都没有被描绘成观点。 或许在你看来,可以将一些栏目(复合钥匙)合并为id?

问题回答

暂无回答




相关问题
Multiple Hibernate instances using C3P0

I am facing a weird problem and it seems to be c3p0 related. I am starting two instances of an app in the same java vm which interact with each other. After some operations "APPARENT DEADLOCK" ...

Hibernate vs Ibatis caching

We can speed up a hibernate app easyly with 2nd level cache using infinispan or ehcache/terracotta,... but ibatis only have a simple interface to implement for caching. And hibernate knows more ...

Using annotations to implement a static join in hibernate

I m relatively new to hibernate and was wondering if someone could help me out. While I have no issues implementing a normal join on multiple columns in hibernate using the @JoinColumns tag, I m ...

Hibernate query with fetch question

I have a 2 entities in a One-To-Many relationship: OfficeView.java: public class OfficeView implements java.io.Serializable { private Integer officeId; private String addr1; private ...

hibernate interceptors : afterTransactionCompletion

I wrote a Hibernate interceptor : public class MyInterceptor extends EmptyInterceptor { private boolean isCanal=false; public boolean onSave(Object entity, Serializable arg1, Object[] arg2, String[]...

How to prevent JPA from rolling back transaction?

Methods invoked: 1. Struts Action 2. Service class method (annotated by @Transactional) 3. Xfire webservice call Everything including struts (DelegatingActionProxy) and transactions is configured ...

Hibernate/GORM: collection was not processed by flush()

I have an integration test in my Grails application that fails when I try to save an entity of type Member invitingMember.save(flush: true) This raises the following exception org.hibernate....

Hibernate Criteria API equivalent for "elements()"

Is it possible to implement the following query using Criteria API? select order from ORDER as order,ITEM as item where item.itemID like ITM_01 and item in elements(order.items)

热门标签