6428 PR comments

This commit is contained in:
Ethan Roseman 2020-06-11 11:36:52 -04:00
parent 15dbc32736
commit f565cf8344
2 changed files with 15 additions and 6 deletions

View File

@ -255,7 +255,7 @@ public class Persona {
}
/**
* Sets the comment of this persona
* Sets the comment of this persona.
*
* @param name The new comment.
*
@ -263,7 +263,10 @@ public class Persona {
*/
public void setComment(String comment) throws CentralRepoException {
String updateClause = "UPDATE personas SET comment = \"" + comment + "\" WHERE id = " + id;
CentralRepository.getInstance().executeUpdateSQL(updateClause);
CentralRepository cr = CentralRepository.getInstance();
if (cr != null) {
cr.executeUpdateSQL(updateClause);
}
}
/**
@ -275,7 +278,10 @@ public class Persona {
*/
public void setName(String name) throws CentralRepoException {
String updateClause = "UPDATE personas SET name = \"" + name + "\" WHERE id = " + id;
CentralRepository.getInstance().executeUpdateSQL(updateClause);
CentralRepository cr = CentralRepository.getInstance();
if (cr != null) {
cr.executeUpdateSQL(updateClause);
}
}
/**
@ -311,7 +317,10 @@ public class Persona {
*/
public void delete() throws CentralRepoException {
String deleteSQL = "UPDATE personas SET status_id = " + PersonaStatus.DELETED.status_id + " WHERE id = " + this.id;
CentralRepository.getInstance().executeUpdateSQL(deleteSQL);
CentralRepository cr = CentralRepository.getInstance();
if (cr != null) {
cr.executeDeleteSQL(deleteSQL);
}
}
/**

View File

@ -56,7 +56,7 @@ public final class PersonaManagerTopComponent extends TopComponent {
@Messages({
"PMTopComponent_Name=Persona Manager",
"PMTopComponent_delete_exception_Title=Delete failure",
"PMTopComponent_delete_exception_msg=Failed to delete persona",
"PMTopComponent_delete_exception_msg=Failed to delete persona.",
})
public PersonaManagerTopComponent() {
initComponents();
@ -204,7 +204,7 @@ public final class PersonaManagerTopComponent extends TopComponent {
@Messages({
"PMTopComponent_search_exception_Title=Search failure",
"PMTopComponent_search_exception_msg=Failed to search personas",})
"PMTopComponent_search_exception_msg=Failed to search personas.",})
private void executeSearch() {
Collection<Persona> results;
try {