List of usage examples for org.hibernate Criteria addOrder
public Criteria addOrder(Order order);
From source file:br.com.hslife.orcamento.repository.CategoriaDocumentoRepository.java
License:Open Source License
@SuppressWarnings("unchecked") public List<CategoriaDocumento> findByDescricao(String descricao) { Criteria criteria = getSession().createCriteria(CategoriaDocumento.class); criteria.add(Restrictions.ilike("descricao", descricao, MatchMode.ANYWHERE)); return criteria.addOrder(Order.asc("descricao")).list(); }
From source file:br.com.hslife.orcamento.repository.CategoriaDocumentoRepository.java
License:Open Source License
@SuppressWarnings("unchecked") public List<CategoriaDocumento> findByUsuario(Usuario usuario) { Criteria criteria = getSession().createCriteria(CategoriaDocumento.class); criteria.add(Restrictions.eq("usuario.id", usuario.getId())); return criteria.addOrder(Order.asc("descricao")).list(); }
From source file:br.com.hslife.orcamento.repository.CategoriaRepository.java
License:Open Source License
@SuppressWarnings("unchecked") public List<Categoria> findByDescricaoAndUsuario(String descricao, Usuario usuario) { Criteria criteria = getSession().createCriteria(Categoria.class); criteria.add(Restrictions.ilike("descricao", descricao, MatchMode.ANYWHERE)); criteria.add(Restrictions.eq("usuario.id", usuario.getId())); return criteria.addOrder(Order.asc("descricao")).list(); }
From source file:br.com.hslife.orcamento.repository.CategoriaRepository.java
License:Open Source License
@SuppressWarnings("unchecked") public List<Categoria> findByUsuario(Usuario usuario) { Criteria criteria = getSession().createCriteria(Categoria.class); criteria.add(Restrictions.eq("usuario.id", usuario.getId())); return criteria.addOrder(Order.asc("descricao")).list(); }
From source file:br.com.hslife.orcamento.repository.CategoriaRepository.java
License:Open Source License
@SuppressWarnings("unchecked") public List<Categoria> findEnabledByUsuario(Usuario usuario) { Criteria criteria = getSession().createCriteria(Categoria.class); criteria.add(Restrictions.eq("ativo", true)); criteria.add(Restrictions.eq("usuario.id", usuario.getId())); return criteria.addOrder(Order.asc("descricao")).list(); }
From source file:br.com.hslife.orcamento.repository.CategoriaRepository.java
License:Open Source License
@SuppressWarnings("unchecked") public List<Categoria> findByTipoCategoriaAndUsuario(TipoCategoria tipoCategoria, Usuario usuario) { Criteria criteria = getSession().createCriteria(Categoria.class); criteria.add(Restrictions.eq("usuario.id", usuario.getId())); criteria.add(Restrictions.eq("tipoCategoria", tipoCategoria)); return criteria.addOrder(Order.asc("descricao")).list(); }
From source file:br.com.hslife.orcamento.repository.ContaRepository.java
License:Open Source License
@SuppressWarnings("unchecked") public List<Conta> findAll() { Criteria criteria = getSession().createCriteria(Conta.class); criteria.add(Restrictions.ne("tipoConta", TipoConta.CARTAO)); return criteria.addOrder(Order.asc("descricao")).list(); }
From source file:br.com.hslife.orcamento.repository.ContaRepository.java
License:Open Source License
@SuppressWarnings("unchecked") public List<Conta> findByBanco(Long idBanco) { Criteria criteria = getSession().createCriteria(Conta.class); criteria.add(Restrictions.eq("banco.id", idBanco)); criteria.add(Restrictions.ne("tipoConta", TipoConta.CARTAO)); return criteria.addOrder(Order.asc("descricao")).list(); }
From source file:br.com.hslife.orcamento.repository.ContaRepository.java
License:Open Source License
@SuppressWarnings("unchecked") public List<Conta> findByDescricao(String descricao) { Criteria criteria = getSession().createCriteria(Conta.class); criteria.add(Restrictions.ilike("descricao", descricao, MatchMode.ANYWHERE)); criteria.add(Restrictions.ne("tipoConta", TipoConta.CARTAO)); return criteria.addOrder(Order.asc("descricao")).list(); }
From source file:br.com.hslife.orcamento.repository.ContaRepository.java
License:Open Source License
@SuppressWarnings("unchecked") public List<Conta> findByUsuario(Usuario usuario) { Criteria criteria = getSession().createCriteria(Conta.class); criteria.add(Restrictions.eq("usuario.id", usuario.getId())); return criteria.addOrder(Order.asc("descricao")).list(); }