本文整理汇总了Java中org.nutz.dao.Cnd类的典型用法代码示例。如果您正苦于以下问题:Java Cnd类的具体用法?Java Cnd怎么用?Java Cnd使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Cnd类属于org.nutz.dao包,在下文中一共展示了Cnd类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: index
import org.nutz.dao.Cnd; //导入依赖的package包/类
@At("/")
@Ok("beetl:/WEB-INF/base/studio_list.html")
public void index(@Param("..")Page p,
@Param("..")Studio studio,
HttpServletRequest request){
Cnd c = new ParseObj(studio).getCnd();
if (c == null || c.equals(""))
{
p.setRecordCount(studioService.listCount(c));
request.setAttribute("list_obj", studioService.queryCache(c,p));
}else{
p.setRecordCount(studioService.count(c));
request.setAttribute("list_obj", studioService.query(c,p));
}
request.setAttribute("page", p);
request.setAttribute("studio", studio);
}
示例2: index
import org.nutz.dao.Cnd; //导入依赖的package包/类
@At("/")
@Ok("beetl:/WEB-INF/base/code_list.html")
public void index(@Param("..")Page p,
@Param("..")Code code,
HttpServletRequest request){
Cnd c = new ParseObj(code).getCnd();
if (c == null || c.equals(""))
{
p.setRecordCount(codeService.listCount(c));
request.setAttribute("list_obj", codeService.queryCache(c,p));
}else{
p.setRecordCount(codeService.count(c));
request.setAttribute("list_obj", codeService.query(c,p));
}
request.setAttribute("osList", CBData.getInstance().getOsList());
request.setAttribute("page", p);
request.setAttribute("code", code);
}
示例3: onLoginSuccess
import org.nutz.dao.Cnd; //导入依赖的package包/类
@Override
protected boolean onLoginSuccess(AuthenticationToken token, Subject subject, ServletRequest req,
ServletResponse resp) throws Exception {
HttpServletRequest req1 = (HttpServletRequest) req;
HttpSession session = null;
if(req1 != null)
session = req1.getSession();
User user = dao().fetch(User.class, Cnd.where(User.USERNAME, "=", subject.getPrincipal()));
if(user!=null){
if(session!=null){
subject.getSession().setAttribute("me", user.getId());
subject.getSession().setAttribute("username", user.getUsername());
subject.getSession().setAttribute("sessionId", session.getId());
//session.setAttribute("me", user.getId());
// session.setAttribute("username", user.getUsername());
// session.setAttribute("sessionId",session.getId());
}
}
NutShiro.rendAjaxResp(req, resp, Response.ok("登陆成功"));
return false;
}
示例4: index
import org.nutz.dao.Cnd; //导入依赖的package包/类
@At("/")
@Ok("beetl:/WEB-INF/base/target_list.html")
public void index(@Param("..")Page p,
@Param("..")Target target,
HttpServletRequest request){
Cnd c = new ParseObj(target).getCnd();
if (c == null || c.equals(""))
{
p.setRecordCount(targetService.listCount(c));
request.setAttribute("list_obj", targetService.queryCache(c,p));
}else{
p.setRecordCount(targetService.count(c));
request.setAttribute("list_obj", targetService.query(c,p));
}
request.setAttribute("page", p);
request.setAttribute("target", target);
}
示例5: index
import org.nutz.dao.Cnd; //导入依赖的package包/类
@At("/")
@Ok("beetl:/WEB-INF/base/productlevel_list.html")
public void index(@Param("..")Page p,
@Param("..")Productlevel productlevel,
HttpServletRequest request){
Cnd c = new ParseObj(productlevel).getCnd();
if (c == null || c.equals(""))
{
p.setRecordCount(productlevelService.listCount(c));
request.setAttribute("list_obj", productlevelService.queryCache(c,p));
}else{
p.setRecordCount(productlevelService.count(c));
request.setAttribute("list_obj", productlevelService.query(c,p));
}
request.setAttribute("page", p);
request.setAttribute("productlevel", productlevel);
}
示例6: index
import org.nutz.dao.Cnd; //导入依赖的package包/类
@At("/")
@Ok("beetl:/WEB-INF/base/language_list.html")
public void index(@Param("..")Page p,
@Param("..")Language language,
HttpServletRequest request){
Cnd c = new ParseObj(language).getCnd();
if (c == null || c.equals(""))
{
p.setRecordCount(languageService.listCount(c));
request.setAttribute("list_obj", languageService.queryCache(c,p));
}else{
p.setRecordCount(languageService.count(c));
request.setAttribute("list_obj", languageService.query(c,p));
}
request.setAttribute("page", p);
request.setAttribute("language", language);
}
示例7: applyFriend
import org.nutz.dao.Cnd; //导入依赖的package包/类
/**
* 申请加好友
*/
@Override
public int applyFriend(int uid, int from, int from_group,String remark) {
//delete方法没有Cnd函数,需使用clera ^_^
// dao.delete(Message.TABLE_NAME,Cnd.where(Message.FROM,"=",from).and(Message.UID,"=",uid).and(Message.TYPE,"=","1"));
//根据qq特性,重复加好友的请求消息只有一条,默认覆盖旧的,so clear old msg.
dao.clear(Message.TABLE_NAME, Cnd.where(Message.FROM, "=", from).and(Message.UID, "=", uid).and(Message.TYPE, "=", "1").and(Message.READ,"=",0));
Message msg = new Message();
msg.setContent("申请添加你为好友");
msg.setUid(uid);
msg.setFrom(from);
msg.setFrom_group(from_group);;
msg.setType(1);
msg.setRead(0);
msg.setTime(new Date());
msg.setRemark(remark);
Message i= dao.insert(msg);
if(i!=null){
return 1;
}
return 0;
}
示例8: getAllRoleList
import org.nutz.dao.Cnd; //导入依赖的package包/类
@RequestMapping(value = "/roleList")
public ActionResultObj getAllRoleList() {
ActionResultObj result = new ActionResultObj();
try {
Criteria cnd = Cnd.cri();
// cnd.where().andNotEquals("name", "Admin");
List<ERole> roles = roleDao.query(cnd);
WMap map = new WMap();
map.put("data", roles);
result.ok(map);
result.okMsg("查询角色列表成功!");
} catch (Exception e) {
LOG.error("获取角色列表失败:" + e.getMessage());
result.error(e);
}
return result;
}
示例9: index
import org.nutz.dao.Cnd; //导入依赖的package包/类
@At("/")
@Ok("beetl:/WEB-INF/product/technicalpoint_list.html")
public void index(@Param("..")Page p,
@Param("..")Technicalpoint technicalpoint,
HttpServletRequest request){
Cnd c = new ParseObj(technicalpoint).getCnd();
if (c == null || c.equals(""))
{
p.setRecordCount(technicalpointService.listCount(c));
request.setAttribute("list_obj", technicalpointService.queryCache(c,p));
}else{
p.setRecordCount(technicalpointService.count(c));
request.setAttribute("list_obj", technicalpointService.query(c,p));
}
request.setAttribute("osList", osService.queryCache(null,new Page()));
request.setAttribute("productList", productService.queryCache(null,new Page()));
request.setAttribute("page", p);
request.setAttribute("technicalpoint", technicalpoint);
}
示例10: save
import org.nutz.dao.Cnd; //导入依赖的package包/类
public ERole save(ERole role) {
Long newId = role.getId();
if (newId != null) {
ERole tmp = fetch(newId);
if (tmp != null) {
_update(role);
return role;
}
//FIXME 插入是不会使用设置过的id,始终自动生成:(
role = _insert(role);
update(Chain.make("id", newId), Cnd.where("id", "=", role.getId()));
role.setId(newId);
return role;
}
return _insert(role);
}
示例11: index
import org.nutz.dao.Cnd; //导入依赖的package包/类
@At("/")
@Ok("beetl:/WEB-INF/product/func_list.html")
public void index(@Param("..")Page p,
@Param("..")Func func,
@Param("productid")long productid,
HttpServletRequest request){
Cnd c = new ParseObj(func).getCnd();
if (c == null || c.equals(""))
{
p.setRecordCount(funcService.listCount(c));
request.setAttribute("list_obj", funcService.queryCache(c,p));
}else{
p.setRecordCount(funcService.count(c));
request.setAttribute("list_obj", funcService.query(c,p));
}
request.setAttribute("page", p);
request.setAttribute("func", func);
request.setAttribute("productid",productid);
}
示例12: findByType
import org.nutz.dao.Cnd; //导入依赖的package包/类
@RequestMapping(value="type/{type}")
public ActionResultObj findByType(@PathVariable String type){
ActionResultObj result = new ActionResultObj();
try{
if(StringUtil.isNotBlank(type)){
List<EDict> dictList = dictDao.query(Cnd.where("type", "=", type).and("del_flag", "=", Constans.POS_NEG.NEG).orderBy("sort", "asc"));
//处理返回值
WMap map = new WMap();
map.put("type", type);
map.put("data", dictList);
result.ok(map);
result.okMsg("查询成功!");
}else{
result.errorMsg("查询失败,字典类型不存在!");
}
}catch(Exception e){
e.printStackTrace();
LOG.error("查询失败,原因:"+e.getMessage());
result.error(e);
}
return result;
}
示例13: doGetAuthenticationInfo
import org.nutz.dao.Cnd; //导入依赖的package包/类
/**
* Retrieves authentication data from an implementation-specific datasource (RDBMS, LDAP, etc) for the given
* authentication token.
* <p/>
* For most datasources, this means just 'pulling' authentication data for an associated subject/user and nothing
* more and letting Shiro do the rest. But in some systems, this method could actually perform EIS specific
* log-in logic in addition to just retrieving data - it is up to the Realm implementation.
* <p/>
* A {@code null} return value means that no account could be associated with the specified token.
*
* @param token the authentication token containing the user's principal and credentials.
* @return an {@link AuthenticationInfo} object containing account data resulting from the
* authentication ONLY if the lookup is successful (i.e. account exists and is valid, etc.)
* @throws AuthenticationException if there is an error acquiring data or performing
* realm-specific authentication logic for the specified <tt>token</tt>
*/
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
String username = (String)token.getPrincipal(); //得到用户名
String password = new String((char[])token.getCredentials()); //得到密码
User u2 = dao().fetch(User.class, Cnd.where(User.USERNAME,"=",username).and(User.PWD,"=",password));
int count = dao.count(User.class, Cnd.where(User.USERNAME, "=", username));
if(count == 0 ){//用户名不存在
throw new UnknownAccountException(); //如果用户名错误
}
if(u2 == null){//密码错误
throw new IncorrectCredentialsException(); //如果密码错误
}
//如果身份认证验证成功,返回一个AuthenticationInfo实现;
return new SimpleAuthenticationInfo(username, password, getName());
}
示例14: index
import org.nutz.dao.Cnd; //导入依赖的package包/类
@At("/")
@Ok("beetl:/WEB-INF/base/xinyong_list.html")
public void index(@Param("..")Page p,
@Param("..")Xinyong xinyong,
HttpServletRequest request){
Cnd c = new ParseObj(xinyong).getCnd();
if (c == null || c.equals(""))
{
p.setRecordCount(xinyongService.listCount(c));
request.setAttribute("list_obj", xinyongService.queryCache(c,p));
}else{
p.setRecordCount(xinyongService.count(c));
request.setAttribute("list_obj", xinyongService.query(c,p));
}
request.setAttribute("page", p);
request.setAttribute("xinyong", xinyong);
}
示例15: index
import org.nutz.dao.Cnd; //导入依赖的package包/类
@At("/")
@Ok("beetl:/WEB-INF/base/linktype_list.html")
public void index(@Param("..")Page p,
@Param("..")Linktype linktype,
HttpServletRequest request){
Cnd c = new ParseObj(linktype).getCnd();
if (c == null || c.equals(""))
{
p.setRecordCount(linktypeService.listCount(c));
request.setAttribute("list_obj", linktypeService.queryCache(c,p));
}else{
p.setRecordCount(linktypeService.count(c));
request.setAttribute("list_obj", linktypeService.query(c,p));
}
request.setAttribute("page", p);
request.setAttribute("linktype", linktype);
}