用户登录
用户注册

分享至

hibernate with

  • 作者: 穆罕默德-本-拉希-德阿勒马克图姆
  • 来源: 51数据库
  • 2020-10-01
inner join(内连接)

left outer join(左外连接)

right outer join(右外连接)

full join (全连接,并不常用)

HQL中的条件用with即:left join ... with...

SQL中的条件用on即:left join ... on...

语句inner join, left outer join 以及 right outer join 可以简写。
from Cat as cat join cat.mate as mate left join cat.kittens as kitten

通过HQL的with关键字,你可以提供额外的join条件。
from Cat as cat left join cat.kittens as kitten with kitten.bodyWeight > 10.0

由此可见,HQL的with就是sql中ON的用法



  你可以试试看用new simpledateformat("yyyy-mm-dd hh:mm:ss").format(begintime); 转换为string
然后用oracle本身的函数to_date("2008-11-11 11:11:11", "yyyy-mm-dd hh24:mi:ss");

string formatbgstring = new simpledateformat("yyyy-mm-dd hh:mm:ss").format(begintime);
string formatendstring = new simpledateformat("yyyy-mm-dd hh:mm:ss").format(begintime);

"and t.begintime > to_date('" + formatbgstring + "', 'yyyy-mm-dd hh24:mi:ss') and t.endtime < to_date('"="" +="" formatendstring="" +="" "',="" 'yyyy-mm-dd="">
软件
前端设计
程序设计
Java相关