Package org.openmeetings.app.persistence.beans.basic

Examples of org.openmeetings.app.persistence.beans.basic.ErrorValues


  }
 
  final public void testAddErrorValues() throws Exception {

    EntityTransaction tx = getEntityManager().getTransaction();
    ErrorValues eValue = new ErrorValues();
    eValue.setErrorvalues_id(1L);
    eValue.setErrortype_id(1L);
    eValue.setDeleted("false");
    eValue.setStarttime(new Date());
    eValue.setFieldvalues_id(new Long(322));
    tx.begin();
    try {
      getEntityManager().merge(eValue);
      tx.commit();
    } catch (Exception e) {
View Full Code Here


   */
  public ErrorResult getErrorByCode(String SID, Long errorid, Long language_id) {
    log.debug("UserService.getErrorbyCode");
    try {
      if (errorid < 0) {
        ErrorValues eValues = ErrorManagement.getInstance()
            .getErrorValuesById(errorid * (-1));
        if (eValues != null) {
          Fieldlanguagesvalues errorValue = Fieldmanagment
              .getInstance().getFieldByIdAndLanguage(
                  eValues.getFieldvalues()
                      .getFieldvalues_id(), language_id);
          Fieldlanguagesvalues typeValue = Fieldmanagment
              .getInstance().getFieldByIdAndLanguage(
                  eValues.getErrorType().getFieldvalues()
                      .getFieldvalues_id(), language_id);
          if (errorValue != null) {
            return new ErrorResult(errorid, errorValue.getValue(),
                typeValue.getValue());
          }
View Full Code Here

        //Long users_id = Sessionmanagement.getInstance().checkSession(SID);
        //long user_level = Usermanagement.getInstance().getUserLevelByID(users_id);

        if (errorid<0){
//          log.debug("errorid,language_id: "+errorid+"|"+language_id);
          ErrorValues eValues = ErrorManagement.getInstance().getErrorValuesById(errorid*(-1));
          if (eValues!=null){
//            log.debug(eValues.getFieldvalues());
//            log.debug(eValues.getFieldvalues().getFieldvalues_id());
//            log.debug(eValues.getErrorType());
//            log.debug(eValues.getErrorType().getErrortype_id());
//            log.debug(eValues.getErrorType().getFieldvalues());
//            log.debug(eValues.getErrorType().getFieldvalues().getFieldvalues_id());
            Fieldlanguagesvalues errorValue = Fieldmanagment.getInstance().getFieldByIdAndLanguage(eValues.getFieldvalues().getFieldvalues_id(),language_id);
            Fieldlanguagesvalues typeValue = Fieldmanagment.getInstance().getFieldByIdAndLanguage(eValues.getErrorType().getFieldvalues().getFieldvalues_id(),language_id);
            if (errorValue!=null) {
              return new ErrorResult(errorid,errorValue.getValue(),typeValue.getValue());
            }
          }
        } else {
View Full Code Here

    return null;
  }
 
  public Long addErrorValues(Long errorvalues_id, Long errortype_id, Long fieldvalues_id) {
    try {
      ErrorValues eValue = new ErrorValues();
      eValue.setErrorvalues_id(errorvalues_id);
      eValue.setErrortype_id(errortype_id);
      eValue.setDeleted("false");
      eValue.setStarttime(new Date());
      eValue.setFieldvalues_id(fieldvalues_id);
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      eValue = session.merge(eValue);
      Long newerrorvalues_id = eValue.getErrorvalues_id();
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
      return newerrorvalues_id;
    } catch (Exception ex2) {
      log.error("[addErrorType]: " + ex2);
View Full Code Here

    return null;
 
 
  public Long getErrorValueById(Long errortype_id, Long fieldvalues_id) {
    try {
      ErrorValues eValue = new ErrorValues();
      eValue.setErrortype_id(errortype_id);
      eValue.setStarttime(new Date());
      eValue.setFieldvalues_id(fieldvalues_id);
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      eValue = session.merge(eValue);
      Long newerrorvalues_id = eValue.getErrorvalues_id();
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
      return newerrorvalues_id;
    } catch (Exception ex2) {
      log.error("[addErrorType]: " + ex2);
View Full Code Here

    return null;
 
 
  public Long updateErrorValues(Long errortype_id, Long fieldvalues_id) {
    try {
      ErrorValues eValue = new ErrorValues();
      eValue.setErrortype_id(errortype_id);
      eValue.setStarttime(new Date());
      eValue.setFieldvalues_id(fieldvalues_id);
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      eValue = session.merge(eValue);
      Long newerrorvalues_id = eValue.getErrorvalues_id();
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
      return newerrorvalues_id;
    } catch (Exception ex2) {
      log.error("[addErrorType]: " + ex2);
View Full Code Here

      tx.begin();
      session.flush();
      Query query = session.createQuery(hql);
      query.setParameter("errorvalues_id", errorvalues_id);
      query.setParameter("deleted", "true");
      ErrorValues e = null;
      try{
        e = (ErrorValues) query.getSingleResult();
          } catch (NoResultException ex) {
          }
      tx.commit();
View Full Code Here

   * @return
   */
  public ErrorResult getErrorByCode(String SID, long errorid, long language_id) {
    try {
      if (errorid < 0) {
        ErrorValues eValues = errorManagement
            .getErrorValuesById(errorid * (-1));
        if (eValues != null) {
          Fieldlanguagesvalues errorValue = fieldmanagment
              .getFieldByIdAndLanguage(
                  eValues.getFieldvalues_id(), language_id);
          Fieldlanguagesvalues typeValue = fieldmanagment
              .getFieldByIdAndLanguage(errorManagement
                  .getErrorType(eValues.getErrortype_id())
                  .getFieldvalues_id(), language_id);
          if (errorValue != null) {
            return new ErrorResult(errorid, errorValue.getValue(),
                typeValue.getValue());
          }
View Full Code Here

    // long user_level =
    // Usermanagement.getInstance().getUserLevelByID(users_id);

    if (errorid < 0) {
      log.debug("errorid, language_id: " + errorid + "|" + language_id);
      ErrorValues eValues = errorManagement.getErrorValuesById(-1
          * errorid);
      if (eValues != null) {
        log.debug("eValues.getFieldvalues_id() = " + eValues.getFieldvalues_id());
        // log.debug(eValues.getFieldvalues().getFieldvalues_id());
        log.debug("eValues.getErrorType() = " + errorManagement.getErrorType(eValues.getErrortype_id()));
        // log.debug(eValues.getErrorType().getErrortype_id());
        // log.debug(eValues.getErrorType().getFieldvalues());
        // log.debug(eValues.getErrorType().getFieldvalues().getFieldvalues_id());
        Fieldlanguagesvalues errorValue = fieldmanagment
            .getFieldByIdAndLanguage(eValues.getFieldvalues_id(),
                language_id);
        Fieldlanguagesvalues typeValue = fieldmanagment
            .getFieldByIdAndLanguage(errorManagement.getErrorType(eValues.getErrortype_id())
                .getFieldvalues_id(), language_id);
        if (errorValue != null) {
          return new ErrorResult(errorid, errorValue.getValue(),
              typeValue.getValue());
        }
View Full Code Here

  private ErrorManagement errorManagement;
  @Autowired
  private Fieldmanagment fieldmanagment;

  private Long getAvailableErrorValuesId() {
    ErrorValues ev = null;
    long result = START_ERRORVALUES_ID;
    while (true) {
      ev = errorManagement.getErrorValuesById(++result);
      System.err.println("result = " + result + "; ev == null ? "
          + (ev == null));
View Full Code Here

TOP

Related Classes of org.openmeetings.app.persistence.beans.basic.ErrorValues

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.