Hibernate中Criteria连接查询 使用别名 createAlias

//添加过滤条件,根据省份模糊查询-----多表关联查询,使用别名方式实现
//参数一:分区对象中关联的区域对象属性名称
//参数二:别名,可以任意
dc.createAlias("region", "r");
dc.add(Restrictions.like("r.province", "%"+province+"%"));

猜你喜欢

转载自blog.csdn.net/qq_35232663/article/details/80461762