Exemplo n.º 1
0
  /**
   * Deep copy.
   *
   * @return cloned object
   * @throws CloneNotSupportedException on error
   */
  @Override
  public Results clone() throws CloneNotSupportedException {

    final Results copy = (Results) super.clone();

    copy.setExamIdexam(this.getExamIdexam());
    copy.setId(this.getId());
    copy.setModifiedTime(this.getModifiedTime());
    copy.setResults(this.getResults());
    copy.setStudentIdstudent(this.getStudentIdstudent());
    return copy;
  }
Exemplo n.º 2
0
  /**
   * Equals implementation.
   *
   * @see java.lang.Object#equals(java.lang.Object)
   * @param aThat Object to compare with
   * @return true/false
   */
  @Override
  public boolean equals(final Object aThat) {
    Object proxyThat = aThat;

    if (this == aThat) {
      return true;
    }

    if (aThat instanceof HibernateProxy) {
      // narrow down the proxy to the class we are dealing with.
      try {
        proxyThat = ((HibernateProxy) aThat).getHibernateLazyInitializer().getImplementation();
      } catch (org.hibernate.ObjectNotFoundException e) {
        return false;
      }
    }
    if (aThat == null) {
      return false;
    }

    final Results that;
    try {
      that = (Results) proxyThat;
      if (!(that.getClassType().equals(this.getClassType()))) {
        return false;
      }
    } catch (org.hibernate.ObjectNotFoundException e) {
      return false;
    } catch (ClassCastException e) {
      return false;
    }

    boolean result = true;
    result =
        result
            && (((this.getId() == null) && (that.getId() == null))
                || (this.getId() != null && this.getId().equals(that.getId())));
    result =
        result
            && (((getExamIdexam() == null) && (that.getExamIdexam() == null))
                || (getExamIdexam() != null
                    && getExamIdexam().getId().equals(that.getExamIdexam().getId())));
    result =
        result
            && (((getModifiedTime() == null) && (that.getModifiedTime() == null))
                || (getModifiedTime() != null && getModifiedTime().equals(that.getModifiedTime())));
    result =
        result
            && (((getResults() == null) && (that.getResults() == null))
                || (getResults() != null && getResults().equals(that.getResults())));
    result =
        result
            && (((getStudentIdstudent() == null) && (that.getStudentIdstudent() == null))
                || (getStudentIdstudent() != null
                    && getStudentIdstudent().getId().equals(that.getStudentIdstudent().getId())));
    return result;
  }