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"); }
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"); }
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"); }
public void delete() { dbUtility.applyToDatabase("DELETE FROM issues WHERE id = ?", id + ""); Loggo.log("Issue deleted"); }