Package org.openmeetings.app.persistence.beans.lang

Examples of org.openmeetings.app.persistence.beans.lang.Fieldvalues


 
 
  private List<Fieldvalues> getMixedFieldValuesList(int start ,int max, String orderby, boolean asc, Long language_id) throws Exception {
    List<Fieldvalues> ll = this.getFieldsValues(start, max, orderby, asc);
    for (Iterator<Fieldvalues> iter = ll.iterator(); iter.hasNext();){
      Fieldvalues fv = iter.next();
      fv.setFieldlanguagesvalue(this.getFieldByIdAndLanguage(fv.getFieldvalues_id(), language_id));
    }
    return ll;
  }
View Full Code Here


    EntityManager session = PersistenceSessionUtil.getSession();
    EntityTransaction tx = session.getTransaction();
    tx.begin();
    Query query = session.createQuery(hql);
    query.setParameter("fieldvalues_id", fieldvalues_id);
    Fieldvalues fv = null;
    try {
      fv = (Fieldvalues) query.getSingleResult();
      } catch (NoResultException ex) {
      }
    tx.commit();
View Full Code Here

  }

  private void addFieldValueById(Long language_id, Long fieldvalues_id,
      String fieldName, String value) throws Exception {

    Fieldvalues fv = fieldmanagment.getFieldvaluesById(fieldvalues_id);

    if (fv == null) {
      fv = fieldmanagment.addFieldById(fieldName, fieldvalues_id);
    }
View Full Code Here

          value = val.getText();
        }

        // log.error("result: "+langFieldIdIsInited+" "+id+" "+name+" "+value);

        Fieldvalues fv = null;
        // Only do that for the first field-set
        if (!langFieldIdIsInited) {
          fv = fieldmanagment.addFieldById(name, id);
        } else {
          fv = fieldmanagment.getFieldvaluesById(id);
View Full Code Here

  }

  public Fieldvalues addFieldById(String fieldName, Long fieldvalues_id) {
    try {
      Fieldvalues fl = new Fieldvalues();
      fl.setFieldvalues_id(fieldvalues_id);
      fl.setStarttime(new Date());
      fl.setName(fieldName);
      fl.setDeleted("false");

      return em.merge(fl);
    } catch (Exception ex2) {
      log.error("[getConfKey]: ", ex2);
    }
View Full Code Here

  }

  public Fieldvalues getFieldvaluesById(Long fieldvalues_id, Long language_id) {
    try {
      // log.error("Long fieldvalues_id, Long language_id "+fieldvalues_id+" || "+language_id);
      Fieldvalues fv = this.getFieldvaluesById(fieldvalues_id);
      fv.setFieldlanguagesvalue(this.getFieldByIdAndLanguage(
          fieldvalues_id, language_id));
      return fv;
    } catch (Exception e) {
      log.error("[getFieldvaluesById] ", e);
    }
View Full Code Here

   * @return
   */
  public Long updateLabel(Long fieldvalues_id, String name,
      Long fieldlanguagesvalues_id, String value) {
    try {
      Fieldvalues fv = this.getFieldvaluesById(fieldvalues_id);
      if (fv == null) {
        return new Long(-24);
      } else {
        fv.setName(name);
        fv.setUpdatetime(new Date());
        this.updateField(fv);
      }
      Fieldlanguagesvalues flv = this
          .getFieldlanguagesvaluesById(fieldlanguagesvalues_id);
      if (flv == null) {
View Full Code Here

  }

  public Long addAndUpdateLabel(Long fieldvalues_id, String name,
      String value, Long language_id) {
    try {
      Fieldvalues fv = this.getFieldvaluesById(fieldvalues_id);
      if (fv == null) {
        return new Long(-24);
      } else {
        fv.setName(name);
        fv.setUpdatetime(new Date());
        this.updateField(fv);
      }
      this.addFieldValueByFieldAndLanguage(fv, language_id,
          value);
      return fieldvalues_id;
View Full Code Here

    return q.getSingleResult() + 1;
  }
 
  public Long addFieldAndLabel(String name, String value, Long language_id) {
    try {
      Fieldvalues fv = addFieldById(name, getNextFieldvaluesId());
      if (fv.getFieldvalues_id() > 0) {
        this.addFieldValueByFieldAndLanguage(fv,
            language_id, value);
        return fv.getFieldvalues_id();
      } else {
        return -1L;
      }
    } catch (Exception ex2) {
      log.error("[updateFieldLanguagesLabel]: ", ex2);
View Full Code Here

  public Fieldvalues getFieldvaluesById(Long fieldvalues_id) {
    String hql = "select f from Fieldvalues f WHERE f.fieldvalues_id = :fieldvalues_id ";
    TypedQuery<Fieldvalues> query = em.createQuery(hql, Fieldvalues.class);
    query.setParameter("fieldvalues_id", fieldvalues_id);
    Fieldvalues fv = null;
    try {
      fv = query.getSingleResult();
    } catch (NoResultException ex) {
    }
    return fv;
View Full Code Here

TOP

Related Classes of org.openmeetings.app.persistence.beans.lang.Fieldvalues

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.