Package org.hibernate.ogm

Examples of org.hibernate.ogm.OgmSessionFactory


  public Query createNamedQuery(String name) {
    return buildQueryFromName( name, null );
  }

  private <T> TypedQuery<T> buildQueryFromName(String name, Class<T> resultType) {
    OgmSessionFactory sessionFactory = (OgmSessionFactory) factory.getSessionFactory();
    NamedQueryDefinition queryDefinition = sessionFactory.getNamedSQLQuery( name );
    if ( queryDefinition == null ) {
      queryDefinition = sessionFactory.getNamedQuery( name );
      if ( queryDefinition == null ) {
        throw new IllegalArgumentException( "Named query not found: " + name );
      }
      else {
        return createNamedJpqlQuery( queryDefinition, resultType );
View Full Code Here


  }

  private OgmSession buildOgmSession(Session session) {
    final SessionFactory sessionFactory = ( (HibernateEntityManagerFactory) hibernateEm.getEntityManagerFactory() )
        .getSessionFactory();
    final OgmSessionFactory ogmSessionFactory = new OgmSessionFactoryImpl( (SessionFactoryImplementor) sessionFactory );
    return new OgmSessionImpl( ogmSessionFactory, (EventSource) session );
  }
View Full Code Here

  public Query createNamedQuery(String name) {
    return buildQueryFromName( name, null );
  }

  private <T> TypedQuery<T> buildQueryFromName(String name, Class<T> resultType) {
    OgmSessionFactory sessionFactory = (OgmSessionFactory) factory.getSessionFactory();
    NamedQueryDefinition queryDefinition = sessionFactory.getNamedSQLQuery( name );
    if ( queryDefinition == null ) {
      queryDefinition = sessionFactory.getNamedQuery( name );
      if ( queryDefinition == null ) {
        throw new IllegalArgumentException( "Named query not found: " + name );
      }
      else {
        return createNamedJpqlQuery( queryDefinition, resultType );
View Full Code Here

  }

  private OgmSession buildOgmSession(Session session) {
    final SessionFactory sessionFactory = ( (HibernateEntityManagerFactory) hibernateEm.getEntityManagerFactory() )
        .getSessionFactory();
    final OgmSessionFactory ogmSessionFactory = new OgmSessionFactoryImpl( (SessionFactoryImplementor) sessionFactory );
    return new OgmSessionImpl( ogmSessionFactory, (EventSource) session );
  }
View Full Code Here

  public Query createNamedQuery(String name) {
    return buildQueryFromName( name, null );
  }

  private <T> TypedQuery<T> buildQueryFromName(String name, Class<T> resultType) {
    OgmSessionFactory sessionFactory = (OgmSessionFactory) factory.getSessionFactory();
    NamedQueryDefinition queryDefinition = sessionFactory.getNamedSQLQuery( name );
    if ( queryDefinition == null ) {
      queryDefinition = sessionFactory.getNamedQuery( name );
      if ( queryDefinition == null ) {
        throw new IllegalArgumentException( "Named query not found: " + name );
      }
      else {
        return createNamedJpqlQuery( queryDefinition, resultType );
View Full Code Here

  }

  private OgmSession buildOgmSession(Session session) {
    final SessionFactory sessionFactory = ( (HibernateEntityManagerFactory) hibernateEm.getEntityManagerFactory() )
        .getSessionFactory();
    final OgmSessionFactory ogmSessionFactory = new OgmSessionFactoryImpl( (SessionFactoryImplementor) sessionFactory );
    return new OgmSession( ogmSessionFactory, (EventSource) session );
  }
View Full Code Here

  public Query createNamedQuery(String name) {
    return buildQueryFromName( name, null );
  }

  private <T> TypedQuery<T> buildQueryFromName(String name, Class<T> resultType) {
    OgmSessionFactory sessionFactory = (OgmSessionFactory) factory.getSessionFactory();
    NamedQueryDefinition queryDefinition = sessionFactory.getNamedSQLQuery( name );
    if ( queryDefinition == null ) {
      queryDefinition = sessionFactory.getNamedQuery( name );
      if ( queryDefinition == null ) {
        throw new IllegalArgumentException( "Named query not found: " + name );
      }
      else {
        return createNamedJpqlQuery( queryDefinition, resultType );
View Full Code Here

  }

  private OgmSession buildOgmSession(Session session) {
    final SessionFactory sessionFactory = ( (HibernateEntityManagerFactory) hibernateEm.getEntityManagerFactory() )
        .getSessionFactory();
    final OgmSessionFactory ogmSessionFactory = new OgmSessionFactoryImpl( (SessionFactoryImplementor) sessionFactory );
    return new OgmSession( ogmSessionFactory, (EventSource) session );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.ogm.OgmSessionFactory

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.