reuse column name in JoinTable
------------------------------
Key: ANN-655
URL:
http://opensource.atlassian.com/projects/hibernate/browse/ANN-655
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.2.0.ga
Environment: JBoss Version: 4.0.5.GA
Hibernate-Version: 3.2.0.ga
Hibernate Annotations: 3.2.0.GA
Win XP
Mys SQL 5.015
Reporter: Francisco Philip
Hi, please forgive my english, but Im lost and I don't see if this is a bug or
limitation, but I can't reuse a column ina ManyToMany association.
This is important because the schema is implemented and I need evaluate de migration.
public class Context {
@Id String id;
@Column name;
}
public class Group {
@Id Context context;
@Id String id;
@Column name;
@ManyToMany
@JoinTable(
joinColumns = {
@JoinColumn(name = "context_id", referencedColumnName =
"context_id"),
@JoinColumn(name = "group_id", referencedColumnName =
"id")},
inverseJoinColumns = {
@JoinColumn(name = "context_id", referencedColumnName =
"context_id"),
@JoinColumn(name = "role_id", referencedColumnName =
"id")})
Set<Role> roles;
}
public class Role {
@Id Context context;
@Id String id;
@Column name;
}
Error: org.hibernate.MappingException: Repeated column in mapping for collection:
test.Group.roles column: context_id
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira