use of com.blazebit.persistence.view.MapKeyEntityViewBuilderListener in project blaze-persistence by Blazebit.
the class EntityViewBuilderBaseImpl method withBuilder.
@Override
public <K, V> EntityViewNestedBuilder<K, ? extends EntityViewNestedBuilder<V, ? extends BuilderType, ?>, ?> withBuilder(MapAttribute<ViewType, K, V> attribute) {
AbstractAttribute<?, ?> attr = getAttribute(attribute);
checkType(((MapAttribute<?, ?, ?>) attr).getKeyType(), "key", attr);
checkType(attr.getElementType(), "element", attr);
MapKeyEntityViewBuilderListener listener = new MapKeyEntityViewBuilderListener(getMap(attr));
Map<ManagedViewType<? extends V>, String> inheritanceSubtypeMappings = ((PluralAttribute<?, ?, V>) attr).getElementInheritanceSubtypeMappings();
EntityViewNestedBuilder<V, ? extends BuilderType, ?> valueBuilder = new EntityViewNestedBuilderImpl<>(evm, (ManagedViewTypeImplementor<V>) attr.getElementType(), inheritanceSubtypeMappings, optionalParameters, (BuilderType) this, listener);
Map<ManagedViewType<? extends K>, String> keyInheritanceSubtypeMappings = ((MapAttribute<?, K, ?>) attr).getKeyInheritanceSubtypeMappings();
return new EntityViewNestedBuilderImpl<>(evm, (ManagedViewTypeImplementor<K>) attr.getElementType(), keyInheritanceSubtypeMappings, optionalParameters, valueBuilder, listener);
}
use of com.blazebit.persistence.view.MapKeyEntityViewBuilderListener in project blaze-persistence by Blazebit.
the class EntityViewBuilderBaseImpl method withMapBuilder.
private <K, V> EntityViewNestedBuilder<K, ? extends EntityViewNestedBuilder<V, ? extends BuilderType, ?>, ?> withMapBuilder(AbstractAttribute<?, ?> attr) {
checkAttribute(attr, MapAttribute.class, "Map");
checkType(((MapAttribute<?, ?, ?>) attr).getKeyType(), "key", attr);
checkType(attr.getElementType(), "element", attr);
MapKeyEntityViewBuilderListener listener = new MapKeyEntityViewBuilderListener(getMap(attr));
Map<ManagedViewType<? extends V>, String> inheritanceSubtypeMappings = ((PluralAttribute<?, ?, V>) attr).getElementInheritanceSubtypeMappings();
EntityViewNestedBuilder<V, ? extends BuilderType, ?> valueBuilder = new EntityViewNestedBuilderImpl<>(evm, (ManagedViewTypeImplementor<V>) attr.getElementType(), inheritanceSubtypeMappings, optionalParameters, (BuilderType) this, listener);
Map<ManagedViewType<? extends K>, String> keyInheritanceSubtypeMappings = ((MapAttribute<?, K, ?>) attr).getKeyInheritanceSubtypeMappings();
return new EntityViewNestedBuilderImpl<>(evm, (ManagedViewTypeImplementor<K>) attr.getElementType(), keyInheritanceSubtypeMappings, optionalParameters, valueBuilder, listener);
}
Aggregations