Best code examples for Hibernate ORM Configuration class (org.hibernate.cfg.Configuration)

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

Hibernate ORM Configuration examples from Open Source projects
This code example shows how to use the following methods:
62:	return new Configuration(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: buildSessionFactory, configure, setProperty
41:	Configuration cfg = new Configuration(); 
-
78:	cfg.configure(file); 
-
86:	cfg.setProperty("hibernate.connection.url", "jdbc:mysql://" + dbHost + ":" + dbPort + "/" + dbName); 
87:	cfg.setProperty("hibernate.connection.username", dbUser); 
88:	cfg.setProperty("hibernate.connection.password", dbPassword); 
-
91:	factory = cfg.buildSessionFactory(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods:
238:	Configuration config = new Configuration().configure(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: buildSessionFactory, configure, setProperty
42:	Configuration cfg = new Configuration(); 
-
79:	cfg.configure(file); 
-
87:	cfg.setProperty("hibernate.connection.url", "jdbc:mysql://" + dbHost + ":" + dbPort + "/" + dbName); 
88:	cfg.setProperty("hibernate.connection.username", dbUser); 
89:	cfg.setProperty("hibernate.connection.password", dbPassword); 
-
92:	factory = cfg.buildSessionFactory(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: buildSessionFactory, configure
63:	Configuration configuration = new Configuration(); 
-
65:	configuration = configuration.configure(); 
-
67:	_sessionFactory = configuration.buildSessionFactory(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addAnnotatedClass, buildSessionFactory, setProperty
46:	Configuration config = new Configuration(); 
47:	config.addAnnotatedClass( Product.class ); 
-
49:	config.setProperty( "hibernate.search.lucene_version", TestConstants.getTargetLuceneVersion().toString() ); 
50:	config.setProperty( "hibernate.search.default.directory_provider", "ram" ); 
51:	config.setProperty( "hibernate.search.default.indexBase", TestConstants.getIndexDirectory( TokenizationTest.class ) ); 
-
53:	config.buildSessionFactory(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setProperty
35:	super.configure( cfg ); 
36:	cfg.setProperty( "hibernate.search.worker.scope", "transaction" ); 
37:	cfg.setProperty( "hibernate.search.default.worker.execution", "async" ); 
38:	cfg.setProperty( "hibernate.search.default.worker.thread_pool.size", "1" ); 
39:	cfg.setProperty( "hibernate.search.default.worker.buffer_queue.max", "10" ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addAnnotatedClass, addProperties, buildSessionFactory
30:	Configuration cfg = new Configuration(); 
31:	cfg.addAnnotatedClass( Author.class ); 
32:	cfg.addAnnotatedClass( Book.class ); 
33:	cfg.addProperties( getHibernateProperties() ); 
34:	return cfg.buildSessionFactory(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
21:	super(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addFile, buildMappings
80:	Configuration cfg = new Configuration(); 
-
82:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Car.hbm.xml")); 
83:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "CarPart.hbm.xml")); 
-
85:	cfg.buildMappings(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addAnnotatedClass, buildSessionFactory, getProperties
51:	Configuration hibernateConfiguration = new Configuration(); 
-
53:	hibernateConfiguration.addAnnotatedClass( Foo.class ); 
-
56:	hibernateConfiguration.getProperties().putAll( properties ); 
-
59:	registryBuilder.applySettings( hibernateConfiguration.getProperties() ); 
-
63:	hibernateConfiguration.buildSessionFactory( serviceRegistry ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: buildMappings, getClassMapping
80:	derived.buildMappings(); 
-
82:	PersistentClass cl = derived.getClassMapping( "Withversion" ); 
-
88:	cl = derived.getClassMapping( "Noversion" ); 
-
93:	cl = derived.getClassMapping( "Withrealtimestamp" ); 
-
99:	cl = derived.getClassMapping( "Withfaketimestamp" ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: configure, setProperties, buildSessionFactory, addFilterDefinition
32:	AnnotationConfiguration cfg = new AnnotationConfiguration(); 
33:	cfg.addFilterDefinition(new FilterDefinition("securityFilter", 
-
35:	cfg.configure(testCfg); 
36:	cfg.setProperties(props); 
37:	sessionFactory = cfg.buildSessionFactory(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addFile, buildMappings
72:	Configuration cfg = new Configuration(); 
-
74:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + mappingFile)); 
-
76:	cfg.buildMappings(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addAnnotatedClass, buildSessionFactory, setProperty
44:	Configuration config = new Configuration(); 
45:	config.addAnnotatedClass( Entity1.class ); 
46:	config.addAnnotatedClass( Entity2.class ); 
47:	config.setProperty( "hibernate.search.default.directory_provider", "ram" ); 
-
49:	config.buildSessionFactory(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addFile, buildMappings
95:	Configuration cfg = new Configuration(); 
-
97:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Car.hbm.xml")); 
98:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "CarPart.hbm.xml")); 
-
100:	cfg.buildMappings(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
125:	return new Configuration() 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setProperty
66:	cfg.setProperty( 
-
70:	cfg.setProperty( 
-
74:	cfg.setProperty( "hibernate.search.default.refresh", "1" ); 
75:	cfg.setProperty( 
-
78:	cfg.setProperty( org.hibernate.cfg.Environment.HBM2DDL_AUTO, "create-drop" ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addAnnotatedClass, buildSessionFactory
174:	AnnotationConfiguration cfg = new AnnotationConfiguration(); 
-
176:	cfg.addAnnotatedClass( classUnderTest ); 
177:	cfg.addAnnotatedClass( Person.class ); 
178:	cfg.addAnnotatedClass( Being.class ); 
179:	SessionFactoryImplementor factory = ( SessionFactoryImplementor ) cfg.buildSessionFactory( serviceRegistry ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addFile, buildMappings
58:	Configuration cfg = new Configuration(); 
-
60:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Person.hbm.xml")); 
61:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Address.hbm.xml")); 
-
63:	cfg.buildMappings(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getProperties, setProperty
55:	super.configure( cfg ); 
56:	TestingJtaBootstrap.prepare( cfg.getProperties() ); 
57:	cfg.setProperty( Environment.TRANSACTION_STRATEGY, CMTTransactionFactory.class.getName() ); 
58:	cfg.setProperty( Environment.AUTO_CLOSE_SESSION, "true" ); 
59:	cfg.setProperty( Environment.FLUSH_BEFORE_COMPLETION, "true" ); 
60:	cfg.setProperty( Environment.RELEASE_CONNECTIONS, ConnectionReleaseMode.AFTER_STATEMENT.toString() ); 
61:	cfg.setProperty( Environment.GENERATE_STATISTICS, "true" ); 
62:	cfg.setProperty( Environment.STATEMENT_BATCH_SIZE, "0" ); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addAnnotatedClass, buildSessionFactory, getProperties
41:	Configuration configuration = new Configuration(); 
42:	configuration.addAnnotatedClass( A.class ); 
43:	configuration.addAnnotatedClass( B.class ); 
44:	configuration.addAnnotatedClass( C.class ); 
45:	configuration.buildSessionFactory( ServiceRegistryBuilder.buildServiceRegistry( configuration.getProperties() ) ); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
49:	public JPosHibernateConfiguration() 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addFile, buildMappings
73:	Configuration cfg = new Configuration(); 
-
75:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Fee.hbm.xml")); 
76:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Glarch.hbm.xml")); 
-
78:	cfg.buildMappings(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setProperty
56:	cfg.setProperty( "hibernate.session_factory_name", "java:comp/SessionFactory" ); 
57:	cfg.setProperty( "hibernate.jndi.class", "org.osjava.sj.SimpleContextFactory" ); 
58:	cfg.setProperty( "hibernate.jndi.org.osjava.sj.root", simpleJndiDir.getAbsolutePath() ); 
59:	cfg.setProperty( "hibernate.jndi.org.osjava.sj.jndi.shared", "true" ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
10:	Configuration config = new Configuration(). 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addFile, buildMappings
62:	Configuration cfg = new Configuration(); 
-
64:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Alien.hbm.xml")); 
65:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Human.hbm.xml")); 
66:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Animal.hbm.xml")); 
-
68:	cfg.buildMappings(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setListener
31:	configuration.setListener("flush-entity", new HibernateDataChangePublishListener()); 
32:	configuration.setListener("post-insert", new HibernateDataChangePublishListener()); 
33:	configuration.setListener("post-update", new HibernateDataChangePublishListener()); 
34:	configuration.setListener("post-delete", new HibernateDataChangePublishListener()); 
35:	configuration.setListener("pre-collection-update", new HibernateDataChangePublishListener()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
42:	final Configuration cfg = new Configuration() 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addFile, buildMappings
73:	Configuration cfg = new Configuration(); 
-
75:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Fee.hbm.xml")); 
76:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Glarch.hbm.xml")); 
-
78:	cfg.buildMappings(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setListener
31:	configuration.setListener("flush-entity", new Hibernate35DataChangePublishListener()); 
32:	configuration.setListener("post-insert", new Hibernate35DataChangePublishListener()); 
33:	configuration.setListener("post-update", new Hibernate35DataChangePublishListener()); 
34:	configuration.setListener("post-delete", new Hibernate35DataChangePublishListener()); 
35:	configuration.setListener("pre-collection-update", new Hibernate35DataChangePublishListener()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
46:	sessionFactory = new Configuration() 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addFile, buildMappings
69:	Configuration cfg = new Configuration(); 
-
71:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "User2.hbm.xml")); 
72:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Group2.hbm.xml")); 
-
74:	cfg.buildMappings(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
47:	sessionFactory = new Configuration() 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addFile, buildMappings
56:	Configuration cfg = new Configuration(); 
-
58:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "User.hbm.xml")); 
59:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Group.hbm.xml")); 
-
61:	cfg.buildMappings(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
77:	new Configuration().addCacheableFile( mappingFile ); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addFile, buildMappings
73:	Configuration cfg = new Configuration(); 
-
75:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Fee.hbm.xml")); 
76:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Glarch.hbm.xml")); 
-
78:	cfg.buildMappings(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
48:	sessionFactory = (new Configuration()).configure().buildSessionFactory(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addFile, buildMappings
77:	Configuration cfg = new Configuration(); 
-
79:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "ComplexPropertyValue.hbm.xml")); 
80:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "IntegerPropertyValue.hbm.xml")); 
81:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "StringPropertyValue.hbm.xml")); 
82:	cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "PropertySet.hbm.xml")); 
-
84:	cfg.buildMappings(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: buildMappings, setProperty
34:	Configuration cfg = new Configuration(); 
35:	cfg.setProperty(Environment.DIALECT, HSQLDialect.class.getName()); 
-
42:	cfg.buildMappings(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
29:	private static final Configuration cfg = new Configuration(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
58:	cfg = new Configuration() 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
48:	sessionFactory = new Configuration().configure().buildSessionFactory(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
49:	this.configuration = new Configuration().configure(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
45:	Configuration conf = new Configuration().configure(getHiberanteCfgLocation()) 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
18:	.setProperty("hibernate.connection.url", "jdbc:h2:mem:foo;DB_CLOSE_DELAY=-1") 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
18:	SessionFactory sessionFactory = new Configuration() 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
18:	SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
18:	SessionFactory sessionFactory = new Configuration() 
Full Snippet Info
7
CodeRank
See Code Examples for Hibernate ORM Configuration Methods: