Hibernate Envers @ElementCollection on List java -
i want use @elementcollection on set of type list, this:
@elementcollection @collectiontable(name = "my_product", joincolumns = @joincolumn(name = "id_product")) private list<my_product> products = new arraylist<>();
after that, see hibernate generates following script sql:
create table hist_my_product ( rev number(10,0) not null, revtype number(3,0) not null, id_product number(19,0) not null, price number(10,0), primary key (rev, revtype, id_product) );
and if use set of type set, this:
@elementcollection @collectiontable(name = "my_product", joincolumns = @joincolumn(name = "id_product")) private set<my_product> products = new linkedhashset<>();
hibernate generates following script sql:
create table hist_my_product ( rev number(10,0) not null, revtype number(3,0) not null, id_product number(19,0) not null, setordinal number(10,0) not null, price number(10,0), primary key (rev, revtype, id_product, setordinal) );
so, see aditional field "setordinal" set of type set , not type list.
could explain case ? not change list fields set.
thanks in advance response.
Comments
Post a Comment