JPA entity has no primary key?

前端 未结 5 792
灰色年华
灰色年华 2020-12-16 13:36

I have an Entity class:

@Entity
@Table(name=\"CMC_MAP_SERVER_INFO\")
@NamedQuery(name=\"CmcMapServerInfo.getMapServer\", query=\"SELECT c FROM CmcMapServerIn         


        
5条回答
  •  甜味超标
    2020-12-16 14:12

    JPA 2.0 Specification

    • Entity class must be annotated with the Entity annotation.
    • Entity class must have a no-arg constructor.
    • Entity class must not be final
    • Entity class must implement the Serializable interfaces.
    • Entity class must have a unique, immutable ID

    Otherwise, you cannot.

提交回复
热议问题