Examples of buildSessionFactory()


Examples of org.hibernate.cfg.Configuration.buildSessionFactory()

      {
         cfg.setInterceptor( interceptorInstance );
      }

      // Generate sf....
      sessionFactory = cfg.buildSessionFactory();

      try
      {
         // Handle stat-mbean creation/registration....
         if ( sessionFactory.getStatistics() != null && sessionFactory.getStatistics().isStatisticsEnabled() )
View Full Code Here

Examples of org.hibernate.cfg.Configuration.buildSessionFactory()

   }
   public void sessionInit( )
      throws HibernateException
   {
      Configuration cfg = new Configuration().configure();
      SessionFactory sf = cfg.buildSessionFactory();
      System.out.println("Initialized session: "+sf);
   }

   public Person loadUser(long id) throws HibernateException
   {
View Full Code Here

Examples of org.hibernate.cfg.Configuration.buildSessionFactory()

      fis.close();
      configuration.addProperties(properties);
      log.debug("Full Hibernate Plugin's Session Factory property file \"/"+fileProperties+"\" configured");
    }
   
    SessionFactory sessionFactory = configuration.buildSessionFactory();
   
    Session testSession = sessionFactory.openSession();
    testSession.connection().getMetaData().getCatalogs();
    testSession.close();
    return sessionFactory;
View Full Code Here

Examples of org.hibernate.cfg.Configuration.buildSessionFactory()

          cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" )
      );
      cfg.addResource( getBaseForMappings() + "extendshbm/Person.hbm.xml" );
      cfg.addResource( getBaseForMappings() + "extendshbm/Employee.hbm.xml" );

      cfg.buildSessionFactory();

      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" ) );
      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Person" ) );
      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Employee" ) );
View Full Code Here

Examples of org.hibernate.cfg.Configuration.buildSessionFactory()

          "cannot be in the configuration yet!",
          cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" )
      );
      cfg.addResource( getBaseForMappings() + "extendshbm/Employee.hbm.xml" );

      cfg.buildSessionFactory();

      fail( "Should not be able to build sessionfactory without a Person" );
    }
    catch ( HibernateException e ) {
View Full Code Here

Examples of org.hibernate.cfg.Configuration.buildSessionFactory()

    Configuration cfg = new Configuration();

    try {
      cfg.addResource( getBaseForMappings() + "extendshbm/allseparateinone.hbm.xml" );

      cfg.buildSessionFactory();

      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" ) );
      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Person" ) );
      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Employee" ) );
View Full Code Here

Examples of org.hibernate.metamodel.source.MetadataImplementor.buildSessionFactory()

        false
    );
    if ( isMetadataUsed ) {
      MetadataImplementor metadataImplementor = buildMetadata( bootRegistry, serviceRegistry );
      afterConstructAndConfigureMetadata( metadataImplementor );
      sessionFactory = ( SessionFactoryImplementor ) metadataImplementor.buildSessionFactory();
    }
    else {
      // this is done here because Configuration does not currently support 4.0 xsd
      afterConstructAndConfigureConfiguration( configuration );
      sessionFactory = ( SessionFactoryImplementor ) configuration.buildSessionFactory( serviceRegistry );
View Full Code Here

Examples of org.hibernate.ogm.cfg.OgmConfiguration.buildSessionFactory()

   */
  private void tryBoot(String configurationResourceName) {
    Configuration cfg = new OgmConfiguration();
    cfg.setProperty( OgmProperties.DATASTORE_PROVIDER, "infinispan" );
    cfg.setProperty( InfinispanProperties.CONFIGURATION_RESOURCE_NAME, configurationResourceName );
    SessionFactory sessionFactory = cfg.buildSessionFactory();
    if ( sessionFactory != null ) {
      try {
        // trigger service initialization, and also verifies it actually uses Infinispan:
        InfinispanTestHelper.getProvider( sessionFactory );
      }
View Full Code Here

Examples of org.hibernate.ogm.cfg.OgmConfiguration.buildSessionFactory()

    createServerAdminUser();
    createTestDatabase();
    createDatabaseUser();

    sessions = configuration.buildSessionFactory();
  }

  @AfterClass
  public static void dropDatabaseAndDeleteAdminUser() throws Exception {
    closeSessionFactory();
View Full Code Here

Examples of org.hibernate.ogm.cfg.OgmConfiguration.buildSessionFactory()

    if ( associationStorage != null ) {
      configuration.getProperties().put( DocumentStoreProperties.ASSOCIATIONS_STORE, associationStorage );
    }

    sessions = configuration.buildSessionFactory();
  }

  private BasicDBObject getGolfCourse() {
    BasicDBObject bepplePeach = new BasicDBObject();
    bepplePeach.put( "_id", 1L );
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.