?? functiondaoimpl.java
字號:
package com.jeecms.core.dao.impl;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.jeecms.core.JeeCoreDaoImpl;
import com.jeecms.core.dao.FunctionDao;
import com.jeecms.core.entity.Function;
@Repository
public class FunctionDaoImpl extends JeeCoreDaoImpl<Function> implements
FunctionDao {
@SuppressWarnings("unchecked")
@Override
public List<Function> getFunctions(Long adminId) {
String hql = "select func from Function func where func.id in"
+ " (select f1.id from Admin admin join admin.roles role join role.functions f1 where admin.id = ?) or func.id in "
+ " (select f2.id from Admin admin join admin.functions f2 where admin.id = ?)"
+ " order by func.priority asc";
return find(hql, adminId, adminId);
}
@SuppressWarnings("unchecked")
@Override
public List<Function> getRoots() {
String hql = "select func from Function func where func.parent.id is null order by func.priority asc";
return find(hql);
}
@SuppressWarnings("unchecked")
@Override
public List<Function> getChild(Long pid) {
String hql = "select func from Function func where func.parent.id = ? order by func.priority asc";
return find(hql, pid);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -