Code:
org.postgresql.util.PSQLException: ERROR: relation "hibernate_sequence" does not exist
Position: 17
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
......
I got this exception trying execute (persist) the below code snippets:
Code:
@Entity
@Table(name = "users")
public class User {
private Long id;
private Set<String> roles = new HashSet<String>();
@Id
@GeneratedValue()
public Integer getId() {
return id;
}
// more getters & setters
@CollectionOfElements(targetElement = java.lang.String.class)
@JoinTable(name = "user_roles", joinColumns = @JoinColumn(name = "user_id"))
@Column(name = "role")
public Set<String> getRoles() {
return roles;
}
...
Postgres tables are:
1- users (id, ...)
2- user_roles(user_id, role)