public int compareTo(JIRAChangeGroup jiraChangeGroup) {
    int value = 0;

    value = DateUtil.compareTo(getCreateDate(), jiraChangeGroup.getCreateDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
  @Override
  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    }

    JIRAChangeGroup jiraChangeGroup = null;

    try {
      jiraChangeGroup = (JIRAChangeGroup) obj;
    } catch (ClassCastException cce) {
      return false;
    }

    long primaryKey = jiraChangeGroup.getPrimaryKey();

    if (getPrimaryKey() == primaryKey) {
      return true;
    } else {
      return false;
    }
  }
  /**
   * Adds the j i r a change group to the database. Also notifies the appropriate model listeners.
   *
   * @param jiraChangeGroup the j i r a change group
   * @return the j i r a change group that was added
   * @throws SystemException if a system exception occurred
   */
  public JIRAChangeGroup addJIRAChangeGroup(JIRAChangeGroup jiraChangeGroup)
      throws SystemException {
    jiraChangeGroup.setNew(true);

    jiraChangeGroup = jiraChangeGroupPersistence.update(jiraChangeGroup, false);

    Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());

    if (indexer != null) {
      try {
        indexer.reindex(jiraChangeGroup);
      } catch (SearchException se) {
        if (_log.isWarnEnabled()) {
          _log.warn(se, se);
        }
      }
    }

    return jiraChangeGroup;
  }