Search in sources :

Example 1 with MappedObject16

use of org.simpleflatmapper.jpa.beans.MappedObject16 in project mapping-benchmark by arnaudroger.

the class BatooBenchmark method main.

public static void main(String[] args) throws Exception {
    ConnectionParam connParam = new ConnectionParam();
    connParam.db = DbTarget.HSQLDB;
    connParam.init();
    EntityManagerFactory sf = Persistence.createEntityManagerFactory("jpa");
    EntityManager session = sf.createEntityManager();
    try {
        Query query = session.createQuery("select s from MappedObject16 s");
        query.setMaxResults(2);
        List<MappedObject16> sr = query.getResultList();
        for (MappedObject16 o : sr) {
            System.out.println("o. = " + o.getEmail());
            System.out.println("o. = " + o.getField12());
        }
    } finally {
        session.close();
    }
}
Also used : EntityManager(javax.persistence.EntityManager) MappedObject16(org.simpleflatmapper.jpa.beans.MappedObject16) Query(javax.persistence.Query) EntityManagerFactory(javax.persistence.EntityManagerFactory) ConnectionParam(org.simpleflatmapper.db.ConnectionParam)

Aggregations

EntityManager (javax.persistence.EntityManager)1 EntityManagerFactory (javax.persistence.EntityManagerFactory)1 Query (javax.persistence.Query)1 ConnectionParam (org.simpleflatmapper.db.ConnectionParam)1 MappedObject16 (org.simpleflatmapper.jpa.beans.MappedObject16)1