org.hibernate.MappingException: Type not supported for auditing: org.hibernate.type.IdentifierBagType
Description
Attachments
1
- 10 Jun 2009, 10:41 AM
Activity
Show:
Lukasz Antoniak February 22, 2013 at 11:55 PM
Adding support for @CollectionId
is a part of pull request #255 (https://github.com/hibernate/hibernate-orm/pull/255).
Out of Date
Assignee
Unassigned
UnassignedReporter
David Coleman
David ColemanComponents
Affects versions
Priority
Created June 10, 2009 at 10:41 AM
Updated December 19, 2013 at 9:47 PM
Resolved December 19, 2013 at 9:47 PM
Hi,
I currenty have a problem with auditing a many-many relation in the entity show below. Initially I had the exact same problem as ´http://opensource.atlassian.com/projects/hibernate/browse/HHH-3843´' but on reading the documentation and releazing that the list contains duplicate elements, I add (as suggested) a @CollectionId annotation to get bag semantics.
Hoewever, the seam application fails to start-up due to the error being thrown from the envers module: "type not supported for auditing: org.hibernate.type.IdentifierBagType, on entity com.baratz.absys2.core.model.api.User, property 'roles'." (stack trace attached)
<snippet>
@Entity
@Audited
@Table(name = "USER_ABSYS")
public class User {
@UserRoles
@ManyToMany
@JoinTable(name = "USER_ROLE",
joinColumns = @JoinColumn(name = "UUNSEQ",unique=false) ,
inverseJoinColumns = @JoinColumn(name = "ROLE_ID",unique=false))
@TableGenerator(name = "UserRolesGen", table = "ABSYS_SEQUENCE", pkColumnName = "ID_NAME", valueColumnName = "NEXT_VAL", pkColumnValue = "USER_ROLE_ID_GEN", allocationSize=1)
@CollectionId(
columns = @Column(name="USER_ROLE_IDX"),
type=@Type(type="long"),
generator="UserRolesGen"
)
public List<Role> getRoles() {
return roles;
}
...
}
</snippet>
Regards,
Dave