Package org.hibernate.criterion

Examples of org.hibernate.criterion.Criterion


        return (String) query.uniqueResult();
    }

    public boolean existDuplicatedConversion(final VirtualImageConversion conversion)
    {
        Criterion cri =
            Restrictions.and(sameImageAndSourcePath(conversion), sameSourceFormat(conversion));
        cri = Restrictions.and(cri, sameTargetFormat(conversion));
        return existsAnyByCriterions(cri);
    }
View Full Code Here


        return ipList;
    }

    public List<IpPoolManagement> findFreeIpsByVlan(final VLANNetwork vlan)
    {
        Criterion freeIps = Restrictions.eq(IpPoolManagement.VLAN_NETWORK_PROPERTY, vlan);
        Criteria criteria = getSession().createCriteria(IpPoolManagement.class).add(freeIps);
        criteria.add(Restrictions.isNull(IpPoolManagement.MAC_PROPERTY));
        return criteria.list();
    }
View Full Code Here

     * @return the found object.
     */
    public IpPoolManagement findIp(final VLANNetwork vlan, final Integer ipId)
    {
        Criteria criteria = getSession().createCriteria(IpPoolManagement.class);
        Criterion vlanEqual = Restrictions.eq(IpPoolManagement.VLAN_NETWORK_PROPERTY, vlan);
        Criterion ipEqual = Restrictions.eq(PersistentEntity.ID_PROPERTY, ipId);

        criteria.add(vlanEqual).add(ipEqual);

        return (IpPoolManagement) criteria.uniqueResult();
    }
View Full Code Here

        return ipList;
    }

    public List<IpPoolManagement> findIpsByVirtualAppliance(final VirtualAppliance vapp)
    {
        Criterion onVapp = Restrictions.eq(RasdManagement.VIRTUAL_APPLIANCE_PROPERTY, vapp);
        Criteria criteria = getSession().createCriteria(IpPoolManagement.class).add(onVapp);
        List<IpPoolManagement> result = getResultList(criteria);

        return result;
    }
View Full Code Here

    public List<NetworkAssignment> findByVirtualDatacenter(final VirtualDatacenter virtualDatacenter)
    {
        Criteria criteria = getSession().createCriteria(NetworkAssignment.class);

        Criterion onVdc =
            Restrictions.eq(NetworkAssignment.VIRTUAL_DATACENTER_PROPERTY, virtualDatacenter);

        criteria.add(onVdc);
        // criteria.addOrder(Order.asc(VirtualDatacenter.NAME_PROPERTY));
View Full Code Here

    public NetworkAssignment findByVlanNetwork(final VLANNetwork vlanNetwork)
    {
        Criteria criteria = getSession().createCriteria(NetworkAssignment.class);

        Criterion onVlanNetwork =
            Restrictions.eq(NetworkAssignment.VLAN_NETWORK_PROPERTY, vlanNetwork);

        criteria.add(onVlanNetwork);

        List<NetworkAssignment> hbs = getResultList(criteria);
View Full Code Here

    public List<VLANNetwork> findPublicVLANNetworksByDatacenter(final Datacenter datacenter,
        final NetworkType netType)
    {

        Criterion inNetwork =
            Restrictions.eq(VLANNetwork.NETWORK_PROPERTY, datacenter.getNetwork());
        Criteria criteria = getSession().createCriteria(VLANNetwork.class).add(inNetwork);
        if (netType != null)
        {
            if (netType.equals(NetworkType.PUBLIC))
View Full Code Here

    public List<VLANNetwork> findVLANNetworksByDatacenterAndEnterprise(final Datacenter datacenter,
        final Enterprise enterprise)
    {

        Criterion inNetwork =
            Restrictions.eq(VLANNetwork.NETWORK_PROPERTY, datacenter.getNetwork());
        Criteria criteria = getSession().createCriteria(VLANNetwork.class).add(inNetwork);

        criteria.add(Restrictions.or(
            Restrictions.eq(VLANNetwork.TYPE_PROPERTY, NetworkType.EXTERNAL),
View Full Code Here

   * @param value
   * @return
   */
  public List<T> findBy(final String propertyName, final Object value) {
    Assert.hasText(propertyName, "propertyName不能为空");
    Criterion criterion = Restrictions.eq(propertyName, value);
    return find(criterion);
  }
View Full Code Here

    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      Criterion labelCriterrion = Expression.eq("label",
          engineLabel);
      Criteria criteria = aSession.createCriteria(SbiEngines.class);
      criteria.add(labelCriterrion);
      SbiEngines hibEngine = (SbiEngines) criteria.uniqueResult();
      if (hibEngine == null) return null;
View Full Code Here

TOP

Related Classes of org.hibernate.criterion.Criterion

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.