Exemplo 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;
  }
Exemplo n.º 2
0
  /**
   * Lists the entities of type Intrant
   *
   * @param sortProperty the property used to sort the collection
   * @param sortOrder true for an ascendant sort
   * @return list of intrant
   */
  @Transactional(readOnly = true)
  public List<Intrant> listIntrant(String sortProperty, boolean sortOrder, ImogJunction junction) {

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

    return beans;
  }
Exemplo n.º 3
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);
  }
Exemplo n.º 4
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);
  }
Exemplo n.º 5
0
  /**
   * Lists the entities of type Intrant
   *
   * @param sortProperty the property used to sort the collection
   * @param sortOrder true for an ascendant sort
   * @return list of intrant
   */
  @Transactional(readOnly = true)
  public List<Intrant> listIntrant(String sortProperty, boolean sortOrder) {

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

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

    return beans;
  }
Exemplo n.º 6
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;
  }
Exemplo n.º 7
0
  /**
   * Saves or updates the entity
   *
   * @param entity the entity to be saved or updated
   * @param isNew true if it is a new entity added for the first time.
   */
  @Transactional
  public void save(Intrant entity, boolean isNew) {

    ImogActor actor = HttpSessionUtil.getCurrentUser();

    if (entity != null) {

      handlerHelper.prepare(entity);
      if (entity.getDeleted() != null) entity.setDeleted(null);

      dao.saveOrUpdate(entity, isNew);
    }
  }
Exemplo n.º 8
0
 /**
  * Loads the entity with the specified id
  *
  * @param entityId the entity id
  * @return the entity or null
  */
 @Transactional(readOnly = true)
 public Intrant getById(String entityId) {
   return dao.getById(entityId);
 }
Exemplo n.º 9
0
 /**
  * Loads the entity with the specified id
  *
  * @param entityId the entity id
  * @return the entity or null
  */
 @Transactional(readOnly = true)
 public Intrant findById(String entityId) {
   return dao.load(entityId);
 }
Exemplo n.º 10
0
  /**
   * Removes the specified entity from the database
   *
   * @param entity The entity to be deleted
   */
  @Transactional
  public void delete(Intrant entity) {

    handlerHelper.prepareForDelete(entity);
    dao.saveOrUpdate(entity, false);
  }