新手问一个hql语句非常简单的有关问题
新手问一个hql语句非常简单的问题。
下面是两条hql语句:
"from Application as a where"+"a.attend.employee=?"
"from Attend as a where a.employee=? and"+"a.duty=?"
请问一下里面的加号怎么来的。平时拼凑hql语句也要加号吗?有没有什么规则?
------解决方案--------------------
"from Application as a where a.attend.employee=?"
"from Attend as a where a.employee=? and a.duty=?"
这样就行,+号都是在要连接变量时使用。
------解决方案--------------------
我也是这么认为的
------解决方案--------------------
最好不要用“+”,要用绑定变量。可以提高效率和安全性。
下面是两条hql语句:
"from Application as a where"+"a.attend.employee=?"
"from Attend as a where a.employee=? and"+"a.duty=?"
请问一下里面的加号怎么来的。平时拼凑hql语句也要加号吗?有没有什么规则?
------解决方案--------------------
"from Application as a where a.attend.employee=?"
"from Attend as a where a.employee=? and a.duty=?"
这样就行,+号都是在要连接变量时使用。
------解决方案--------------------
我也是这么认为的
------解决方案--------------------
最好不要用“+”,要用绑定变量。可以提高效率和安全性。