Search in sources :

Example 1 with ListEntityViewBuilderListener

use of com.blazebit.persistence.view.ListEntityViewBuilderListener in project blaze-persistence by Blazebit.

the class EntityViewBuilderBaseImpl method withListBuilder.

public <E> EntityViewNestedBuilder<E, ? extends BuilderType, ?> withListBuilder(AbstractAttribute<?, ?> attr, int index) {
    checkAttribute(attr, ListAttribute.class, "List");
    checkType(attr.getElementType(), "element", attr);
    Map<ManagedViewType<? extends E>, String> inheritanceSubtypeMappings = ((PluralAttribute<?, ?, E>) attr).getElementInheritanceSubtypeMappings();
    return new EntityViewNestedBuilderImpl<>(evm, (ManagedViewTypeImplementor<E>) attr.getElementType(), inheritanceSubtypeMappings, optionalParameters, (BuilderType) this, new ListEntityViewBuilderListener((List<Object>) getCollection(attr), index));
}
Also used : ManagedViewType(com.blazebit.persistence.view.metamodel.ManagedViewType) PluralAttribute(com.blazebit.persistence.view.metamodel.PluralAttribute) ListEntityViewBuilderListener(com.blazebit.persistence.view.ListEntityViewBuilderListener) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with ListEntityViewBuilderListener

use of com.blazebit.persistence.view.ListEntityViewBuilderListener in project blaze-persistence by Blazebit.

the class EntityViewBuilderBaseImpl method withBuilder.

@Override
public <E> EntityViewNestedBuilder<E, ? extends BuilderType, ?> withBuilder(ListAttribute<ViewType, E> attribute, int index) {
    AbstractAttribute<?, ?> attr = getAttribute(attribute);
    checkType(attr.getElementType(), "element", attr);
    Map<ManagedViewType<? extends E>, String> inheritanceSubtypeMappings = ((PluralAttribute<?, ?, E>) attr).getElementInheritanceSubtypeMappings();
    return new EntityViewNestedBuilderImpl<>(evm, (ManagedViewTypeImplementor<E>) attr.getElementType(), inheritanceSubtypeMappings, optionalParameters, (BuilderType) this, new ListEntityViewBuilderListener((List<Object>) getCollection(attr), index));
}
Also used : ManagedViewType(com.blazebit.persistence.view.metamodel.ManagedViewType) PluralAttribute(com.blazebit.persistence.view.metamodel.PluralAttribute) ListEntityViewBuilderListener(com.blazebit.persistence.view.ListEntityViewBuilderListener) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

ListEntityViewBuilderListener (com.blazebit.persistence.view.ListEntityViewBuilderListener)2 ManagedViewType (com.blazebit.persistence.view.metamodel.ManagedViewType)2 PluralAttribute (com.blazebit.persistence.view.metamodel.PluralAttribute)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2