javax.persistence.metamodel.ListAttribute Java Examples

The following examples show how to use javax.persistence.metamodel.ListAttribute. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractManagedType.java    From lams with GNU General Public License v2.0 7 votes vote down vote up
@Override
@SuppressWarnings({ "unchecked" })
public ListAttribute<? super X, ?> getList(String name) {
	PluralAttribute<? super X, ?, ?> attribute = getPluralAttribute( name );
	if ( attribute == null && getSupertype() != null ) {
		attribute = getSupertype().getPluralAttribute( name );
	}
	basicListCheck( attribute, name );
	return (ListAttribute<? super X, ?>) attribute;
}
 
Example #2
Source File: AbstractManagedType.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public ListAttribute<X, ?> getDeclaredList(String name) {
	final PluralAttribute<X,?,?> attribute = declaredPluralAttributes.get( name );
	basicListCheck( attribute, name );
	return ( ListAttribute<X, ?> ) attribute;
}
 
Example #3
Source File: AbstractManagedType.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
@SuppressWarnings({ "unchecked" })
public <E> ListAttribute<? super X, E> getList(String name, Class<E> elementType) {
	PluralAttribute<? super X, ?, ?> attribute = declaredPluralAttributes.get( name );
	if ( attribute == null && getSupertype() != null ) {
		attribute = getSupertype().getPluralAttribute( name );
	}
	checkListElementType( attribute, name, elementType );
	return ( ListAttribute<? super X, E> ) attribute;
}
 
Example #4
Source File: AbstractManagedType.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <E> ListAttribute<X, E> getDeclaredList(String name, Class<E> elementType) {
	final PluralAttribute<X,?,?> attribute = declaredPluralAttributes.get( name );
	checkListElementType( attribute, name, elementType );
	return ( ListAttribute<X, E> ) attribute;
}
 
Example #5
Source File: ListIndexExpression.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public ListIndexExpression(
		CriteriaBuilderImpl criteriaBuilder,
		PathImplementor origin,
		ListAttribute listAttribute) {
	super( criteriaBuilder, Integer.class );
	this.origin = origin;
	this.listAttribute = listAttribute;
}
 
Example #6
Source File: ListAttributeJoin.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public TreatedListAttributeJoin(ListAttributeJoin<O, ? super T> original, Class<T> treatAsType) {
	super(
			original.criteriaBuilder(),
			treatAsType,
			original.getPathSource(),
			(ListAttribute<? super O, T>) original.getAttribute(),
			original.getJoinType()
	);
	this.original = original;
	this.treatAsType = treatAsType;
}
 
Example #7
Source File: AbstractFromImpl.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private <Y> ListJoinImplementor<X, Y> constructJoin(ListAttribute<? super X, Y> list, JoinType jt) {
	if ( jt.equals( JoinType.RIGHT ) ) {
		throw new UnsupportedOperationException( "RIGHT JOIN not supported" );
	}

	// TODO : runtime check that the attribute in fact belongs to this From's model/bindable

	final Class<Y> attributeType = list.getBindableJavaType();
	return new ListAttributeJoin<X, Y>( criteriaBuilder(), attributeType, this, list, jt );
}
 
Example #8
Source File: AbstractFromImpl.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
@SuppressWarnings({"unchecked"})
public <X, Y> Join<X, Y> join(String attributeName, JoinType jt) {
	if ( !canBeJoinSource() ) {
		throw illegalJoin();
	}

	if ( jt.equals( JoinType.RIGHT ) ) {
		throw new UnsupportedOperationException( "RIGHT JOIN not supported" );
	}

	final Attribute<X, ?> attribute = (Attribute<X, ?>) locateAttribute( attributeName );
	if ( attribute.isCollection() ) {
		final PluralAttribute pluralAttribute = (PluralAttribute) attribute;
		if ( PluralAttribute.CollectionType.COLLECTION.equals( pluralAttribute.getCollectionType() ) ) {
			return (Join<X, Y>) join( (CollectionAttribute) attribute, jt );
		}
		else if ( PluralAttribute.CollectionType.LIST.equals( pluralAttribute.getCollectionType() ) ) {
			return (Join<X, Y>) join( (ListAttribute) attribute, jt );
		}
		else if ( PluralAttribute.CollectionType.SET.equals( pluralAttribute.getCollectionType() ) ) {
			return (Join<X, Y>) join( (SetAttribute) attribute, jt );
		}
		else {
			return (Join<X, Y>) join( (MapAttribute) attribute, jt );
		}
	}
	else {
		return (Join<X, Y>) join( (SingularAttribute) attribute, jt );
	}
}
 
Example #9
Source File: AbstractFromImpl.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
@SuppressWarnings({"unchecked"})
public <X, Y> ListJoin<X, Y> joinList(String attributeName, JoinType jt) {
	final Attribute<X, ?> attribute = (Attribute<X, ?>) locateAttribute( attributeName );
	if ( !attribute.isCollection() ) {
		throw new IllegalArgumentException( "Requested attribute was not a list" );
	}

	final PluralAttribute pluralAttribute = (PluralAttribute) attribute;
	if ( !PluralAttribute.CollectionType.LIST.equals( pluralAttribute.getCollectionType() ) ) {
		throw new IllegalArgumentException( "Requested attribute was not a list" );
	}

	return (ListJoin<X, Y>) join( (ListAttribute) attribute, jt );
}
 
Example #10
Source File: ListAttributeJoin.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public ListAttributeJoin(
		CriteriaBuilderImpl criteriaBuilder,
		Class<E> javaType,
		PathSource<O> pathSource,
		ListAttribute<? super O, E> joinAttribute,
		JoinType joinType) {
	super( criteriaBuilder, javaType, pathSource, joinAttribute, joinType );
}
 
Example #11
Source File: JPAEntityTypeMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public ListAttribute<? super X, ?> getList(final String arg0) {
  return null;
}
 
Example #12
Source File: JPAManagedTypeMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public <E> ListAttribute<? super X, E> getList(final String arg0, final Class<E> arg1) {
  return null;
}
 
Example #13
Source File: JPAManagedTypeMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public ListAttribute<? super X, ?> getList(final String arg0) {
  return null;
}
 
Example #14
Source File: JPAManagedTypeMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public <E> ListAttribute<X, E> getDeclaredList(final String arg0, final Class<E> arg1) {
  return null;
}
 
Example #15
Source File: JPAManagedTypeMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public ListAttribute<X, ?> getDeclaredList(final String arg0) {
  return null;
}
 
Example #16
Source File: JPAEntityTypeMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public <E> ListAttribute<? super X, E> getList(final String arg0, final Class<E> arg1) {
  return null;
}
 
Example #17
Source File: JPAEmbeddableMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public ListAttribute<X, ?> getDeclaredList(final String arg0) {
  return null;
}
 
Example #18
Source File: JPAEntityTypeMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public <E> ListAttribute<X, E> getDeclaredList(final String arg0, final Class<E> arg1) {
  return null;
}
 
Example #19
Source File: JPAEntityTypeMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public ListAttribute<X, ?> getDeclaredList(final String arg0) {
  return null;
}
 
Example #20
Source File: JPAEmbeddableMock.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
@Override
public <E> ListAttribute<? super X, E> getList(final String arg0, final Class<E> arg1) {
  return null;
}
 
Example #21
Source File: JPAEmbeddableMock.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
@Override
public ListAttribute<? super X, ?> getList(final String arg0) {
  return null;
}
 
Example #22
Source File: JPAEmbeddableTypeMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public ListAttribute<X, ?> getDeclaredList(final String arg0) {
  return null;
}
 
Example #23
Source File: JPAEmbeddableTypeMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public <E> ListAttribute<X, E> getDeclaredList(final String arg0, final Class<E> arg1) {
  return null;
}
 
Example #24
Source File: JPAEmbeddableTypeMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public ListAttribute<? super X, ?> getList(final String arg0) {
  return null;
}
 
Example #25
Source File: JPAEmbeddableTypeMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public <E> ListAttribute<? super X, E> getList(final String arg0, final Class<E> arg1) {
  return null;
}
 
Example #26
Source File: JPAEmbeddableTypeMock.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
@Override
public ListAttribute<X, ?> getDeclaredList(final String arg0) {
  return null;
}
 
Example #27
Source File: JPAEmbeddableMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public <E> ListAttribute<X, E> getDeclaredList(final String arg0, final Class<E> arg1) {
  return null;
}
 
Example #28
Source File: JPAEmbeddableMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public ListAttribute<? super X, ?> getList(final String arg0) {
  return null;
}
 
Example #29
Source File: JPAEmbeddableMock.java    From cloud-odata-java with Apache License 2.0 4 votes vote down vote up
@Override
public <E> ListAttribute<? super X, E> getList(final String arg0, final Class<E> arg1) {
  return null;
}
 
Example #30
Source File: QueryCriteria.java    From deltaspike with Apache License 2.0 4 votes vote down vote up
@Override
public <P, E> Criteria<C, R> join(ListAttribute<? super C, P> att, Criteria<P, P> criteria)
{
    add(new JoinBuilder<C, P, E>(criteria, joinType, att));
    return this;
}