/**
   * Adds the resource block permission to the database. Also notifies the appropriate model
   * listeners.
   *
   * @param resourceBlockPermission the resource block permission
   * @return the resource block permission that was added
   */
  @Indexable(type = IndexableType.REINDEX)
  @Override
  public ResourceBlockPermission addResourceBlockPermission(
      ResourceBlockPermission resourceBlockPermission) {
    resourceBlockPermission.setNew(true);

    return resourceBlockPermissionPersistence.update(resourceBlockPermission);
  }
  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }

    if (!(obj instanceof ResourceBlockPermission)) {
      return false;
    }

    ResourceBlockPermission resourceBlockPermission = (ResourceBlockPermission) obj;

    long primaryKey = resourceBlockPermission.getPrimaryKey();

    if (getPrimaryKey() == primaryKey) {
      return true;
    } else {
      return false;
    }
  }
  @Override
  public int compareTo(ResourceBlockPermission resourceBlockPermission) {
    long primaryKey = resourceBlockPermission.getPrimaryKey();

    if (getPrimaryKey() < primaryKey) {
      return -1;
    } else if (getPrimaryKey() > primaryKey) {
      return 1;
    } else {
      return 0;
    }
  }