.where("cp.group=:group", group).cacheable();
return !entityDao.search(cbuilder).isEmpty();
}
private SessionProfileBean getProfile() {
SessionProfileBean profile = null;
final OqlBuilder<SessionProfileBean> builder = OqlBuilder.from(SessionProfileBean.class, "p");
if (null != serverName) {
builder.where("p.name=:serverName", serverName);
}
List<SessionProfileBean> profiles = entityDao.search(builder);
if (profiles.isEmpty()) {
profile = new SessionProfileBean(DefauleServerName, 1, 30);
entityDao.saveOrUpdate(profile);
} else {
profile = profiles.get(0);
if (profiles.size() > 1) {
log.warn("Multiple SessionProfile found,choose {} id {}.You should specify :serverName",
profile.getName(), profile.getId());
}
}
return profile;
}