Skip to content

Commit

Permalink
HSEARCH-2508 Revert "HSEARCH-2419 Do not require @IndexedEmbedded to …
Browse files Browse the repository at this point in the history
…make use of built-in container bridges"

This reverts commit 8d7597a.
  • Loading branch information
yrodiere authored and DavideD committed Dec 16, 2016
1 parent 539526a commit c008a71
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -19,6 +19,7 @@
import org.hibernate.annotations.common.reflection.XMember;
import org.hibernate.search.annotations.ClassBridge;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.IndexedEmbedded;
import org.hibernate.search.annotations.Parameter;
import org.hibernate.search.annotations.Spatial;
import org.hibernate.search.bridge.AppliedOnTypeAwareBridge;
Expand Down Expand Up @@ -275,6 +276,9 @@ public FieldBridge buildFieldBridge(Field field,
}

private ContainerType getContainerType(XMember member, ReflectionManager reflectionManager) {
if ( ! member.isAnnotationPresent( IndexedEmbedded.class ) ) {
return ContainerType.SINGLE;
}
if ( member.isArray() ) {
return ContainerType.ARRAY;
}
Expand All @@ -285,6 +289,8 @@ private ContainerType getContainerType(XMember member, ReflectionManager reflect
if ( member.isCollection() && Map.class.equals( member.getCollectionClass() ) ) {
return ContainerType.MAP;
}
// marked @IndexedEmbedded but not a container
// => probably a @Field @IndexedEmbedded Foo foo;
return ContainerType.SINGLE;
}

Expand Down

0 comments on commit c008a71

Please sign in to comment.