ECLIPSE连接池里可以配置啊。文件自动生成。

解决方案 »

  1.   

    <one-to-one> 查一下hibernate的文档
      

  2.   

    代码如下:
    Customer和Lifetests一对一:在Customer的映射文件里:<one-to-one
    name="lifeTests"
    class="com.cafuc.module.Lifetests"
    cascade="all"/>在Lifetests配置文件里:1、首先对ID进行配置:
    <id name="id" column="id" type="long">
    <generator class="foreign">
    <param name="property">customer</param>
    </generator>
    </id>2、<one-to-one>配置<one-to-one
    name="customer"
    class="Customer"
    constrained="true"
    />3、数据库中lifetests表的主键id,你千万别设置成自增,可设置为0,否则会报错!
    楼主好运!