Package com.spaceprogram.simplejpa.query

Examples of com.spaceprogram.simplejpa.query.JPAQueryParser$Compiler


*/
public class QueryTests {
    @Test
    public void testWhere(){
        JPAQuery query = new JPAQuery();
        JPAQueryParser parser;
        List<String> split;

        parser = new JPAQueryParser(query, ("select o from MyTestObject o where o.myTestObject2.id = :id2 and 1=1 OR o.myTestObject2.name = 'larry'"));
        parser.parse();
        split = QueryImpl.tokenizeWhere(query.getFilter());
        Assert.assertEquals(11, split.size());
        Assert.assertEquals("o.myTestObject2.id = :id2 and 1 = 1 OR o.myTestObject2.name = 'larry' ", toString(split));
    }
View Full Code Here


    @Test
    public void testDates(){
        String q = "select o from MyTestObject o where o.birthday > :from and o.birthday < :to and o.id = :id";
        JPAQuery query = new JPAQuery();
        JPAQueryParser parser;
        List<String> split;

        parser = new JPAQueryParser(query, (q));
        parser.parse();
        split = QueryImpl.tokenizeWhere(query.getFilter());
        String delimited = toString(split, " || ");
        System.out.println("delimited: " + delimited);
        Assert.assertEquals("o.birthday > :from and o.birthday < :to and o.id = :id ", toString(split));
        Assert.assertEquals(11, split.size());
View Full Code Here

     
      Environment env = parser.compile();
     
      ASN1Compiler comp = new ASN1Compiler();*/
     
    Compiler compiler = new Compiler();
        Map environment = new HashMap();
               
//        environment.put( ParseStage.SRC_URI, "file:///home/krychu/workspace/OpenCDF/gtpprime-asn1cdr/src/main/resources/asn1/ldap.asn");
        //environment.put( ParseStage.SRC_URI, "file:///home/krychu/workspace/OpenCDF/gtpprime-asn1cdr/src/main/resources/asn1/32.298/ps.asn1");
        environment.put( ParseStage.SRC_URI, "file:///home/krychu/workspace/OpenCDF/gtpprime-asn1cdr/src/main/resources/asn1/3gpp_merged/huawei_ps.asn1");
        //environment.put( ParseStage.SRC_URI, "file:///home/krychu/workspace/OpenCDF/gtpprime-asn1cdr/src/main/resources/asn1/NBAP-25433-530.asn1");
        environment.put( CodeGeneratorStage.ROOT_PACKAGE, "org.apache.ldap.asn1" );
        environment.put( CodeGeneratorStage.DESTINATION_PATH, "./c/" );

        compiler.compile( environment );
   
     
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of com.spaceprogram.simplejpa.query.JPAQueryParser$Compiler

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.