From: <no...@at...> - 2005-06-30 15:52:04
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/EJB-22 Here is an overview of the issue: --------------------------------------------------------------------- Key: EJB-22 Summary: @IndexColumn does not result in valid index column Type: Bug Status: Unassigned Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: EJB 3.0 Assignee: Reporter: Ronald Wildenberg Created: Thu, 30 Jun 2005 10:50 AM Updated: Thu, 30 Jun 2005 10:50 AM Environment: Hibernate 3.0.5, Hibernate Annotations 3.0 beta2 preview, HSQL DB Description: I have a mapping for a List that does not result in the index column of the database table to be filled. @Entity public class A { @OneToMany(mappedBy = "a") @Cascade(value = CascadeType.SAVE_UPDATE) @IndexColumn(name = "index", base = 0) public List<B> getBs() { return bs; } public void setBs(List<B> bs) { this.bs = bs; } } @Entity public class B { @ManyToOne(optional = false) @JoinColumn(name = "a_id") public A getA() { return a; } public void setA(A a) { this.a = a; } } Using this mapping, the 'index' column for table B is never filled if I add B objects to A and save them. The weird thing is, if I change the mapping for getBs to the following: @OneToMany @Cascade(value = CascadeType.SAVE_UPDATE) @IndexColumn(name = "index", base = 0) an association table is created with columns a_id, b_id, index. The only change I made is removing the mappedBy attribute. This association table is not necessary, since an index column can be added to table B. --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |