SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: Problem with Hibernate3GpsDevice


Permlink Replies: 2 - Pages: 1 - Last Post: Jul 1, 2007 8:09 AM Last Post By: Shay Banon
Aleksei Valikov

Posts: 46
Registered: 3/6/06
Problem with Hibernate3GpsDevice
Posted: Jun 29, 2007 10:09 AM
  Click to reply to this thread Reply
Hi.

I am working on reindexing and experience a problem with Hibernate subclasses.

The problem is that some of my classes do not get reindexed.

I have started researching and found out that Compass incorrectly interprets Hibernate's subclassing hierarchy for inherited classes.

Compass wants to ignored inherited classes which have their superclasses mapped in Compass as well. This is correct.

To check if a class is inherited, Compass calls ClassMetadata.isInherited(). This is correct.

Then the following happens:

Class mappedClass = classMetadata.getMappedClass(EntityMode.POJO);
Class superClass = mappedClass.getSuperclass();

As a superclass, compass gets the superclass of the class. This is NOT correct. In Hibernate, class mappings often declare NOT their direct superclasses in "extends. For instance:

<subclass
name="de.disy.preludio2.nokis.record.model.impl.NokisMetadataRecord"
extends="de.disy.preludio2.base.record.model.impl.AbstractBaseRecord" lazy="false">...</subclass>

NokisMetadataRecord is NOT a direct subclass of AbstractBaseRecord.

Superclass should be retrieved from the mapping metadata as well.
I'll try to correct it and report back.

Bye.
/lexi

Aleksei Valikov

Posts: 46
Registered: 3/6/06
Re: Problem with Hibernate3GpsDevice
Posted: Jun 29, 2007 10:15 AM   in response to: Aleksei Valikov in response to: Aleksei Valikov
  Click to reply to this thread Reply
ps. AbstractEntityPersister.getMappedSuperclass() should be used instead. I don't understand why isn't this method in ClassMetadata.
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: Problem with Hibernate3GpsDevice
Posted: Jul 1, 2007 8:09 AM   in response to: Aleksei Valikov in response to: Aleksei Valikov
  Click to reply to this thread Reply
I fixed it ( CMP-427), by casting to Abstract... . Can you check the latest SNAPSHOT?
Legend
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums