ArrayOutOfBoundsException: -14 [message #1012325] |
Thu, 21 February 2013 05:57  |
Eclipse User |
|
|
|
i've got an EClass with an EReference
in my database layer (hibernate) i extend the default EMF Class and add a function to map (my old database) to the EMF construct (old db has only one field, whereat the new db will have a list)
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
public Contact get__hbm__attendant() {
if (getMoreContacts().size() > 0) {
return getMoreContacts().get(0);
}
return null;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
public void set__hbm__attendant(Contact newContact) {
Contact oldContact = get__hbm__attendant();
if (newContact != null && !getMoreContacts().contains(newContact)) {
try {
getMoreContacts().add(newContact);
} catch (Exception e) {
System.err.println("the exception will be here");
e.printStackTrace();
}
}
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
FrameworkPackage.EXCURSION__MORE_CONTACTS, ldContact,
newContact));
}
this code looks correct to me, can you point me to my mistake? as the following exception gets raised:
java.lang.ArrayIndexOutOfBoundsException: -14
at org.eclipse.emf.ecore.impl.BasicEObjectImpl$EPropertiesHolderBaseImpl.dynamicGet(BasicEObjectImpl.java:159
)
at org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSettingDelegateMany.dynamicInverseRemove(EStruct
uralFeatureImpl.java:1775)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicInverseRemove(BasicEObjectImpl.java:1468)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eInverseRemove(BasicEObjectImpl.java:1457)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eInverseRemove(BasicEObjectImpl.java:1447)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eBasicRemoveFromContainer(BasicEObjectImpl.java:1396)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eInverseAdd(BasicEObjectImpl.java:1421)
at org.eclipse.emf.ecore.util.EcoreEList.inverseAdd(EcoreEList.java:292)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:318)
at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:307)
at framework.persistence.mssql.impl.MSSQLExcursionImpl.set__hbm__attendant(MSSQLExcursionImpl.java:61)
at framework.persistence.mssql.impl.MSSQLExcursionImpl$$BulkBeanByCGLIB$$dd08f4c6.setPropertyValues(<gener
ated>)
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:212)
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:185)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3232
)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2145)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1533)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at tests.test_real_classes.find(test_real_classes.java:139)
at tests.test_real_classes.test_excursion(test_real_classes.java:81)
at tests.test_real_classes.main(test_real_classes.java:67)
|
|
|
|
|
|
|
|
|
Re: ArrayOutOfBoundsException: -14 [message #1012835 is a reply to message #1012831] |
Fri, 22 February 2013 04:57  |
Eclipse User |
|
|
|
I'm sure if it's generating that, your model it instructing it to do that.
On 22/02/2013 10:51 AM, Ludwig Moser wrote:
> note: even when i regenerate the src its generating a
> EObjectContainmentEList instead of EObjectResolvingEList
|
|
|
Powered by
FUDForum. Page generated in 0.05459 seconds