0

I’ve created a PostgreSql database and configured Hibernate. Now I have problem with naming of columns.

In the table „users” I have a column „role_id”.

After that, I’ve created entity in Java:

    @Basic
    @Column(name = "role_id")
    public long getRoleId() {return roleId;}
    public void setRoleId(long roleId) {this.roleId = roleId; }

And then I get error:

ERROR: column "roleid" of relation "users" does not exist

Why in Error name of column is „roleid”, if I specified that column as „role_id”. In another table, where all column names are without underscores, all works perfect.

Thanks

user2783755
  • 578
  • 2
  • 10
  • 26
  • Hibernate version? Are you sure you're running the current build of your code, i.e. the code matches the binaries? – Craig Ringer Sep 18 '14 at 14:27
  • I experimented with this naming, so it’s works, when I renamed field to role_Id (getRole_Id, setRole_Id). This anotation @Column(name = "role_id") doesn't affect anything, I can change it to @Column(name = "blablabla"), and all works fine… Please help. – user2783755 Sep 19 '14 at 06:42

0 Answers0