Package org.hibernate.criterion

Examples of org.hibernate.criterion.Disjunction


    DetachedCriteria criteria = DetachedCriteria.forClass(GruppoDatiFinanziari.class);
    criteria.add(Restrictions.eq("mutuo.numeroMutuo", new Long(numeroMutuoUnivoco)));
    criteria.add(Restrictions.le("dataInizioValidita", allaData));

    Disjunction orTestata = Restrictions.disjunction();
    orTestata.add(Restrictions.isNull("dataFineValidita"));
    orTestata.add(Restrictions.ge("dataFineValidita", allaData));

    criteria.add(orTestata);

    List<GruppoDatiFinanziari> result = getHibernateTemplate().findByCriteria(criteria);
View Full Code Here


    DetachedCriteria criteria = DetachedCriteria.forClass(Penale.class);

    Conjunction and = Restrictions.conjunction();
    and.add(Restrictions.eq("mutuo.numeroMutuo", numeroMutuo));
    and.add(Restrictions.le("dataInizioValidita", dataMassima));
    Disjunction or = Restrictions.disjunction();
    or.add(Restrictions.isNull("dataFineValidita"));
    or.add(Restrictions.ge("dataFineValidita", dataMassima));
    and.add(or);
    criteria.add(and);
    List<Penale> result = new ArrayList<Penale>();
    result = (List<Penale>) getHibernateTemplate().findByCriteria(criteria);
    if (result != null && result.size() > 0) {
View Full Code Here

  public List<Long> getPraticheLegateA(long numeroSoggetto) {
    DetachedCriteria criteria = DetachedCriteria.forClass(Legame.class);
    Conjunction and = Restrictions.conjunction();
    and.add(Restrictions.eq("numeroSoggetto", numeroSoggetto));

    Disjunction or = Restrictions.disjunction();
    or.add(Restrictions.eq("codiceRapporto", CodiceRapporto.CODICE_RAPPORTO_MUTUATARIO.getValue()));
    or.add(Restrictions.eq("codiceRapporto", CodiceRapporto.CODICE_RAPPORTO_GARANTE.getValue()));
    and.add(or);

    criteria.add(and);

    List<Legame> listaMutui = getHibernateTemplate().findByCriteria(criteria);
View Full Code Here

  public ModalitaRimborso getModalitaRimborso(String codiceModalitaRimborso, String codiceProdotto,
      long codiceSegnalatore) {
    DetachedCriteria criteria = DetachedCriteria.forClass(ModalitaRimborso.class);
    criteria.add(Restrictions.eq("codiceModalitaRimborso", codiceModalitaRimborso));
    criteria.add(Restrictions.eq("codiceProdotto", codiceProdotto));
    Disjunction or = Restrictions.disjunction();
    Conjunction andSegnalatore = Restrictions.conjunction();
    andSegnalatore.add(Restrictions.eq("flagTabellaStandard", "S"));
    andSegnalatore.add(Restrictions.eq("codiceSegnalatore", codiceSegnalatore));
    or.add(andSegnalatore);
    Conjunction andSegnalatoreN = Restrictions.conjunction();
    andSegnalatoreN.add(Restrictions.eq("flagTabellaStandard", "N"));
    andSegnalatoreN.add(Restrictions.eq("codiceSegnalatore", new Long(0)));
    or.add(andSegnalatoreN);
    criteria.add(or);
    criteria.add(Restrictions.eq("legalEntity", legalEntity).ignoreCase());
    criteria.add(Restrictions.eq("organizationUnit", organizationUnit).ignoreCase());
    List<ModalitaRimborso> result = getHibernateTemplate().findByCriteria(criteria);
    return (result != null && result.size() > 0 ? result.get(0) : null);
View Full Code Here

  @Override
  public List<ModalitaRimborso> getModalitaRimborsoByProdottoCategoriaSegnalatore(
      String codiceProdotto, String codiceCategoria, long codiceSegnalatore) {
    DetachedCriteria criteria = DetachedCriteria.forClass(ModalitaRimborso.class);
   
    Disjunction orSegn = Restrictions.disjunction();
    orSegn.add(Restrictions.eq("codiceSegnalatore", 0l));
    orSegn.add(Restrictions.eq("codiceSegnalatore", codiceSegnalatore));
    criteria.add(orSegn);

    criteria.add(Restrictions.eq("codiceProdotto", codiceProdotto));

    Disjunction orCateg = Restrictions.disjunction();
    orCateg.add(Restrictions.isNull("codiceCategoria"));
    orCateg.add(Restrictions.eq("codiceCategoria", codiceCategoria));
    criteria.add(orCateg);

    criteria.add(Restrictions.eq("legalEntity", legalEntity).ignoreCase());
    criteria.add(Restrictions.eq("organizationUnit", organizationUnit).ignoreCase());
    return getHibernateTemplate().findByCriteria(criteria);
View Full Code Here

        return Restrictions.eq(PricingTemplate.NAME_PROPERTY, name);
    }

    private Criterion filterBy(final String filter)
    {
        Disjunction filterDisjunction = Restrictions.disjunction();

        filterDisjunction.add(Restrictions.like(CostCode.NAME_PROPERTY, '%' + filter + '%'));
        filterDisjunction.add(Restrictions.like(CostCode.DESCRIPTION_PROPERTY, '%' + filter + '%'));

        return filterDisjunction;
    }
View Full Code Here

        super(Role.class, entityManager);
    }

    public static Criterion sameEnterpriseOrNull(final Enterprise enterprise)
    {
        Disjunction filterDisjunction = Restrictions.disjunction();

        filterDisjunction.add(Restrictions.eq(Role.ENTERPRISE_PROPERTY, enterprise));
        filterDisjunction.add(Restrictions.isNull(Role.ENTERPRISE_PROPERTY));

        return filterDisjunction;
    }
View Full Code Here

        return filterDisjunction;
    }

    public static Criterion sameEnterprise(final Enterprise enterprise)
    {
        Disjunction filterDisjunction = Restrictions.disjunction();

        filterDisjunction.add(Restrictions.eq(Role.ENTERPRISE_PROPERTY, enterprise));

        return filterDisjunction;
    }
View Full Code Here

    }

    private Criterion filterBy(final String filter)
    {
        Disjunction filterDisjunction = Restrictions.disjunction();

        filterDisjunction.add(Restrictions.like(Role.NAME_PROPERTY, '%' + filter + '%'));

        return filterDisjunction;
    }
View Full Code Here

        return criteria;
    }

    private Criterion filterBy(final String filter)
    {
        Disjunction filterDisjunction = Restrictions.disjunction();

        filterDisjunction.add(Restrictions.like(Currency.NAME_PROPERTY, '%' + filter + '%'));
        filterDisjunction.add(Restrictions.like(Currency.SYMBOL_PROPERTY, '%' + filter + '%'));

        return filterDisjunction;
    }
View Full Code Here

TOP

Related Classes of org.hibernate.criterion.Disjunction

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.