Package org.eclipse.persistence.jpa.jpql.parser

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


   */
  @SuppressWarnings("unchecked")
  protected <T extends StateObject> List<T> buildStateObjects(CharSequence jpqlFragment,
                                                              String queryBNFId) {

    VirtualJPQLQueryBNF queryBNF = new VirtualJPQLQueryBNF(getGrammar());
    queryBNF.setHandleCollection(true);
    queryBNF.setFallbackBNFId(queryBNFId);
    queryBNF.registerQueryBNF(queryBNFId);

    final List<StateObject> items = new ArrayList<StateObject>();

    try {
      StateObject stateObject = buildStateObject(jpqlFragment, queryBNF.getId());

      StateObjectVisitor visitor = new AnonymousStateObjectVisitor() {
        @SuppressWarnings("unused")
        public void visit(CollectionExpressionStateObject stateObject) {
          CollectionTools.addAll(items, stateObject.children());
        }
        @Override
        protected void visit(StateObject stateObject) {
          items.add(stateObject);
        }
      };

      stateObject.accept(visitor);
    }
    finally {
      queryBNF.dispose();
    }

    return (List<T>) items;
  }
View Full Code Here


   */
  @SuppressWarnings("unchecked")
  protected <T extends StateObject> List<T> buildStateObjects(CharSequence jpqlFragment,
                                                              String queryBNFId) {

    VirtualJPQLQueryBNF queryBNF = new VirtualJPQLQueryBNF(getGrammar());
    queryBNF.setHandleCollection(true);
    queryBNF.setFallbackBNFId(queryBNFId);
    queryBNF.registerQueryBNF(queryBNFId);

    final List<StateObject> items = new ArrayList<StateObject>();

    try {
      StateObject stateObject = buildStateObject(jpqlFragment, queryBNF.getId());

      StateObjectVisitor visitor = new AnonymousStateObjectVisitor() {
        @SuppressWarnings("unused")
        public void visit(CollectionExpressionStateObject stateObject) {
          CollectionTools.addAll(items, stateObject.children());
        }
        @Override
        protected void visit(StateObject stateObject) {
          items.add(stateObject);
        }
      };

      stateObject.accept(visitor);
    }
    finally {
      queryBNF.dispose();
    }

    return (List<T>) items;
  }
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  protected <T extends StateObject> List<T> buildStateObjects(CharSequence jpqlFragment,
                                                              String queryBNFId) {

    VirtualJPQLQueryBNF queryBNF = new VirtualJPQLQueryBNF(getGrammar());
    queryBNF.setHandleCollection(true);
    queryBNF.setFallbackBNFId(queryBNFId);
    queryBNF.registerQueryBNF(queryBNFId);

    final List<StateObject> items = new ArrayList<StateObject>();

    try {
      StateObject stateObject = buildStateObject(jpqlFragment, queryBNF.getId());

      StateObjectVisitor visitor = new AnonymousStateObjectVisitor() {
        @SuppressWarnings("unused")
        public void visit(CollectionExpressionStateObject stateObject) {
          CollectionTools.addAll(items, stateObject.children());
        }
        @Override
        protected void visit(StateObject stateObject) {
          items.add(stateObject);
        }
      };

      stateObject.accept(visitor);
    }
    finally {
      queryBNF.dispose();
    }

    return (List<T>) items;
  }
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  protected <T extends StateObject> List<T> buildStateObjects(CharSequence jpqlFragment,
                                                              String queryBNFId) {

    VirtualJPQLQueryBNF queryBNF = new VirtualJPQLQueryBNF(getGrammar());
    queryBNF.setHandleCollection(true);
    queryBNF.setFallbackBNFId(queryBNFId);
    queryBNF.registerQueryBNF(queryBNFId);

    final List<StateObject> items = new ArrayList<StateObject>();

    try {
      StateObject stateObject = buildStateObject(jpqlFragment, queryBNF.getId());

      StateObjectVisitor visitor = new AnonymousStateObjectVisitor() {
        @SuppressWarnings("unused")
        public void visit(CollectionExpressionStateObject stateObject) {
          CollectionTools.addAll(items, stateObject.children());
        }
        @Override
        protected void visit(StateObject stateObject) {
          items.add(stateObject);
        }
      };

      stateObject.accept(visitor);
    }
    finally {
      queryBNF.dispose();
    }

    return (List<T>) items;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.jpa.jpql.parser.VirtualJPQLQueryBNF

Copyright © 2018 www.massapicom. 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.