JPA entity has no primary key?

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

    I had this problem as well with a message without PK.

    In Oracle, you can use the ROWID column which is always there for any table.

    Like this:

    @Id
    @Column(name="ROWID")
    String rowid;
    

    Hope it helps...

提交回复
热议问题