protected final Optional<CustomTypeMetadata> getCustomTypeMetadata(IndexedTypeIdentifier target) { Class<?> targetPojoType = target.getPojoType(); for ( Map.Entry<IndexedTypeIdentifier, CustomTypeMetadata> entry : customTypeMetadata.entrySet() ) { if ( entry.getKey().getPojoType().isAssignableFrom( targetPojoType ) ) { return Optional.of( entry.getValue() ); } } return Optional.empty(); }
protected final Optional<CustomTypeMetadata> getCustomTypeMetadata(IndexedTypeIdentifier target) { Class<?> targetPojoType = target.getPojoType(); for ( Map.Entry<IndexedTypeIdentifier, CustomTypeMetadata> entry : customTypeMetadata.entrySet() ) { if ( entry.getKey().getPojoType().isAssignableFrom( targetPojoType ) ) { return Optional.of( entry.getValue() ); } } return Optional.empty(); }
public void setEntityTypes(Set<Class<?>> entityTypes) { List<Class<?>> safeEntityTypes = new ArrayList<>(); // TODO should we go find the root entity for a given class rather than just checking for it's root status? // root entity could lead to quite inefficient queries in Hibernate when using table per class if ( entityTypes.size() == 0 ) { //support all classes for ( Entry<IndexedTypeIdentifier, EntityIndexBinding> entry : extendedIntegrator.getIndexBindings().entrySet() ) { //get only root entities to limit queries if ( entry.getValue().getDocumentBuilder().isRoot() ) { safeEntityTypes.add( entry.getKey().getPojoType() ); } } } else { safeEntityTypes.addAll( entityTypes ); } entityMetadata = new ArrayList<>( safeEntityTypes.size() ); for ( Class clazz : safeEntityTypes ) { entityMetadata.add( new RootEntityMetadata( clazz, extendedIntegrator ) ); } }
for ( Entry<IndexedTypeIdentifier, EntityIndexBinding> entry : allIndexBindings.entrySet() ) { queriedIndexBindingsByName.put( entry.getKey().getName(), entry.getValue() );
for ( Entry<IndexedTypeIdentifier, EntityIndexBinding> entry : allIndexBindings.entrySet() ) { queriedIndexBindingsByName.put( entry.getKey().getName(), entry.getValue() );