Created
October 6, 2016 12:52
-
-
Save khajavi/12e96bf65bf337baf54de4220f683491 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static SessionFactory factory; | |
private static ServiceRegistry serviceRegistry; | |
public static SessionFactory createSessionFactory() { | |
Configuration configuration = | |
new Configuration() | |
.configure() | |
.addAnnotatedClass(Employee.class); | |
serviceRegistry = new ServiceRegistryBuilder().applySettings( | |
configuration.getProperties()).buildServiceRegistry(); | |
factory = configuration.buildSessionFactory(serviceRegistry); | |
return factory; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment