"hibernate_sequence" does not exist

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: 

@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)

上一篇:浅谈Python爬虫(四)


下一篇:Ansible roles