类org.hibernate.cfg.AnnotationConfiguration源码实例Demo

下面列出了怎么用org.hibernate.cfg.AnnotationConfiguration的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: maven-framework-project   文件: HibernateUtil.java
private static SessionFactory buildSessionFactory() {
    try {
        // Create the SessionFactory from hibernate.cfg.xml
        return new AnnotationConfiguration()
        		.configure()
                .buildSessionFactory();
    } catch (Throwable ex) {
        System.err.println("Initial SessionFactory creation failed." + ex);
        throw new ExceptionInInitializerError(ex);
    }
}
 
源代码2 项目: maven-framework-project   文件: HibernateUtil.java
private static SessionFactory buildSessionFactory() {
    try {
        // Create the SessionFactory from hibernate.cfg.xml
        return new AnnotationConfiguration()
        		.configure()
                .buildSessionFactory();
    } catch (Throwable ex) {
        System.err.println("Initial SessionFactory creation failed." + ex);
        throw new ExceptionInInitializerError(ex);
    }
}
 
源代码3 项目: maven-framework-project   文件: HibernateUtil.java
private static SessionFactory buildSessionFactory() {
    try {
        // Create the SessionFactory from hibernate.cfg.xml
        return new AnnotationConfiguration()
        		.configure()
                .buildSessionFactory();
    } catch (Throwable ex) {
        System.err.println("Initial SessionFactory creation failed." + ex);
        throw new ExceptionInInitializerError(ex);
    }
}
 
源代码4 项目: maven-framework-project   文件: HibernateUtil.java
private static SessionFactory buildSessionFactory() {
    try {
        // Create the SessionFactory from hibernate.cfg.xml
        return new AnnotationConfiguration()
        		.configure()
                .buildSessionFactory();
    } catch (Throwable ex) {
        System.err.println("Initial SessionFactory creation failed." + ex);
        throw new ExceptionInInitializerError(ex);
    }
}
 
源代码5 项目: maven-framework-project   文件: HibernateUtil.java
private static SessionFactory buildSessionFactory() {
    try {
        // Create the SessionFactory from hibernate.cfg.xml
        return new AnnotationConfiguration()
        		.configure()
                .buildSessionFactory();
    } catch (Throwable ex) {
        System.err.println("Initial SessionFactory creation failed." + ex);
        throw new ExceptionInInitializerError(ex);
    }
}
 
源代码6 项目: maven-framework-project   文件: HibernateUtil.java
private static SessionFactory buildSessionFactory() {
    try {
        // Create the SessionFactory from hibernate.cfg.xml
        return new AnnotationConfiguration()
        		.configure()
                .buildSessionFactory();
    } catch (Throwable ex) {
        System.err.println("Initial SessionFactory creation failed." + ex);
        throw new ExceptionInInitializerError(ex);
    }
}
 
源代码7 项目: maven-framework-project   文件: HibernateUtil.java
private static SessionFactory buildSessionFactory() {
    try {
        // Create the SessionFactory from hibernate.cfg.xml
        return new AnnotationConfiguration()
        		.configure()
                .buildSessionFactory();
    } catch (Throwable ex) {
        System.err.println("Initial SessionFactory creation failed." + ex);
        throw new ExceptionInInitializerError(ex);
    }
}
 
源代码8 项目: maven-framework-project   文件: HibernateUtil.java
private static SessionFactory buildSessionFactory() {
    try {
        // Create the SessionFactory from hibernate.cfg.xml
        return new AnnotationConfiguration()
        		.configure()
                .buildSessionFactory();
    } catch (Throwable ex) {
        System.err.println("Initial SessionFactory creation failed." + ex);
        throw new ExceptionInInitializerError(ex);
    }
}
 
源代码9 项目: maven-framework-project   文件: HibernateUtil.java
private static SessionFactory buildSessionFactory() {
    try {
        // Create the SessionFactory from hibernate.cfg.xml
        return new AnnotationConfiguration()
        		.configure()
                .buildSessionFactory();
    } catch (Throwable ex) {
        System.err.println("Initial SessionFactory creation failed." + ex);
        throw new ExceptionInInitializerError(ex);
    }
}
 
源代码10 项目: maven-framework-project   文件: HibernateUtil.java
private static SessionFactory buildSessionFactory() {
	try {
		// Create the SessionFactory from hibernate.cfg.xml
		return new AnnotationConfiguration().configure()
				.buildSessionFactory();

	} catch (Throwable ex) {
		System.err.println("Initial SessionFactory creation failed." + ex);
		throw new ExceptionInInitializerError(ex);
	}
}
 
源代码11 项目: poli-libras   文件: SQLiteDictionary.java
public SQLiteDictionary(){
	
	Configuration configSqlite = new AnnotationConfiguration().setProperty("hibernate.connection.url", DATABASE_URL);
	SessionFactory sessions = configSqlite.configure().buildSessionFactory();
	Session session = sessions.openSession();        
       SignDaoFactory<Sign> factory = new SignDaoFactory<Sign>(session);
       this.dao = factory.getSignDao();

}
 
/**
 * @see AnnotationSessionFactoryBean#postProcessAnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration)
 */
@Override
protected void postProcessAnnotationConfiguration(
        AnnotationConfiguration config) throws HibernateException {
    Set<Class<?>> annClasses = scanAnnotatedClasses(); // Scan enity
    // classes.
    // Add entity classes to the configuration.
    if (!CollectionUtils.isEmpty(annClasses)) {
        for (Class<?> annClass : annClasses) {
            config.addAnnotatedClass(annClass);
        }
    }
}
 
源代码13 项目: livingdoc-core   文件: HibernateDatabase.java
public HibernateDatabase(Properties properties) throws HibernateException {
    cfg = new AnnotationConfiguration();
    cfg.setProperties(properties);
    setAnnotadedClasses();
    loadConfig();
}
 
源代码14 项目: java-course-ee   文件: HibernateSimple.java
private SessionFactory getSessionFactory() {
    return new AnnotationConfiguration().configure().buildSessionFactory();
}
 
 类所在包
 类方法
 同包方法