Package com.google.appengine.datanucleus.query

Source Code of com.google.appengine.datanucleus.query.Issue256Test

package com.google.appengine.datanucleus.query;

import javax.persistence.TypedQuery;

import com.google.appengine.datanucleus.jpa.JPATestCase;
import com.google.appengine.datanucleus.test.jdo.Flight;

public class Issue256Test extends JPATestCase {
  public void testRun() {
    beginTxn();
    Flight fl = new Flight("CHI", "LHR", "BA201", 1, 16);
    em.persist(fl);
    commitTxn();
    em.clear();

    beginTxn();
    TypedQuery<Long> q = em.createQuery("SELECT COUNT(f) FROM " + Flight.class.getName() + " f", Long.class);
    Long result = q.getSingleResult();
    assertEquals(1, result.longValue());
    commitTxn();
  }
}
TOP

Related Classes of com.google.appengine.datanucleus.query.Issue256Test

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.