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 |
From: <no...@at...> - 2005-07-06 20:54:02
|
The following issue has been updated: Updater: Emmanuel Bernard (mailto:emm...@hi...) Date: Wed, 6 Jul 2005 3:53 PM Changes: Component changed to binder --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/browse/ANN-7?page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/ANN-7 Here is an overview of the issue: --------------------------------------------------------------------- Key: ANN-7 Summary: @IndexColumn does not result in valid index column Type: Bug Status: Unassigned Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate Annotations Components: binder Versions: 3.1beta3 Assignee: Reporter: Ronald Wildenberg Created: Thu, 30 Jun 2005 10:50 AM Updated: Wed, 6 Jul 2005 3:53 PM 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 |
From: <no...@at...> - 2005-07-06 22:58:59
|
Message: The following issue has been closed. Resolver: Emmanuel Bernard Date: Wed, 6 Jul 2005 5:58 PM Use @OneToMany wo mappedBy and @ManyToOne @JoinColumn(insertable=false, updatable=false) --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/ANN-7 Here is an overview of the issue: --------------------------------------------------------------------- Key: ANN-7 Summary: @IndexColumn does not result in valid index column Type: Bug Status: Closed Priority: Major Resolution: REJECTED Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate Annotations Components: binder Versions: 3.1beta3 Assignee: Reporter: Ronald Wildenberg Created: Thu, 30 Jun 2005 10:50 AM Updated: Wed, 6 Jul 2005 5:58 PM 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 |
From: <no...@at...> - 2005-07-07 07:52:59
|
The following comment has been added to this issue: Author: Ronald Wildenberg Created: Thu, 7 Jul 2005 2:51 AM Body: Well, if I use @JoinColumn(insertable = false, updatable = false), my foreign key is never written to the database and this violates the null constraint I have on it (@ManyToOne(optional = false)). Removing the mappedBy attribute works, but then I get the additional join table between table a and table b. --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/ANN-7?page=comments#action_18693 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/ANN-7 Here is an overview of the issue: --------------------------------------------------------------------- Key: ANN-7 Summary: @IndexColumn does not result in valid index column Type: Bug Status: Closed Priority: Major Resolution: REJECTED Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate Annotations Components: binder Versions: 3.1beta3 Assignee: Reporter: Ronald Wildenberg Created: Thu, 30 Jun 2005 10:50 AM Updated: Thu, 7 Jul 2005 2:51 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 |
From: James C. (JIRA) <no...@at...> - 2006-07-13 12:45:08
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-7?page=comments#action_23619 ] James Carman commented on ANN-7: -------------------------------- Why was this issue closed without fixing the problem? This is not an obvious solution. I was working for hours trying to figure out why my index column of my list property was not getting inserted (the generated insert sql doesn't even have the index column in it). This should be reopened and addressed. > @IndexColumn does not result in valid index column > -------------------------------------------------- > > Key: ANN-7 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-7 > Project: Hibernate Annotations > Type: Bug > Components: binder > Versions: 3.1beta3 > Environment: Hibernate 3.0.5, Hibernate Annotations 3.0 beta2 preview, HSQL DB > Reporter: Ronald Wildenberg > > > 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. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Guido L. (JIRA) <no...@at...> - 2006-07-24 20:32:18
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-7?page=comments#action_23748 ] Guido Laures commented on ANN-7: -------------------------------- I agree with James and Ronald. I finally manged to get an indexed list persisted by removing the mappedBy attribute. Before this the index column was NULL permanently. But it is not correctly implemented as every indexed one-to-many association seems to result in a cross reference table, which is not necessary and produces unnessecary updates during insert. Please fix this. > @IndexColumn does not result in valid index column > -------------------------------------------------- > > Key: ANN-7 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-7 > Project: Hibernate Annotations > Type: Bug > Components: binder > Versions: 3.1beta3 > Environment: Hibernate 3.0.5, Hibernate Annotations 3.0 beta2 preview, HSQL DB > Reporter: Ronald Wildenberg > > > 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. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Christian B. (JIRA) <no...@at...> - 2006-07-24 21:37:14
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-7?page=all ] Christian Bauer reopened ANN-7: ------------------------------- Assign To: Emmanuel Bernard An example of this needs to be added to the HAN reference documentation that also explains why there is no other way to do it. > @IndexColumn does not result in valid index column > -------------------------------------------------- > > Key: ANN-7 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-7 > Project: Hibernate Annotations > Type: Bug > Components: binder > Versions: 3.1beta3 > Environment: Hibernate 3.0.5, Hibernate Annotations 3.0 beta2 preview, HSQL DB > Reporter: Ronald Wildenberg > Assignee: Emmanuel Bernard > > > 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. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Christian B. (JIRA) <no...@at...> - 2006-07-24 21:39:14
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-7?page=all ] Christian Bauer updated ANN-7: ------------------------------ Summary: Document usage of @IndexColumn in one-to-many with indexed collection (was: @IndexColumn does not result in valid index column) type: Improvement (was: Bug) Version: 3.2.0.cr1 (was: 3.1beta3) Priority: Minor (was: Major) > Document usage of @IndexColumn in one-to-many with indexed collection > --------------------------------------------------------------------- > > Key: ANN-7 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-7 > Project: Hibernate Annotations > Type: Improvement > Components: binder > Versions: 3.2.0.cr1 > Environment: Hibernate 3.0.5, Hibernate Annotations 3.0 beta2 preview, HSQL DB > Reporter: Ronald Wildenberg > Assignee: Emmanuel Bernard > Priority: Minor > > > 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. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-07-24 21:39:15
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-7?page=comments#action_23752 ] Emmanuel Bernard commented on ANN-7: ------------------------------------ http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#collections-indexedbidirectional > Document usage of @IndexColumn in one-to-many with indexed collection > --------------------------------------------------------------------- > > Key: ANN-7 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-7 > Project: Hibernate Annotations > Type: Improvement > Components: binder > Versions: 3.2.0.cr1 > Environment: Hibernate 3.0.5, Hibernate Annotations 3.0 beta2 preview, HSQL DB > Reporter: Ronald Wildenberg > Assignee: Emmanuel Bernard > Priority: Minor > > > 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. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-07-24 21:41:13
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-7?page=comments#action_23753 ] Emmanuel Bernard commented on ANN-7: ------------------------------------ yes, but more generally, this means that people do not read HAN reference guide on top of Core ref guide but rather instead of. adapt the annotations reference guide will require a lot of work > Document usage of @IndexColumn in one-to-many with indexed collection > --------------------------------------------------------------------- > > Key: ANN-7 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-7 > Project: Hibernate Annotations > Type: Improvement > Components: binder > Versions: 3.2.0.cr1 > Environment: Hibernate 3.0.5, Hibernate Annotations 3.0 beta2 preview, HSQL DB > Reporter: Ronald Wildenberg > Assignee: Emmanuel Bernard > Priority: Minor > > > 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. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Christian B. (JIRA) <no...@at...> - 2006-07-24 23:42:13
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-7?page=comments#action_23754 ] Christian Bauer commented on ANN-7: ----------------------------------- That was one of the problems we knew would happen with modularization. For now the best we can do is trying to find the most important issues (all over again) and to add at least references. Later on (in a year or so) we might be able to merge the documentation. > Document usage of @IndexColumn in one-to-many with indexed collection > --------------------------------------------------------------------- > > Key: ANN-7 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-7 > Project: Hibernate Annotations > Type: Improvement > Components: binder > Versions: 3.2.0.cr1 > Environment: Hibernate 3.0.5, Hibernate Annotations 3.0 beta2 preview, HSQL DB > Reporter: Ronald Wildenberg > Assignee: Emmanuel Bernard > Priority: Minor > > > 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. -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira |