Spring Framework HibernateDaoSupport - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework HibernateDaoSupport class.

This code example shows how to use the following methods:setSessionFactory
 
@Repository("organizationDao") 
public class OrganizationDaoImpl extends HibernateDaoSupport implements OrganizationDao { 
 
  @Autowired 
  public OrganizationDaoImpl(SessionFactory sessionFactory) { 
    setSessionFactory(sessionFactory); 
  } 
 
  public Organization load(Long id) { 
    return (Organization) getHibernateTemplate().load(Organization.class, id); 
  } 
 
  public Organization persist(Organization organization) { 
    getHibernateTemplate().saveOrUpdate(organization); 
    return organization; 
  } 
 
  @SuppressWarnings("unchecked") 
  public Organization findByName(String orgName) { 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setSessionFactory
 
@Repository("userDao") 
public class UserDaoImpl extends HibernateDaoSupport implements UserDao { 
 
  @Autowired 
  public UserDaoImpl(SessionFactory sessionFactory) { 
    setSessionFactory(sessionFactory); 
  } 
 
  public User load(Long id) { 
    return (User) getHibernateTemplate().load(User.class, id); 
  } 
 
  public User persist(User user) { 
    getHibernateTemplate().saveOrUpdate(user); 
    return user; 
  } 
 
  @SuppressWarnings("unchecked") 
  public User findUserByOrganizationAndUsername(Long organizationId, String username) { 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 *  
 */ 
@SuppressWarnings("unchecked") 
public class ContactDaoImpl extends HibernateDaoSupport implements ContactDao { 
 
	public ContactDaoImpl() { 
		// TODO Auto-generated constructor stub 
	} 
 
	public void addUpdateContact(Contact contact) { 
		getHibernateTemplate().merge(contact); 
	} 
 
	public void deleteContact(Contact contact) { 
		getHibernateTemplate().delete(contact); 
	} 
 
	public Collection<Contact> findAllContacts() { 
		return getHibernateTemplate().find("from Contact c"); 
		// return getHibernateTemplate().loadAll(Contact.class); 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
package org.springframework.issues; 
 
import org.springframework.orm.hibernate3.support.HibernateDaoSupport; 
import org.springframework.stereotype.Repository; 
 
@Repository 
public class CustomerDAO extends HibernateDaoSupport 
{ 
    public void method () 
    { 
    } 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setSessionFactory
 
public class HqlOptionsModel extends HibernateDaoSupport implements OptionsModel { 
 
	private String hql; 
	 
	public HqlOptionsModel(SessionFactory sessionFactory) { 
		setSessionFactory(sessionFactory); 
	} 
	 
	public void setHql(String hql) { 
		this.hql = hql; 
	} 
 
	public Collection<?> getOptionValues(Element element) { 
		return getSession().createQuery(hql).list(); 
	} 
 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getHibernateTemplate, getRoleByName
            return (Role) roles.get(0); 
        } 
    } 
 
    public void removeRole(String rolename) { 
        Object role = getRoleByName(rolename); 
        getHibernateTemplate().delete(role); 
    } 
     
    public List<Role> getRoles(){ 
    	return getHibernateTemplate().loadAll(Role.class); 
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setSessionFactory
public class HqlAutoCompleterModel extends HibernateDaoSupport  
		implements AutocompleterModel { 
 
	private String hql; 
	 
	public HqlAutoCompleterModel(SessionFactory sessionFactory) { 
		setSessionFactory(sessionFactory); 
	} 
	 
	public void setHql(String hql) { 
		this.hql = hql; 
	} 
	 
	@SuppressWarnings("unchecked") 
	public Collection<String> getSuggestions(String search, 
			AutocompleteTextField element, HttpServletRequest request) { 
		 
		Query query = getSession().createQuery(hql); 
		query.setParameter("search", "%" + search  + "%"); 
		if (hql.indexOf(":parent") != -1) { 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
/** 
 * This class is the implementation of UserDAO using Spring's HibernateTemplate. 
 *  
 * @author Sehwan Noh (devnoh@gmail.com) 
 */ 
public class UserDaoHibernate extends HibernateDaoSupport implements UserDao { 
 
	public User getUser(Long id) { 
		return (User) getHibernateTemplate().get(User.class, id); 
	} 
 
	public User saveUser(User user) { 
		getHibernateTemplate().saveOrUpdate(user); 
		getHibernateTemplate().flush(); 
		return user; 
	} 
 
	public void removeUser(Long id) { 
		getHibernateTemplate().delete(getUser(id)); 
	} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setSessionFactory
@Repository  
public class HibernateSpringUtil extends HibernateDaoSupport { 
 
	@Resource(name = "sessionFactory") 
	public void setSuperSessionFactory(SessionFactory sessionFactory) { 
		super.setSessionFactory(sessionFactory); 
	} 
 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setSessionFactory
import org.springframework.orm.hibernate3.support.HibernateDaoSupport; 
 
public abstract class AbstractHibernateRiotDao extends HibernateDaoSupport  
		implements RiotDao, Sortable { 
 
	public AbstractHibernateRiotDao(SessionFactory sessionFactory) { 
		setSessionFactory(sessionFactory); 
	} 
	 
	public String getObjectId(Object entity) { 
		return HibernateUtils.getIdAsString(getSessionFactory(), entity); 
	} 
 
	public Object load(String id) throws DataAccessException { 
		return HibernateUtils.get(getSession(), getEntityClass(), id); 
	} 
 
	public int getListSize(Object parent, ListParams params) throws DataAccessException { 
		return -1; 
	} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Spring Framework HibernateDaoSupport Methods: