JPA entity without id

前端 未结 5 967
死守一世寂寞
死守一世寂寞 2020-11-30 22:38

I have a database with the following structure:

CREATE TABLE entity (
    id SERIAL,
    name VARCHAR(255),
    PRIMARY KEY (id)
);

CREATE TABLE entity_prop         


        
5条回答
  •  萌比男神i
    2020-11-30 22:46

    I guess you can use @CollectionOfElements (for hibernate/jpa 1) / @ElementCollection (jpa 2) to map a collection of "entity properties" to a List in entity.

    You can create the EntityProperty type and annotate it with @Embeddable

提交回复
热议问题