[hibernate-issues] [Hibernate-JIRA] Assigned: (HHH-4962) @ManyToOne with @JoinTable fails
Gail Badner (JIRA)
noreply at atlassian.com
Thu Jan 5 03:28:13 EST 2012
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4962?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gail Badner reassigned HHH-4962:
--------------------------------
Assignee: Adam Warski
Please assign as appropriate.
> @ManyToOne with @JoinTable fails
> --------------------------------
>
> Key: HHH-4962
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4962
> Project: Hibernate Core
> Issue Type: Bug
> Components: envers
> Affects Versions: 3.3.2
> Reporter: Clint Popetz
> Assignee: Adam Warski
> Attachments: test.tar.gz
>
>
> $ cat src/main/java/test/User.java
> package test;
> import javax.persistence.*;
> import org.hibernate.envers.Audited;
> import java.util.Set;
> The below code fails with "org.hibernate.MappingException: Unable to read the mapped by attribute for widgets in test.User!" but is supported by JPA, at least under hibernate.
> @Entity
> @Audited
> public class User
> {
> @Id
> private long id;
> @OneToMany(mappedBy="user")
> private Set<Widget> widgets;
> }
> $ cat src/main/java/test/Widget.java
> package test;
> import javax.persistence.*;
> import org.hibernate.envers.Audited;
> @Entity
> @Audited
> public class Widget
> {
> @Id
> private long id;
> @ManyToOne(fetch=FetchType.LAZY)
> @JoinTable(name = "widget_to_user",
> joinColumns = @JoinColumn(name = "widget_id"),
> inverseJoinColumns = @JoinColumn(name = "user_id"))
> private User user;
> }
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list