Package org.hibernate.ogm

Examples of org.hibernate.ogm.OgmSession.createNativeQuery()


    OgmSession session = openSession();
    Transaction transaction = session.beginTransaction();

    String nativeQuery = "{ $and: [ { name : 'Portia' }, { author : 'Oscar Wilde' } ] }";
    try {
      session.createNativeQuery( nativeQuery ).uniqueResult();
      transaction.commit();
    }
    catch (Exception he) {
      transaction.rollback();
      String message = he.getMessage();
View Full Code Here


    OgmSession session = openSession();
    Transaction transaction = session.beginTransaction();

    String nativeQuery = "{ name : 'Her Voice' }";

    Query query = session.createNativeQuery( nativeQuery )
        .addEntity( OscarWildePoem.class );

    List<OscarWildePoem> result = query.list();
    assertThat( result ).isEmpty();
View Full Code Here

    OgmSession session = openSession();
    Transaction transaction = session.beginTransaction();

    String nativeQuery = "{ $query : { author : 'Oscar Wilde' }, $orderby : { name : 1 } }";
    try {
      session.createNativeQuery( nativeQuery ).list();
    }
    catch (Exception he) {
      transaction.rollback();
      String message = he.getMessage();
      assertThat( message )
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.