Skip to content

Commit

Permalink
JavaEE Enterprise Basic Development Platform
Browse files Browse the repository at this point in the history
New version 4.4.0-RELEASE_fixed.1 release!

# fixed Hibernate JPA Named Parameter bugs.
  • Loading branch information
ushelp committed Dec 26, 2017
1 parent 4cdc338 commit 21e67dc
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 170 deletions.
Original file line number Diff line number Diff line change
@@ -1,60 +1,6 @@
package cn.easyproject.easyee.sh.base.util;


/**
* 按条件查询抽象父类(可以结合分页PageBean使用)
*
* SysUserCriteria Demo: <br>
*
* <pre><code>
* public class SysUserCriteria extends EasyCriteria implements java.io.Serializable {
* // 1. Criteria field
* private String name;
* private String realName;
* private Integer status; // 0 is ON; 1 is OFF; 2 is REMOVED
*
* // 2. Constructor
* public SysUserCriteria() {
* }
*
* public SysUserCriteria(String name, String realName, Integer status) {
* super();
* this.name = name;
* this.realName = realName;
* this.status = status;
* }
*
* // 3. Condition genertator abstract method implements
* public String getCondition() {
* values.clear(); // **Must clear old values**
* StringBuffer condition = new StringBuffer();
* if (StringUtils.isNotNullAndEmpty(this.getName())) {
* condition.append(" and name like ?");
* values.add("%" + this.getName() + "%");
* }
* if (StringUtils.isNotNullAndEmpty(this.getRealName())) {
* condition.append(" and realName like ?");
* values.add("%" + this.getRealName() + "%");
* }
* if (StringUtils.isNotNullAndEmpty(this.getStatus())) {
* condition.append(" and status=?");
* values.add(this.getStatus());
* }
* return condition.toString();
* }
*
* // 4. Setters&amp;Getters...
*
* }
* </code></pre>
*
* @author Ray
* @author [email protected]
* @author easyproject.cn
* @since 1.0.0
*/


import java.util.HashMap;
import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void delete(String[] empnos) {
public int findEmpCountByDeptno(int deptno) {
Map<String, Object> params=new HashMap<String, Object>();
params.put("deptno", deptno);
return commonDAO.findCount("select count(emp) from Emp emp where emp.dept.deptno=?", params);
return commonDAO.findCount("select count(emp) from Emp emp where emp.dept.deptno=:deptno", params);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public List getAllPermissionsIds(int roleId) {
Map<String, Object> params=new HashMap<String, Object>();
params.put("roleId", roleId);

List menuIds=commonDAO.findMapResultBySQL("select 'menu' as TYPE,menu_Permission_Id as ID from sys_role_menu where ROLE_ID=?",params);
List permissionIds=commonDAO.findMapResultBySQL("select 'operation' as TYPE,Operation_Permission_Id as ID from sys_role_operation where ROLE_ID=?",params);
List menuIds=commonDAO.findMapResultBySQL("select 'menu' as TYPE,menu_Permission_Id as ID from sys_role_menu where ROLE_ID=:roleId",params);
List permissionIds=commonDAO.findMapResultBySQL("select 'operation' as TYPE,Operation_Permission_Id as ID from sys_role_operation where ROLE_ID=:roleId",params);
//返回所有权限id
menuIds.addAll(permissionIds);
return menuIds;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,60 +1,5 @@
package cn.easyproject.easyee.sh.base.util;


/**
* 按条件查询抽象父类(可以结合分页PageBean使用)
*
* SysUserCriteria Demo: <br>
*
* <pre><code>
* public class SysUserCriteria extends EasyCriteria implements java.io.Serializable {
* // 1. Criteria field
* private String name;
* private String realName;
* private Integer status; // 0 is ON; 1 is OFF; 2 is REMOVED
*
* // 2. Constructor
* public SysUserCriteria() {
* }
*
* public SysUserCriteria(String name, String realName, Integer status) {
* super();
* this.name = name;
* this.realName = realName;
* this.status = status;
* }
*
* // 3. Condition genertator abstract method implements
* public String getCondition() {
* values.clear(); // **Must clear old values**
* StringBuffer condition = new StringBuffer();
* if (StringUtils.isNotNullAndEmpty(this.getName())) {
* condition.append(" and name like ?");
* values.add("%" + this.getName() + "%");
* }
* if (StringUtils.isNotNullAndEmpty(this.getRealName())) {
* condition.append(" and realName like ?");
* values.add("%" + this.getRealName() + "%");
* }
* if (StringUtils.isNotNullAndEmpty(this.getStatus())) {
* condition.append(" and status=?");
* values.add(this.getStatus());
* }
* return condition.toString();
* }
*
* // 4. Setters&amp;Getters...
*
* }
* </code></pre>
*
* @author Ray
* @author [email protected]
* @author easyproject.cn
* @since 1.0.0
*/


import java.util.HashMap;
import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void delete(String[] empnos) {
public int findEmpCountByDeptno(int deptno) {
Map<String, Object> params=new HashMap<String, Object>();
params.put("deptno", deptno);
return commonDAO.findCount("select count(emp) from Emp emp where emp.dept.deptno=?", params);
return commonDAO.findCount("select count(emp) from Emp emp where emp.dept.deptno=:deptno", params);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public List getAllPermissionsIds(int roleId) {
Map<String, Object> params=new HashMap<String, Object>();
params.put("roleId", roleId);

List menuIds=commonDAO.findMapResultBySQL("select 'menu' as TYPE,menu_Permission_Id as ID from sys_role_menu where ROLE_ID=?",params);
List permissionIds=commonDAO.findMapResultBySQL("select 'operation' as TYPE,Operation_Permission_Id as ID from sys_role_operation where ROLE_ID=?",params);
List menuIds=commonDAO.findMapResultBySQL("select 'menu' as TYPE,menu_Permission_Id as ID from sys_role_menu where ROLE_ID=:roleId",params);
List permissionIds=commonDAO.findMapResultBySQL("select 'operation' as TYPE,Operation_Permission_Id as ID from sys_role_operation where ROLE_ID=:roleId",params);
//返回所有权限id
menuIds.addAll(permissionIds);
return menuIds;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,58 +1,7 @@
package cn.easyproject.easyee.ssh.base.util;


/**
* 按条件查询抽象父类(可以结合分页PageBean使用)
*
* SysUserCriteria Demo: <br>
*
* <pre><code>
* public class SysUserCriteria extends EasyCriteria implements java.io.Serializable {
* // 1. Criteria field
* private String name;
* private String realName;
* private Integer status; // 0 is ON; 1 is OFF; 2 is REMOVED
*
* // 2. Constructor
* public SysUserCriteria() {
* }
*
* public SysUserCriteria(String name, String realName, Integer status) {
* super();
* this.name = name;
* this.realName = realName;
* this.status = status;
* }
*
* // 3. Condition genertator abstract method implements
* public String getCondition() {
* values.clear(); // **Must clear old values**
* StringBuffer condition = new StringBuffer();
* if (StringUtils.isNotNullAndEmpty(this.getName())) {
* condition.append(" and name like ?");
* values.add("%" + this.getName() + "%");
* }
* if (StringUtils.isNotNullAndEmpty(this.getRealName())) {
* condition.append(" and realName like ?");
* values.add("%" + this.getRealName() + "%");
* }
* if (StringUtils.isNotNullAndEmpty(this.getStatus())) {
* condition.append(" and status=?");
* values.add(this.getStatus());
* }
* return condition.toString();
* }
*
* // 4. Setters&amp;Getters...
*
* }
* </code></pre>
*
* @author Ray
* @author [email protected]
* @author easyproject.cn
* @since 1.0.0
*/



import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void delete(String[] empnos) {
public int findEmpCountByDeptno(int deptno) {
Map<String, Object> params=new HashMap<String, Object>();
params.put("deptno", deptno);
return commonDAO.findCount("select count(emp) from Emp emp where emp.dept.deptno=?", params);
return commonDAO.findCount("select count(emp) from Emp emp where emp.dept.deptno=:deptno", params);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public List getAllPermissionsIds(int roleId) {
Map<String, Object> params=new HashMap<String, Object>();
params.put("roleId", roleId);

List menuIds=commonDAO.findMapResultBySQL("select 'menu' as TYPE,menu_Permission_Id as ID from sys_role_menu where ROLE_ID=?",params);
List permissionIds=commonDAO.findMapResultBySQL("select 'operation' as TYPE,Operation_Permission_Id as ID from sys_role_operation where ROLE_ID=?",params);
List menuIds=commonDAO.findMapResultBySQL("select 'menu' as TYPE,menu_Permission_Id as ID from sys_role_menu where ROLE_ID=:roleId",params);
List permissionIds=commonDAO.findMapResultBySQL("select 'operation' as TYPE,Operation_Permission_Id as ID from sys_role_operation where ROLE_ID=:roleId",params);
//返回所有权限id
menuIds.addAll(permissionIds);
return menuIds;
Expand Down

0 comments on commit 21e67dc

Please sign in to comment.