예제 #1
0
 public Integer countServiceItemGroupByUserId(Long userId) {
   return (Integer)
       dao.getHibernateTemplate()
           .find("select count(*) from ServiceItemGroup where userId=" + userId + " and status=1")
           .iterator()
           .next();
 }
예제 #2
0
 public User getUser(String username, String password) {
   String hql = "from User where username='******' and password='******'";
   List<User> userList = dao.getHibernateTemplate().find(hql);
   if (CollectionUtils.isNotEmpty(userList)) {
     return userList.get(0);
   } else {
     return null;
   }
 }
예제 #3
0
 @SuppressWarnings("unchecked")
 public List<ServiceItemGroup> getServiceItemGroupsByUserId(Long userId) {
   return (List<ServiceItemGroup>)
       dao.getHibernateTemplate()
           .find("from ServiceItemGroup where userId=" + userId + " and status=1");
 }
예제 #4
0
 public ServiceItemGroup saveServiceItemGroup(ServiceItemGroup serviceItemGroup) {
   dao.getHibernateTemplate().save(serviceItemGroup);
   return serviceItemGroup;
 }
예제 #5
0
 public void deleteServiceItemGroup(Long gid) {
   ServiceItemGroup serviceItemGroup =
       dao.getHibernateTemplate().load(ServiceItemGroup.class, gid);
   dao.getHibernateTemplate().delete(serviceItemGroup);
 }
예제 #6
0
 public ServiceItemGroup getServiceItemGroup(Long id) {
   return (ServiceItemGroup) dao.getHibernateTemplate().get(ServiceItemGroup.class, id);
 }
예제 #7
0
 public User updateUser(User user) {
   dao.getHibernateTemplate().update(user);
   return user;
 }
예제 #8
0
 public User getUser(Long id) {
   return (User) dao.getHibernateTemplate().get(User.class, id);
 }
예제 #9
0
 public User saveUser(User user) {
   dao.getHibernateTemplate().save(user);
   return user;
 }