Beispiel #1
0
  public void insert() {
    if (id > 0) {
      String query =
          "INSERT INTO events(id, issueId, eventCreatorId, eventTypeId, comment, eventDate) "
              + "VALUES (?, ?, ?, ?, ?, ?)";

      id =
          dbUtility.applyToDatabase(
              query,
              id + "",
              issueId + "",
              eventCreatorId + "",
              eventTypeId + "",
              comment,
              new Timestamp(eventDate).toString());
    } else {
      String query =
          "INSERT INTO events(issueId, eventCreatorId, eventTypeId, comment, eventDate) "
              + "VALUES (?, ?, ?, ?, ?)";

      id =
          dbUtility.applyToDatabase(
              query,
              issueId + "",
              eventCreatorId + "",
              eventTypeId + "",
              comment,
              new Timestamp(eventDate).toString());
    }

    Loggo.log("Event inserted");
  }
Beispiel #2
0
  public void update() {
    String query =
        "UPDATE issues SET name = ?, typeId = ?, projectId = ?, creatorId = ?, assignedUserId = ?, categoryId = ?, statusId = ?, description = ?"
            + " WHERE id = ?";

    dbUtility.applyToDatabase(
        query,
        name,
        typeId + "",
        projectId + "",
        creatorId + "",
        assigneeId + "",
        categoryId + "",
        statusId + "",
        description,
        id + "");

    Loggo.log("Issue updated");
  }
Beispiel #3
0
  public void insert() {
    if (id > 0) {
      String query =
          "INSERT INTO issues(id, name, typeId, projectId, creatorId, assignedUserId, categoryId, statusId, description) "
              + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";

      id =
          dbUtility.applyToDatabase(
              query,
              id + "",
              name,
              typeId + "",
              projectId + "",
              creatorId + "",
              assigneeId + "",
              categoryId + "",
              statusId + "",
              description);
    } else {
      String query =
          "INSERT INTO issues(name, typeId, projectId, creatorId, assignedUserId, categoryId, statusId, description) "
              + "VALUES (?, ?, ?, ?, ?, ?, ?, ?)";

      id =
          dbUtility.applyToDatabase(
              query,
              name,
              typeId + "",
              projectId + "",
              creatorId + "",
              assigneeId + "",
              categoryId + "",
              statusId + "",
              description);
    }

    Loggo.log("Issue inserted");
  }
Beispiel #4
0
  public void delete() {
    dbUtility.applyToDatabase("DELETE FROM issues WHERE id = ?", id + "");

    Loggo.log("Issue deleted");
  }