hibernate4 获取sessionFactory
来源:互联网 发布:js统计页面访问次数 编辑:程序博客网 时间:2024/06/05 09:39
public static SessionFactory getFactory(){Configuration configuration =new Configuration(); configuration.configure(); ServiceRegistry serviceRegistry =new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry(); SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry); return sessionFactory;}
hibernate配置
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"><hibernate-configuration><session-factory> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver </property> <property name="hibernate.connection.url">jdbc:mysql://localhost/test </property> <property name="hibernate.connection.username">root </property> <property name="hibernate.connection.password">root </property> <property name="hibernate.connection.pool.size">20 </property> <property name="hibernate.show_sql">true </property> <property name="jdbc.fetch_size">50 </property> <property name="jdbc.batch_size">23 </property> <property name="jdbc.use_scrollable_resultset">false </property> <property name="Connection.useUnicode">true </property> <property name="connection.characterEncoding">gbk </property> <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect </property> <mapping class="qwer.re.tte.StudentBean"/> <mapping class="qwer.re.tte.TeacherBean"/> <mapping class="qwer.re.tte.StuTea"/> </session-factory></hibernate-configuration>
0 0
- Hibernate4中获取SessionFactory
- hibernate4 获取sessionFactory
- hibernate4获取SessionFactory
- Hibernate4 获取SessionFactory 的方式
- Hibernate4 获取SessionFactory 的方式
- Hibernate4中获取SessionFactory的方法
- Hibernate4.3.9获取SessionFactory的方法
- Hibernate4 获取SessionFactory 的2种方式
- Spring4+Hibernate4整合,关于获取SessionFactory
- Hibernate、Hibernate4获取SessionFactory对象方法的变化
- Hibernate、Hibernate4获取SessionFactory对象方法的变化
- hibernate4 spring3 sessionFactory
- Hibernate4的SessionFactory
- Hibernate4如何创建SessionFactory…
- Hibernate4.3.1创建SessionFactory方法
- Hibernate4中SessionFactory已过时
- Spring3与hibernate4整合,sessionFactory.getCurrentSession()方法获取不到Session对象异常解决办法
- hibernate4.0中SessionFactory的创建
- 第88讲:Scala中使用For表达式实现map、flatMap、filter
- 打包过程整理
- 关机相关命令,sync,shutdown,poweroff,reboot,halt
- MacBook Pro安装Photoshop且支持Retina有你们说的那么困难吗!
- 初学C#斐波那契三解
- hibernate4 获取sessionFactory
- 论述EFW.MIT.WinForm框架主窗体上下文的行为模式
- 宏定义的使用详细总结
- ubuntu配置DNS
- java readLine
- android.os.NetworkOnMainThreadException异常
- linux 下解压,tar,rar,zip
- man 命令 的使用方法
- opencv中convexHull函数说明