Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Cannot add an item to a HibernatePersistableEList
[Teneo] Cannot add an item to a HibernatePersistableEList [message #603925] Thu, 29 March 2007 08:48
Markus Bischof is currently offline Markus BischofFriend
Messages: 72
Registered: July 2009
Member
This is a multi-part message in MIME format.

------=_NextPart_000_0023_01C771EF.D2F03AF0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi!

I've managed to load and save HibernateResource-Objects, but now I want =
to add some items to that resource using an AddCommand =
(org.eclipse.emf.edit.command.AddCommand), which calls (in my case) the =
method "addAll(collection)" of the HibernatePersistableEList-object =
(ownerList) (line 400). The "collection" contains only one object. This =
method runs until the call "notifications =3D inverseAdd(value, =
notifications)" (line 439) which throws an exception.

After some debugging I found the error in the BasicEObjectImpl.class of =
the one object contained in the "collection". It calls =
"newResource.attached(this)" in line 912 (newResource is a =
HibernateResource) which then calls the =
"eObject.eContainmentFeature()"-method. This method runs until line 459, =
460 an then tries to execute the following code:

FeatureMap featureMap =3D (FeatureMap)eContainer.eGet(eFeature);
for (int i =3D 0, size =3D featureMap.size(); i < size; ++i) {...}

But in my case, the method eContainer.eGet(eFeature) returns null or a =
string-object, but in no case a FeatureMap. (More information: eFeature =
is an EAttributeImpl-class and has as name "name", which means that the =
name of the eContainer should be resolved, at least I think so!)

Do I have to change my implementation so that it returns some FeatureMap =
(I actually don't know what that map should contain!) or is there =
something wrong with the HibernatePersistableEList-object?

I hope this is not too technical!

Markus Bischof
------=_NextPart_000_0023_01C771EF.D2F03AF0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16414" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff background=3D"">
<DIV><FONT face=3DArial size=3D2>Hi!<BR><BR>I've managed to load and =
save=20
HibernateResource-Objects, but now I want to add some items to that =
resource=20
using an AddCommand (org.eclipse.emf.edit.command.AddCommand), which =
calls (in=20
my case) the method "addAll(collection)" of the =
HibernatePersistableEList-object=20
(ownerList) (line 400). The "collection" contains only one object. This =
method=20
runs until the call "</FONT><FONT face=3DArial size=3D2>notifications =
=3D=20
inverseAdd(value, notifications)" (line 439) which throws an=20
exception.</FONT><BR><BR><FONT face=3DArial size=3D2>After some =
debugging I found=20
the error in the BasicEObjectImpl.class of the one object contained in =
the=20
"collection". It calls "newResource.attached(this)" in line 912 =
(newResource is=20
a HibernateResource) which then calls the=20
"eObject.eContainmentFeature()"-method. This method runs until line 459, =
460 an=20
then tries to execute the following code:<BR><BR>FeatureMap featureMap =
=3D=20
(FeatureMap)eContainer.eGet(eFeature);<BR>for (int i =3D 0, size =3D=20
featureMap.size(); i &lt; size; ++i) {...}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>But in my case, the method=20
eContainer.eGet(eFeature) returns null or a string-object, but in no =
case a=20
FeatureMap. (More information: eFeature is an EAttributeImpl-class and =
has as=20
name "name", which means that the name of the eContainer should be =
resolved, at=20
least I think so!)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Do I have to change my implementation =
so that it=20
returns some FeatureMap (I actually don't know what that map should =
contain!) or=20
is there something wrong with the =
HibernatePersistableEList-object?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I hope this is not too =
technical!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Markus =
Bischof</FONT></DIV></BODY></HTML>

------=_NextPart_000_0023_01C771EF.D2F03AF0--
Previous Topic:Remove whitespaces from generation
Next Topic:[Teneo] Properties from subclass added as not null to superclass table.
Goto Forum:
  


Current Time: Tue Oct 20 09:13:21 GMT 2020

Powered by FUDForum. Page generated in 0.02070 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top