Bug 236109 - remove native query from entity-mappings throws exception
Summary: remove native query from entity-mappings throws exception
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-06 14:09 EDT by Karen Butzke CLA
Modified: 2008-08-21 16:49 EDT (History)
1 user (show)

See Also:
neil.hauge: review+


Attachments
proposed patch - HEAD (5.84 KB, patch)
2008-06-10 14:30 EDT, Karen Butzke CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2008-06-06 14:09:53 EDT
Select the EntityMappings node in the jpa structure view for an orm.xml file. Add a Named Native Query.  Remove the NamedNativeQuery from the source and you get an exception.  You can also get a similar exception sometimes removing it using the Details view 'Remove' button.  The same problem does not exist for NamedQueries

java.lang.IndexOutOfBoundsException: toIndex = 1
at java.util.SubList.<init>(AbstractList.java:705)
at java.util.RandomAccessSubList.<init>(AbstractList.java:861)
at java.util.AbstractList.subList(AbstractList.java:571)
at org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel.componentItemsRemoved(CompositeListValueModel.java:473)
at org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel$1.itemsRemoved(CompositeListValueModel.java:132)
at org.eclipse.jpt.utility.internal.model.ChangeSupport.fireItemsRemoved(ChangeSupport.java:1350)
at org.eclipse.jpt.utility.internal.model.ChangeSupport.fireItemsRemoved(ChangeSupport.java:1355)
at org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport.fireItemsRemoved(SingleAspectChangeSupport.java:212)
at org.eclipse.jpt.utility.internal.model.AbstractModel.fireItemsRemoved(AbstractModel.java:446)
at org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter.itemsRemoved(ListAspectAdapter.java:269)
at org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter$1.itemsRemoved(ListAspectAdapter.java:123)
at org.eclipse.jpt.utility.internal.model.ChangeSupport.fireItemRemoved(ChangeSupport.java:1439)
at org.eclipse.jpt.utility.internal.model.ChangeSupport.fireItemRemoved(ChangeSupport.java:1445)
at org.eclipse.jpt.utility.internal.model.AbstractModel.fireItemRemoved(AbstractModel.java:438)
at org.eclipse.jpt.utility.internal.model.AbstractModel.removeItemFromList(AbstractModel.java:612)
at org.eclipse.jpt.core.internal.context.orm.GenericEntityMappings.removeNamedNativeQuery_(GenericEntityMappings.java:462)
at org.eclipse.jpt.core.internal.context.orm.GenericEntityMappings.updateNamedNativeQueries(GenericEntityMappings.java:723)
at org.eclipse.jpt.core.internal.context.orm.GenericEntityMappings.update(GenericEntityMappings.java:575)
at org.eclipse.jpt.core.internal.context.orm.OrmXmlImpl.update(OrmXmlImpl.java:119)
Comment 1 Karen Butzke CLA 2008-06-10 14:30:42 EDT
Created attachment 104363 [details]
proposed patch - HEAD

This patch cleans up the property strings for named queries and named native queries
Comment 2 Karen Butzke CLA 2008-07-08 21:10:38 EDT
checked in to HEAD, haven't branched for 2.0.1 yet
Comment 3 Neil Hauge CLA 2008-08-21 16:49:20 EDT
Verified in wtp-sdk-R-3.0.1-20080818032401.