首页 新闻 会员 周边 捐助

Hibernate5.0是不支持一对多查询???

0
悬赏园豆:10 [已关闭问题] 关闭于 2019-12-11 14:46

在测试的hibernate的时候一直在运行 也不提示错误 也不提示失败 一直处于运行状态 但是数据没有提交 这是一个一对多的表查询,单表查询就没有问题,多对多查询也是一样不行,整了一天了都没解决,自学的hibernate,哪位大哥帮忙解决一下 谢谢

public class HibernateDemo1 {
@Test
public void demo1() {
Session session = HibernateUtils.getCurrentSession();
Transaction tx = session.beginTransaction();
//创建一个客户
Customer customer = new Customer();
customer.setCust_name("李冰");

for(int i = 1;i<=10;i++) {
    LinkMan linkMan = new LinkMan();
    linkMan.setLkm_name("凤姐"+i);
    linkMan.setCustomer(customer);
    customer.getLinkMans().add(linkMan);
    session.save(linkMan);
}
tx.commit();
}

}

Console:
00:29:04,142 INFO Version:37 - HHH000412: Hibernate Core {5.0.7.Final}
00:29:04,152 INFO Environment:213 - HHH000206: hibernate.properties not found
00:29:04,156 INFO Environment:317 - HHH000021: Bytecode provider name : javassist
00:29:04,813 INFO Version:66 - HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
00:29:06,650 WARN connections:71 - HHH10001002: Using Hibernate built-in connection pool (not for production use!)
00:29:06,674 INFO connections:127 - HHH10001005: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql:///hibernate_day04]
00:29:06,675 INFO connections:136 - HHH10001001: Connection properties: {user=steven, password=****}
00:29:06,675 INFO connections:141 - HHH10001003: Autocommit mode: false
00:29:06,676 INFO connections:146 - HHH10001007: JDBC isolation level: REPEATABLE_READ
00:29:06,679 INFO DriverManagerConnectionProviderImpl:39 - HHH000115: Hibernate connection pool size: 20 (min=1)
00:29:07,919 INFO Dialect:156 - HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
00:29:08,001 INFO LobCreatorBuilderImpl:98 - HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
00:29:10,347 INFO SchemaUpdate:105 - HHH000228: Running hbm2ddl schema update
控制台就输出以上的东西 也不继续执行了 不知道为什么?

烧鸭的主页 烧鸭 | 初学一级 | 园豆:101
提问于:2019-02-10 21:41
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册