Author: hardy.ferentschik
Date: 2008-11-26 08:50:03 -0500 (Wed, 26 Nov 2008)
New Revision: 15622
Modified:
search/trunk/src/java/org/hibernate/search/engine/DocumentBuilderContainedEntity.java
search/trunk/src/java/org/hibernate/search/engine/MultiClassesQueryLoader.java
Log:
HSEARCH-309
changed the semantics of DocumentBuildercontainedEntity.getMappedSubclasses() to only
return mapped subclasses.
Modified:
search/trunk/src/java/org/hibernate/search/engine/DocumentBuilderContainedEntity.java
===================================================================
---
search/trunk/src/java/org/hibernate/search/engine/DocumentBuilderContainedEntity.java 2008-11-26
13:17:23 UTC (rev 15621)
+++
search/trunk/src/java/org/hibernate/search/engine/DocumentBuilderContainedEntity.java 2008-11-26
13:50:03 UTC (rev 15622)
@@ -610,7 +610,7 @@
Set<Class<?>> tempMappedSubclasses = new HashSet<Class<?>>();
//together with the caller this creates a o(2), but I think it's still faster than
create the up hierarchy for each class
for ( Class currentClass : indexedClasses ) {
- if ( plainClass.isAssignableFrom( currentClass ) ) {
+ if ( plainClass != currentClass && plainClass.isAssignableFrom( currentClass )
) {
tempMappedSubclasses.add( currentClass );
}
}
Modified: search/trunk/src/java/org/hibernate/search/engine/MultiClassesQueryLoader.java
===================================================================
---
search/trunk/src/java/org/hibernate/search/engine/MultiClassesQueryLoader.java 2008-11-26
13:17:23 UTC (rev 15621)
+++
search/trunk/src/java/org/hibernate/search/engine/MultiClassesQueryLoader.java 2008-11-26
13:50:03 UTC (rev 15622)
@@ -75,7 +75,7 @@
for (EntityInfo entityInfo : entityInfos) {
boolean found = false;
for (RootEntityMetadata rootEntityInfo : entityMatadata) {
- if ( rootEntityInfo.mappedSubclasses.contains( entityInfo.clazz ) ) {
+ if ( rootEntityInfo.rootEntity == entityInfo.clazz ||
rootEntityInfo.mappedSubclasses.contains( entityInfo.clazz ) ) {
List<EntityInfo> bucket = entityinfoBuckets.get( rootEntityInfo );
if ( bucket == null ) {
bucket = new ArrayList<EntityInfo>();
Show replies by date