Hello...
I'm sorry for my English... =))
Have a problem. Possible it's a Hibernate error:
... I'm using DataBase FireBird (Dialect 3). I'm using a lowcase latters for naming columns... Name of column put (enclose) into quotes ( for example "role_id").
In Java I'm writing: (for example
"\"atn_rule\""):
Code:
@Entity (access = AccessType.FIELD)
@Table (name = "\"atn_rule\"")
@SequenceGenerator (name = "rule.id", sequenceName = "\"rule_id_g\"")
public class Rule implements Serializable {
private static final long serialVersionUID = 7418346480207570210L;
@Id (generate = GeneratorType.SEQUENCE, generator = "rule.id")
@Column (name = "\"id\"")
private Integer id;
@ManyToMany (fetch = FetchType.LAZY)
@JoinTable (
table = @Table (name = "\"atn_principal_permission\""),
joinColumns = @JoinColumn (
name = "\"rule_id\"",
referencedColumnName = "id"
),
inverseJoinColumns = @JoinColumn (
name = "\"principal_id\"",
referencedColumnName = "id"
)
)
private List<Role> roles;
}
Code:
@Entity (access = AccessType.FIELD)
@Table (name ="\"atn_principal\"")
@SequenceGenerator (name = "principal.id", sequenceName = "\"principal_id_g\"")
public class Role extends AbstractEntity implements Serializable {
private static final long serialVersionUID = -8655514511640110474L;
@Id (generate = GeneratorType.SEQUENCE, generator = "principal.id")
@Column (name = "\"id\"")
private Integer id;
@ManyToMany (mappedBy = "roles")
private List<Rule> rules;
}
After execution this:
role.rules FireBird send error:
SQL error code = -206
Column unknown
RULES0_.RULE_ID
i.e. instead of RULES0_."rule_id" name of column change to upper case. However
rule.roles have no errors.
Have any ideas?
What I need to do for "Hibernate developer" correct this mistake (error)?