6 - SQM based on JPA type system

This commit is contained in:
Andrea Boriero 2019-05-23 18:21:35 +01:00
parent 05724fc19a
commit e8f22dc2ef
1 changed files with 20 additions and 1 deletions

View File

@ -9,11 +9,17 @@ package org.hibernate.metamodel.model.domain.internal;
import java.util.Set;
import org.hibernate.metamodel.model.domain.SetPersistentAttribute;
import org.hibernate.query.sqm.produce.spi.SqmCreationState;
import org.hibernate.query.sqm.tree.SqmJoinType;
import org.hibernate.query.sqm.tree.domain.SqmSetJoin;
import org.hibernate.query.sqm.tree.from.SqmAttributeJoin;
import org.hibernate.query.sqm.tree.from.SqmFrom;
/**
* @author Steve Ebersole
*/
public class SetAttributeImpl<X, E> extends AbstractPluralAttribute<X, Set<E>, E> implements SetPersistentAttribute<X, E> {
public class SetAttributeImpl<X, E> extends AbstractPluralAttribute<X, Set<E>, E>
implements SetPersistentAttribute<X, E> {
public SetAttributeImpl(PluralAttributeBuilder<X, Set<E>, E, ?> xceBuilder) {
super( xceBuilder );
}
@ -22,4 +28,17 @@ public class SetAttributeImpl<X, E> extends AbstractPluralAttribute<X, Set<E>, E
public CollectionType getCollectionType() {
return CollectionType.SET;
}
@Override
public SqmAttributeJoin createSqmJoin(
SqmFrom lhs, SqmJoinType joinType, String alias, boolean fetched, SqmCreationState creationState) {
return new SqmSetJoin(
lhs,
this,
alias,
joinType,
fetched,
creationState.getCreationContext().getNodeBuilder()
);
}
}