Skip to content

How to solve Error when save Entity with List

I have next Entity(List was added with last update):

@Table(name = "settings", schema = "notpublic")
public class Settings {

    @GeneratedValue(generator = "settings_seq", strategy = GenerationType.SEQUENCE)
    @SequenceGenerator(name = "settings_seq", sequenceName = "notpublic.settings_seq", schema = "notpublic", allocationSize = 1)
    private Long id;
    private String code;
    @CollectionTable(name = "settings_bank", joinColumns = { @JoinColumn(name = "id") })
    @Column(name = "bank_id")
    private List<Long> bankIds;

And liquibase update:

<createTable tableName="settings_bank" schemaName="notpublic">
            <column name="id" type="BIGINT">
                <constraints nullable="false"/>
            <column name="bank_id" type="BIGINT">
                <constraints nullable="false"/>

Well, when I try to save entity I get rg.postgresql.util.PSQLException: ERROR: relation “settings_bank” does not exist. I connect to DB by pgAdmin and- table was created.. List bankIds- just Long, its not connect to another Entity. What I missed and how to fix it?



I solve it, forget schema in @CollectionTable