Best code examples for Hibernate ORM StandardServiceRegistryBuilder class (org.hibernate.boot.registry.StandardServiceRegistryBuilder)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM StandardServiceRegistryBuilder class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Hibernate ORM StandardServiceRegistryBuilder examples from Open Source projects
This code example shows how to use the following methods: applySettings, build
	 
	List results = new ArrayList();
	 
	public void analyze(Configuration cfg) {
		 
		StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
		builder.applySettings(cfg.getProperties());
		ServiceRegistry serviceRegistry = builder.build();
		Settings settings = cfg.buildSettings(serviceRegistry);
		 
		for (int i = 0; i < detectors.length; i++) {
			detectors[i].initialize( cfg, settings );
			detectors[i].visit(cfg, this);
		} 
					 
	} 
	 
	/* (non-Javadoc) 
	 * @see org.hibernate.tool.hbmlint.IssueCollector#reportProblem(org.hibernate.tool.hbmlint.Issue) 
	 */ 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: applySettings, build
		} 
				 
	} 
	 
	public void testReadSchemaIncremental() { 
		StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
		builder.applySettings(cfg.getProperties());
		ServiceRegistry serviceRegistry = builder.build();
 
		Settings buildSettings = cfg.buildSettings(serviceRegistry);
 
		TableSelectorStrategy tss = new TableSelectorStrategy(new DefaultReverseEngineeringStrategy());
		MockedMetaDataDialect mockedMetaDataDialect = new MockedMetaDataDialect();
		JDBCReader reader = JDBCReaderFactory.newJDBCReader( buildSettings, tss, mockedMetaDataDialect, serviceRegistry);
		 
		tss.addSchemaSelection( new SchemaSelection(null,null, "CHILD") );
		 
		DatabaseCollector dc = new DefaultDatabaseCollector(reader.getMetaDataDialect());
		reader.readDatabaseSchema( dc, null, null );
		 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: applySettings, build
		} 
	} 
 
	private OverrideRepository buildOverrideRepository() { 
		if(settings==null) {
			StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
			//builder.configure(); 
			builder.applySettings(Environment.getProperties());
			ServiceRegistry serviceRegistry = builder.build();
			 
			settings = new SettingsFactory() {
				// trick to get hibernate.properties settings for defaultschema/catalog in here 
			}.buildSettings(Environment.getProperties(), serviceRegistry);
		} 
		//return new OverrideRepository(settings.getDefaultCatalogName(),settings.getDefaultSchemaName()); 
		return new OverrideRepository(); 
	} 
	 
	protected String[] getCreateSQL() {
		return new String[] {
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
 
	@BeforeClass 
	public static void geraBanco(){ 
		Configuration cfg = new Configuration();
		cfg.addAnnotatedClass(PessoaFisica.class);
		ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(cfg.getProperties()).build();        
        factory = cfg.buildSessionFactory(serviceRegistry);
	} 
	 
	@Test
	public void shouldSaveAndLoadEntityMappedWithCpfUserType(){ 
		Session session = factory.openSession();
		Transaction transaction = session.beginTransaction();
		PessoaFisica pessoa = new PessoaFisica();
		CPF cpf = new CPF("555.555.555-55");
		pessoa.setCpf(cpf);
		session.save(pessoa);
		transaction.commit();
		session.flush();
		session.close();
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: applySettings, build
 
	} 
 
	public void initialize(Configuration cfg, Settings settings) {
		super.initialize( cfg, settings );
		StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
		builder.applySettings(cfg.getProperties());
		ServiceRegistry serviceRegistry = builder.build();
		 
		dialect = serviceRegistry.getService(JdbcServices.class).getDialect();
 
		tableSelector = new TableSelectorStrategy(
				new DefaultReverseEngineeringStrategy() ); 
		reader = JDBCReaderFactory.newJDBCReader( cfg.getProperties(),
				settings, tableSelector, serviceRegistry);
		dbc = new DefaultDatabaseCollector(reader.getMetaDataDialect());
		mapping = cfg.buildMapping();
	} 
 
	public void visit(Configuration cfg, IssueCollector collector) {
Full Snippet Info
6
CodeRank