}
@Override
public <Y> Path<Y> get(String attName) {
this.isLeaf = false;
Attribute attribute = this.managedType.getAttribute(attName);
Join join;
if (attribute.isCollection()) {
if (!((PluralAttribute) attribute).getElementType().getPersistenceType().equals(PersistenceType.BASIC)) {
if (((PluralAttribute) attribute).getCollectionType().equals(CollectionType.COLLECTION)) {
join = new CollectionJoinImpl<X, Y>(this, metamodel.managedType(((PluralAttribute) attribute).getBindableJavaType()), this.metamodel, ((PluralAttribute) attribute).getBindableJavaType(), this.currentNode.anyOf(attribute.getName()), (Bindable) attribute);
} else if (((PluralAttribute) attribute).getCollectionType().equals(CollectionType.LIST)) {
join = new ListJoinImpl<X, Y>(this, metamodel.managedType(((PluralAttribute) attribute).getBindableJavaType()), this.metamodel, ((PluralAttribute) attribute).getBindableJavaType(), this.currentNode.anyOf(attribute.getName()), (Bindable) attribute);
} else if (((PluralAttribute) attribute).getCollectionType().equals(CollectionType.SET)) {
join = new SetJoinImpl<X, Y>(this, metamodel.managedType(((PluralAttribute) attribute).getBindableJavaType()), this.metamodel, ((PluralAttribute) attribute).getBindableJavaType(), this.currentNode.anyOf(attribute.getName()), (Bindable) attribute);
} else {
join = new MapJoinImpl(this, metamodel.managedType(((PluralAttribute) attribute).getBindableJavaType()), this.metamodel, ((PluralAttribute) attribute).getBindableJavaType(), this.currentNode.anyOf(attribute.getName()), (Bindable) attribute);
}
} else {
if (((PluralAttribute) attribute).getCollectionType().equals(CollectionType.COLLECTION)) {
join = new BasicCollectionJoinImpl<X, Y>(this, this.metamodel, ((PluralAttribute) attribute).getBindableJavaType(), this.currentNode.anyOf(attribute.getName()), (Bindable) attribute);
} else if (((PluralAttribute) attribute).getCollectionType().equals(CollectionType.LIST)) {
join = new BasicListJoinImpl<X, Y>(this, this.metamodel, ((PluralAttribute) attribute).getBindableJavaType(), this.currentNode.anyOf(attribute.getName()), (Bindable) attribute);
} else if (((PluralAttribute) attribute).getCollectionType().equals(CollectionType.SET)) {
join = new BasicSetJoinImpl<X, Y>(this, this.metamodel, ((PluralAttribute) attribute).getBindableJavaType(), this.currentNode.anyOf(attribute.getName()), (Bindable) attribute);
} else{
join = new BasicMapJoinImpl(this, this.metamodel, ((PluralAttribute) attribute).getBindableJavaType(), this.currentNode.anyOf(attribute.getName()), (Bindable) attribute);
}
}
((FromImpl)join).isLeaf = false;
}else{
Class clazz = ((SingularAttribute)attribute).getBindableJavaType();
if (((SingularAttribute)attribute).getType().getPersistenceType().equals(PersistenceType.BASIC)){
return new PathImpl<Y>(this, this.metamodel, clazz, this.currentNode.get(attribute.getName()), (Bindable)attribute);
}else{
join = new JoinImpl(this, this.metamodel.managedType(clazz), this.metamodel, clazz, this.currentNode.get(attribute.getName()), (Bindable)attribute);
}
}
this.joins.add(join);
return join;
}