Examples of CollectionExpression


Examples of org.datanucleus.store.mapped.expression.CollectionExpression

    {
        if (containerIsStoredInSingleColumn())
        {
            throw new NucleusUserException(LOCALISER.msg("041025", mmd.getFullFieldName())).setFatal();
        }
        return new CollectionExpression(qs, datastoreContainer.getIDMapping(), te, ((CollectionStore) storeMgr.getBackingStoreForField(qs.getClassLoaderResolver(),mmd,null)), fieldName);
    }
View Full Code Here

Examples of org.datanucleus.store.rdbms.sql.expression.CollectionExpression

        if (args == null || args.size() == 0 || args.size() > 1)
        {
            throw new NucleusException(LOCALISER.msg("060016", "get", "CollectionExpression", 1));
        }

        CollectionExpression listExpr = (CollectionExpression)expr;
        AbstractMemberMetaData mmd = listExpr.getJavaTypeMapping().getMemberMetaData();
        if (!List.class.isAssignableFrom(mmd.getType()))
        {
            throw new UnsupportedOperationException("Query contains " + expr + ".get(int) yet the field is not a List!");
        }
        else if (mmd.getOrderMetaData() != null && !mmd.getOrderMetaData().isIndexedList())
View Full Code Here

Examples of org.datanucleus.store.rdbms.sql.expression.CollectionExpression

        if (args == null || args.size() == 0 || args.size() > 1)
        {
            throw new NucleusException(LOCALISER.msg("060016", "contains", "CollectionExpression", 1));
        }

        CollectionExpression collExpr = (CollectionExpression)expr;
        AbstractMemberMetaData mmd = collExpr.getJavaTypeMapping().getMemberMetaData();
        SQLExpression elemExpr = (SQLExpression)args.get(0);
        if (elemExpr.isParameter())
        {
            // Element is a parameter so make sure its type is set
            if (mmd != null && mmd.getCollection() != null)
            {
                Class elementCls = stmt.getQueryGenerator().getClassLoaderResolver().classForName(mmd.getCollection().getElementType());
                stmt.getQueryGenerator().bindParameter(elemExpr.getParameterName(), elementCls);
            }
        }

        if (collExpr instanceof CollectionLiteral)
        {
            // Literal collection
            CollectionLiteral lit = (CollectionLiteral)collExpr;
            Collection coll = (Collection)lit.getValue();
            JavaTypeMapping m = exprFactory.getMappingForType(boolean.class, true);
            if (coll == null || coll.isEmpty())
            {
                return exprFactory.newLiteral(stmt, m, true).eq(exprFactory.newLiteral(stmt, m, false));
            }

            if (collExpr.isParameter())
            {
                stmt.getQueryGenerator().useParameterExpressionAsLiteral((CollectionLiteral)collExpr);
            }

            boolean useInExpression = false;
View Full Code Here

Examples of org.eclipse.persistence.jpa.internal.jpql.parser.CollectionExpression

    Expression selectExpression = expression.getSelectExpression();

    // visit(CollectionExpression) iterates through the children but for a
    // SELECT clause, a CollectionExpression means the result type is Object[]
    CollectionExpression collectionExpression = collectionExpression(selectExpression);

    if (collectionExpression != null) {
      resolver = buildClassResolver(Object[].class);
    }
    else {
View Full Code Here

Examples of org.eclipse.persistence.jpa.internal.jpql.parser.CollectionExpression

  private void visitCollectionEquivalentExpression(Expression expression,
                                                   Expression extraExpression) {

    List<Resolver> resolvers = new ArrayList<Resolver>();
    CollectionExpression collectionExpression = collectionExpression(expression);

    // Gather the resolver for all children
    if (collectionExpression != null) {
      for (Expression child : collectionExpression.getChildren()) {
        child.accept(this);
        resolvers.add(resolver);
      }
    }
    // Otherwise visit the actual expression
View Full Code Here

Examples of org.eclipse.persistence.jpa.internal.jpql.parser.CollectionExpression

    Expression selectExpression = expression.getSelectExpression();

    // visit(CollectionExpression) iterates through the children but for a
    // SELECT clause, a CollectionExpression means the result type is Object[]
    CollectionExpression collectionExpression = collectionExpression(selectExpression);

    if (collectionExpression != null) {
      resolver = buildClassResolver(Object[].class);
    }
    else {
View Full Code Here

Examples of org.eclipse.persistence.jpa.internal.jpql.parser.CollectionExpression

  private void visitCollectionEquivalentExpression(Expression expression,
                                                   Expression extraExpression) {

    List<Resolver> resolvers = new ArrayList<Resolver>();
    CollectionExpression collectionExpression = collectionExpression(expression);

    // Gather the resolver for all children
    if (collectionExpression != null) {
      for (Expression child : collectionExpression.getChildren()) {
        child.accept(this);
        resolvers.add(resolver);
      }
    }
    // Otherwise visit the actual expression
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.parser.CollectionExpression

    Expression selectExpression = expression.getSelectExpression();

    // visit(CollectionExpression) iterates through the children but for a
    // SELECT clause, a CollectionExpression means the result type is Object[]
    CollectionExpression collectionExpression = getCollectionExpression(selectExpression);

    if (collectionExpression != null) {
      type = Object[].class;
    }
    else {
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.parser.CollectionExpression

   */
  private void visitCollectionEquivalentExpression(Expression expression,
                                                   Expression extraExpression) {

    List<Class<?>> types = new ArrayList<Class<?>>();
    CollectionExpression collectionExpression = getCollectionExpression(expression);

    // Gather the resolver for all children
    if (collectionExpression != null) {
      for (Expression child : collectionExpression.children()) {
        child.accept(this);
        types.add(type);
      }
    }
    // Otherwise visit the actual expression
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.parser.CollectionExpression

    /**
     * {@inheritDoc}
     */
    public CollectionExpression buildCollectionExpression(UpdateClause expression) {
      CollectionExpression collectionExpression = getCollectionExpression(expression.getUpdateItems());
      if (collectionExpression == null) {
        collectionExpression = expression.buildCollectionExpression();
      }
      return collectionExpression;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.