Here is excerpt for the collection-descriptor :

  <collection-descriptor
       name="bx"
       collection-class="org.apache.ojb.broker.util.collections.ManageableArrayList"
       element-class-ref="br.com.mgr.b.f.Bx"
       indirection-table="RL_C_BX"
       proxy="true"
       auto-update="true"
       auto-delete="true">
     <fk-pointing-to-this-class column="CC"/>
     <fk-pointing-to-this-class column="CH"/>
     <fk-pointing-to-element-class column="T"/>
     <fk-pointing-to-element-class column="P"/>
     <fk-pointing-to-element-class column="BX"/>
  </collection-descriptor>

As you can see, the fk-pointing-to-this-class uses 2 fields, and the 
fk-pointing-to-element-class uses 3 fields.

I don't have a test case (but I think armin has one). The collection-descriptor I show 
here was takes directly from my production code.


Best regards,

Edson Richter

  ----- Original Message ----- 
  From: Jakob Braeuchi 
  To: OJB Users List 
  Sent: Wednesday, March 24, 2004 3:25 PM
  Subject: Re: 
MtoNCollectionPrefetcher.buildPrefetchCriteriaMultipleKeys(MtoNCollectionPrefetcher.java:338)


  hi armin, edson,

  it looks like the number of pk-fields and the number of columns in the 
  indirection table pointing to the m-side class are not the same.

  could you please send me the testcase ?

  jakob

  Armin Waibel wrote:

  > Hi Edson,
  > 
  > I have the same problem here is my stack trace
  > 
  > java.lang.ArrayIndexOutOfBoundsException: 1
  >     at 
  > 
org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.buildPrefetchCriteriaMultipleKeys(MtoNCollectionPrefetcher.java:338)
 
  > 
  >     at 
  > 
org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.buildPrefetchCriteria(MtoNCollectionPrefetcher.java:259)
 
  > 
  >     at 
  > 
org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.buildPrefetchQuery(MtoNCollectionPrefetcher.java:115)
 
  > 
  >     at 
  > 
org.apache.ojb.broker.accesslayer.CollectionPrefetcher.buildPrefetchQueries(CollectionPrefetcher.java:93)
 
  > 
  > 
  > seems the both are the same. I implemented a test case for the problem, 
  > but I'm currently working on the auto-xxx stuff so I can't send much 
  > time for that - put this on my imaginary todo-list for 1.0 ;-)
  > 
  > regards,
  > Armin
  > 
  > 
  > Edson Carlos Ericksson Richter wrote:
  > 
  >> This bug is driving me crazy... Someone could point me what changed 
  >> from rc5
  >> to 1.0 in this method (so I can at least fix locally)?
  >>
  >> The problem is a M:N mapping using composite pk pointing the M bean, 
  >> and 1
  >> field pk pointing to the N bean.
  >> The stack trace is:
  >>
  >> java.lang.ArrayIndexOutOfBoundsException: 1
  >>         at
  >> org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.buildPrefetchCrit 
  >>
  >> eriaMultipleKeys(MtoNCollectionPrefetcher.java:338)
  >>         at
  >> org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.buildPrefetchCrit 
  >>
  >> eria(MtoNCollectionPrefetcher.java:259)
  >>         at
  >> org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.buildPrefetchQuer 
  >>
  >> y(MtoNCollectionPrefetcher.java:115)
  >>         at
  >> org.apache.ojb.broker.accesslayer.CollectionPrefetcher.buildPrefetchQueries( 
  >>
  >> CollectionPrefetcher.java:93)
  >>         at
  >> org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.prefetchRelations 
  >>
  >> hip(MtoNCollectionPrefetcher.java:68)
  >>         at
  >> org.apache.ojb.broker.core.QueryReferenceBroker.performRetrievalTasks(QueryR 
  >>
  >> eferenceBroker.java:277)
  >>         at
  >> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryRe 
  >>
  >> ferenceBroker.java:146)
  >>         at
  >> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryRe 
  >>
  >> ferenceBroker.java:203)
  >>         at
  >> org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Persis 
  >>
  >> tenceBrokerImpl.java:1046)
  >>         at
  >> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery( 
  >>
  >> DelegatingPersistenceBroker.java:321)
  >>         at
  >> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery( 
  >>
  >> DelegatingPersistenceBroker.java:321)
  >>         at
  >> org.apache.ojb.broker.accesslayer.CollectionProxy.loadData(CollectionProxy.j 
  >>
  >> ava:109)
  >>         at
  >> org.apache.ojb.broker.accesslayer.ListProxy.loadData(ListProxy.java:148)
  >>         at
  >> org.apache.ojb.broker.accesslayer.CollectionProxy.getData(CollectionProxy.ja 
  >>
  >> va:362)
  >>         at
  >> org.apache.ojb.broker.accesslayer.ListProxy.getListData(ListProxy.java:140) 
  >>
  >>         at
  >> org.apache.ojb.broker.accesslayer.ListProxy.get(ListProxy.java:71)
  >>         at
  >> br.com.mgr.dialogs.ListBasedListModel.getElementAt(ListBasedListModel.java:6 
  >>
  >> 3)
  >>         at
  >> javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1147) 
  >>
  >>         at
  >> javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1 
  >>
  >> 098)
  >>         at
  >> javax.swing.plaf.basic.BasicListUI.getPreferredSize(BasicListUI.java:281)
  >>         at javax.swing.JComponent.getPreferredSize(JComponent.java:1275)
  >>         at
  >> javax.swing.JList.getPreferredScrollableViewportSize(JList.java:1913)
  >>         at
  >> javax.swing.ViewportLayout.preferredLayoutSize(ViewportLayout.java:72)
  >>         at java.awt.Container.preferredSize(Container.java:1178)
  >>         at java.awt.Container.getPreferredSize(Container.java:1162)
  >>         at javax.swing.JComponent.getPreferredSize(JComponent.java:1277)
  >>         at
  >> javax.swing.ScrollPaneLayout.preferredLayoutSize(ScrollPaneLayout.java:475) 
  >>
  >>         at java.awt.Container.preferredSize(Container.java:1178)
  >>         at java.awt.Container.getPreferredSize(Container.java:1162)
  >>         at javax.swing.JComponent.getPreferredSize(JComponent.java:1277)
  >>         at 
  >> java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:572)
  >>         at java.awt.Container.preferredSize(Container.java:1178)
  >>         at java.awt.Container.getPreferredSize(Container.java:1162)
  >>         at javax.swing.JComponent.getPreferredSize(JComponent.java:1277)
  >>         at
  >> javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout.calculateSize(Basi 
  >>
  >> cTabbedPaneUI.java:2001)
  >>         at
  >> javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout.preferredLayoutSiz 
  >>
  >> e(BasicTabbedPaneUI.java:1975)
  >>         at java.awt.Container.preferredSize(Container.java:1178)
  >>         at java.awt.Container.getPreferredSize(Container.java:1162)
  >>         at javax.swing.JComponent.getPreferredSize(JComponent.java:1277)
  >>         at java.awt.GridBagLayout.GetLayoutInfo(GridBagLayout.java:892)
  >>         at java.awt.GridBagLayout.getLayoutInfo(GridBagLayout.java:806)
  >>         at java.awt.GridBagLayout.ArrangeGrid(GridBagLayout.java:1374)
  >>         at java.awt.GridBagLayout.arrangeGrid(GridBagLayout.java:1337)
  >>         at java.awt.GridBagLayout.layoutContainer(GridBagLayout.java:706)
  >>         at java.awt.Container.layout(Container.java:1020)
  >>         at java.awt.Container.doLayout(Container.java:1010)
  >>         at java.awt.Container.validateTree(Container.java:1092)
  >>         at java.awt.Container.validateTree(Container.java:1099)
  >>         at java.awt.Container.validateTree(Container.java:1099)
  >>         at java.awt.Container.validateTree(Container.java:1099)
  >>         at java.awt.Container.validate(Container.java:1067)
  >>         at
  >> javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:353 
  >>
  >> )
  >>         at
  >> javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQu 
  >>
  >> eueUtilities.java:116)
  >>         at 
  >> java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
  >>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
  >>         at
  >> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja 
  >>
  >> va:201)
  >>         at
  >> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java 
  >>
  >> :151)
  >>         at
  >> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
  >>         at
  >> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
  >>         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
  >>
  >>
  >>
  >> Thanks,
  >>
  >> Edson Richter
  >>
  >>
  >>
  >> ---
  >> Outgoing mail is certified Virus Free.
  >> Checked by AVG anti-virus system (http://www.grisoft.com).
  >> Version: 6.0.637 / Virus Database: 408 - Release Date: 20/3/2004
  > 
  > 
  > ---------------------------------------------------------------------
  > To unsubscribe, e-mail: [EMAIL PROTECTED]
  > For additional commands, e-mail: [EMAIL PROTECTED]
  > 
  > 

  ---------------------------------------------------------------------
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]



  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.637 / Virus Database: 408 - Release Date: 20/3/2004

Reply via email to