Ejemplo n.º 1
0
  /** Lists the entities of type Intrant for the CSV export */
  @Transactional(readOnly = true)
  public List<Intrant> listForCsv(
      String sortProperty, boolean sortOrder, String identifiant, String nom) {

    ImogActor actor = HttpSessionUtil.getCurrentUser();
    ImogJunction junction = createFilterJuntion(actor);

    if (identifiant != null && !identifiant.isEmpty()) {
      BasicCriteria criteria = new BasicCriteria();
      criteria.setOperation(CriteriaConstants.STRING_OPERATOR_CONTAINS);
      criteria.setField("identifiant");
      criteria.setValue(identifiant);
      junction.add(criteria);
    }
    if (nom != null && !nom.isEmpty()) {
      BasicCriteria criteria = new BasicCriteria();
      criteria.setOperation(CriteriaConstants.STRING_OPERATOR_CONTAINS);
      criteria.setField("nom");
      criteria.setValue(nom);
      junction.add(criteria);
    }

    List<Intrant> beans = dao.load(sortProperty, sortOrder, junction);
    List<Intrant> securedBeans = filter.<Intrant>toSecure(beans);
    return securedBeans;
  }
Ejemplo n.º 2
0
  /**
   * Counts the number of non affected intrant entities in the database
   *
   * @param property the property which is not affected
   * @param criterion request criteria
   * @return the count
   */
  @Transactional(readOnly = true)
  public Long countNonAffectedIntrantReverse(String property, ImogJunction criterions) {

    ImogActor actor = HttpSessionUtil.getCurrentUser();
    ImogJunction junction = createFilterJuntion(actor);
    if (criterions != null) junction.add(criterions);
    return dao.countNonAffectedReverse(property, junction);
  }
Ejemplo n.º 3
0
  /**
   * Counts the number of intrant in the database, that match the criteria
   *
   * @return the count
   */
  @Transactional(readOnly = true)
  public Long countIntrant(ImogJunction criterions) {

    ImogActor actor = HttpSessionUtil.getCurrentUser();
    ImogJunction junction = createFilterJuntion(actor);
    if (criterions != null) junction.add(criterions);

    return dao.count(junction);
  }
Ejemplo n.º 4
0
  /**
   * Lists the entities of type Intrant
   *
   * @param i first index to retrieve
   * @param j nb of items to retrieve
   * @param sortProperty the property used to sort the collection
   * @param sortOrder true for an ascendant sort
   * @param criterions request criteria
   * @return list of intrant
   */
  @Transactional(readOnly = true)
  public List<Intrant> listIntrant(
      int i, int j, String sortProperty, boolean sortOrder, ImogJunction criterions) {

    ImogActor actor = HttpSessionUtil.getCurrentUser();
    ImogJunction junction = createFilterJuntion(actor);
    if (criterions != null) junction.add(criterions);

    List<Intrant> beans = dao.load(i, j, sortProperty, sortOrder, junction);

    return beans;
  }