// Path: commons/src/main/java/com/dataagg/commons/domain/ERole.java
// @Table("sys_role")
// @Comment("角色信息")
// public class ERole {
// 	@Id
// 	@Comment("主键")
// 	private Long id;
// 
// 	@Column(hump = true)
// 	@ColDefine(type = ColType.VARCHAR, width = 64, notNull = true)
// 	@Comment("角色名")
// 	private String name;
// 
// 	@Column(hump = true)
// 	@ColDefine(type = ColType.VARCHAR, width = 200, notNull = false)
// 	@Comment("描述")
// 	private String description;
// 
// 	@ManyMany(relation = "sys_role_authority", from = "role_id", to = "authority_id")
// 	private List<EAuthority> authorities = new ArrayList<>();
// 
// 	public Long getId() {
// 		return id;
// 	}
// 
// 	public void setId(Long id) {
// 		this.id = id;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public List<EAuthority> getAuthorities() {
// 		return authorities;
// 	}
// 
// 	public void setAuthorities(List<EAuthority> authorities) {
// 		this.authorities = authorities;
// 	}
// 
// 	public String getDescription() {
// 		return description;
// 	}
// 
// 	public void setDescription(String description) {
// 		this.description = description;
// 	}
// }


import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.impl.NutDao;
import org.nutz.service.IdEntityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.dataagg.commons.domain.ERole;
package com.dataagg.commons.dao;





/**
 * Created by watano on 2017/3/13.
 */
@Component
public class RoleDao extends IdEntityService<ERole> {
	@Autowired
	public RoleDao(@Autowired DataSource dataSource) {
		super(new NutDao(dataSource));
	}

	public List<ERole> getDefaultRoles() {
		return Arrays.asList(fetch(1));
	}

// Path: commons/src/main/java/com/dataagg/commons/domain/ERole.java
// @Table("sys_role")
// @Comment("角色信息")
// public class ERole {
// 	@Id
// 	@Comment("主键")
// 	private Long id;
// 
// 	@Column(hump = true)
// 	@ColDefine(type = ColType.VARCHAR, width = 64, notNull = true)
// 	@Comment("角色名")
// 	private String name;
// 
// 	@Column(hump = true)
// 	@ColDefine(type = ColType.VARCHAR, width = 200, notNull = false)
// 	@Comment("描述")
// 	private String description;
// 
// 	@ManyMany(relation = "sys_role_authority", from = "role_id", to = "authority_id")
// 	private List<EAuthority> authorities = new ArrayList<>();
// 
// 	public Long getId() {
// 		return id;
// 	}
// 
// 	public void setId(Long id) {
// 		this.id = id;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public List<EAuthority> getAuthorities() {
// 		return authorities;
// 	}
// 
// 	public void setAuthorities(List<EAuthority> authorities) {
// 		this.authorities = authorities;
// 	}
// 
// 	public String getDescription() {
// 		return description;
// 	}
// 
// 	public void setDescription(String description) {
// 		this.description = description;
// 	}
// }


// Path: commons/src/main/java/com/dataagg/commons/dao/RoleDao.java
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.impl.NutDao;
import org.nutz.service.IdEntityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.dataagg.commons.domain.ERole;

package com.dataagg.commons.dao;





/**
 * Created by watano on 2017/3/13.
 */
@Component
public class RoleDao extends IdEntityService<ERole> {
	@Autowired
	public RoleDao(@Autowired DataSource dataSource) {
		super(new NutDao(dataSource));
	}

	public List<ERole> getDefaultRoles() {
		return Arrays.asList(fetch(1));
	}

	public ERole fetchByName(String name) {