WEB开发网
开发学院软件开发Java 面向对象数据库 db4o 之旅,第 4 部分: 使用 dRS 阅读

面向对象数据库 db4o 之旅,第 4 部分: 使用 dRS

 2010-06-08 00:00:00 来源:WEB开发网   
核心提示: 清单 1. Hibernate 配置文件<hibernate-configuration><session-factory><propertyname="hibernate.connection.driver_class">oracle.j

清单 1. Hibernate 配置文件

<hibernate-configuration>   
 <session-factory> 
    <property name="hibernate.connection.driver_class"> 
  oracle.jdbc.driver.OracleDriver</property> 
    <property name="hibernate.connection.url"> 
  jdbc:oracle:thin:@192.168.1.173:1521:ora10g</property> 
    <property name="hibernate.connection.username">test</property> 
    <property name="hibernate.connection.password">test</property> 
    <property name="hibernate.connection.pool_size">1</property> 
    <property name="hibernate.dialect"> 
  org.hibernate.dialect.OracleDialect</property> 
    <property name="hibernate.show_sql">false</property> 
    <property name="hibernate.hbm2ddl.auto">update</property>   
    <property name="hibernate.jdbc.batch_size">0</property> 
   <mapping resource="bo/People.hbm.xml"/> 
   <mapping resource="bo/AutoInfo.hbm.xml"/> 
  </session-factory> 
</hibernate-configuration> 

万事具备,现在开始编写装载数据表的代码吧,请看 清单 2 中的代码,涉及到 dRS 的其实只有两行,由于 People 和 AutoInfo 对象之间是 one-to-many 的关系,故只需要关注 People。

上一页  1 2 3 4 5 6  下一页

Tags:面向 对象 数据库

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接