JPA entity has no primary key?

前端 未结 5 766
灰色年华
灰色年华 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:22

    Another way would be specify that the class itself can be used as unique identifier with @IdClass. So in this case just annotate the class with @IdClass(CmcMapServerInfo.class) and it should be independent of underlying database.

提交回复
热议问题