Package org.hibernate.criterion

Examples of org.hibernate.criterion.DetachedCriteria


  }

  @SuppressWarnings("unchecked")
  @Override
  public List<SecGroup> getAllGroups() {
    DetachedCriteria criteria = DetachedCriteria.forClass(SecGroup.class);
    criteria.addOrder(Order.asc("grpShortdescription"));

    return getHibernateTemplate().findByCriteria(criteria);
  }
View Full Code Here


  }

  @SuppressWarnings("unchecked")
  @Override
  public SecGroup getGroupByGroupRight(SecGroupright secGroupright) {
    DetachedCriteria criteria = DetachedCriteria.forClass(SecGroup.class);
    // Aliases are working only on properties
    criteria.createAlias("secGrouprights", "gr");
    criteria.add(Restrictions.eq("gr.id", Long.valueOf(secGroupright.getId())));

    return (SecGroup) DataAccessUtils.uniqueResult(getHibernateTemplate().findByCriteria(criteria));
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  @Override
  public SecGroup getGroupByRolegroup(SecRolegroup secRolegroup) {
    DetachedCriteria criteria = DetachedCriteria.forClass(SecGroup.class);
    // Aliases are working only on properties
    criteria.createAlias("secRolegroups", "rg");
    criteria.add(Restrictions.eq("rg.id", Long.valueOf(secRolegroup.getId())));

    return (SecGroup) DataAccessUtils.uniqueResult(getHibernateTemplate().findByCriteria(criteria));
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  @Override
  public List<SecGroup> getGroupsByUser(SecUser aUser) {
    DetachedCriteria criteria = DetachedCriteria.forClass(SecGroup.class);
    // Aliases are working only on properties
    criteria.createAlias("secRolegroups", "rg");
    criteria.createAlias("secRoles", "rol");
    criteria.add(Restrictions.eq("rg.rol.secUser", aUser));

    return getHibernateTemplate().findByCriteria(criteria);
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  @Override
  public List<SecGroup> getGroupsLikeGroupName(String aGroupName) {
    DetachedCriteria criteria = DetachedCriteria.forClass(SecGroup.class);
    criteria.add(Restrictions.ilike("grpShortdescription", aGroupName, MatchMode.ANYWHERE));

    return getHibernateTemplate().findByCriteria(criteria);
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  @Override
  public List<Branche> getAllBranches() {
    DetachedCriteria criteria = DetachedCriteria.forClass(Branche.class);
    criteria.addOrder(Order.asc("braBezeichnung"));

    return getHibernateTemplate().findByCriteria(criteria);
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  @Override
  public Branche getBrancheByID(long bra_id) {
    DetachedCriteria criteria = DetachedCriteria.forClass(Branche.class);
    criteria.add(Restrictions.eq("id", Long.valueOf(bra_id)));

    return (Branche) DataAccessUtils.uniqueResult(getHibernateTemplate().findByCriteria(criteria));
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  @Override
  public Branche getBrancheByName(String braBezeichnung) {
    DetachedCriteria criteria = DetachedCriteria.forClass(Branche.class);
    criteria.add(Restrictions.eq("braBezeichnung", braBezeichnung));

    return (Branche) DataAccessUtils.uniqueResult(getHibernateTemplate().findByCriteria(criteria));
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public List<Branche> getBranchesLikeName(String string) {

    DetachedCriteria criteria = DetachedCriteria.forClass(Branche.class);
    criteria.add(Restrictions.ilike("braBezeichnung", string, MatchMode.ANYWHERE));

    return getHibernateTemplate().findByCriteria(criteria);
  }
View Full Code Here

    return getHibernateTemplate().findByCriteria(criteria);
  }

  @Override
  public int getBrancheSize() {
    DetachedCriteria criteria = DetachedCriteria.forClass(Branche.class);
    criteria.setProjection(Projections.rowCount());
    return DataAccessUtils.intResult(getHibernateTemplate().findByCriteria(criteria));
  }
View Full Code Here

TOP

Related Classes of org.hibernate.criterion.DetachedCriteria

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.