| [CDO Hibernate] Problem with containingClass of CDOFeatures [message #619082] |
Thu, 29 May 2008 15:17 |
Eclipse User |
|
|
|
Hi Eike, Martin,
I have an Ecore model composed of multiple packages and I have
cross-references between packages. For example:
Package pgk1:
Class A
Package pkg2:
Class B extends A
My problem arise when I read the packages from the database. I first
launch my server, populate the database with some data. Then I shutdown
the server, launch it again and I try to add data. When adding data, I
get an exception about cdoFeature.containingClass is null.
I've looked at the code and I know where the problem is, but I'm really
not sure what would be the ideal solution. The problem can be seen in
HibernatePackageHandler.readPackage(CDOPackage). This method first
loads the package, then goes through all the classes, then through all
the features and for each feature, its containingClass is set. The
problem I have is when pkg2 is read, the features contained in Class A
(also available in Class B by inheritance) and created by Hibernate, but
their containingClass attribute are never initialized. So the
features defined in Class B are fine, but not the ones in coming from
Class A. So when I try to persist an object of Class B, I get a
NullpointerException.
So what would be the ideal solution here? I was expecting to see each
CDOFeature being created only once (aren't they supposed to be unique?)
and not every time a package is read. Is it related only to
cross-package inheritance? If I put all of my classes under the same
package, everything works.
Thanks,
Eric
|
|
|
Powered by
FUDForum. Page generated in 0.11539 seconds