Added newline at the end of PersistenceManager
This commit is contained in:
parent
47ca47a761
commit
ca2fa5d1e2
@ -184,15 +184,15 @@ public class PersistenceManager {
|
|||||||
* @since Envoy Server Standalone v0.1-alpha
|
* @since Envoy Server Standalone v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public void addContact(long userId1, long userId2) {
|
public void addContact(long userId1, long userId2) {
|
||||||
|
|
||||||
// Get users by ID
|
// Get users by ID
|
||||||
User u1 = getUserById(userId1);
|
User u1 = getUserById(userId1);
|
||||||
User u2 = getUserById(userId2);
|
User u2 = getUserById(userId2);
|
||||||
|
|
||||||
// Add users to each others contact lists
|
// Add users to each others contact lists
|
||||||
u1.getContacts().add(u2);
|
u1.getContacts().add(u2);
|
||||||
u2.getContacts().add(u1);
|
u2.getContacts().add(u1);
|
||||||
|
|
||||||
// Synchronize changes with the database
|
// Synchronize changes with the database
|
||||||
transaction.begin();
|
transaction.begin();
|
||||||
entityManager.merge(u1);
|
entityManager.merge(u1);
|
||||||
@ -226,4 +226,4 @@ public class PersistenceManager {
|
|||||||
entityManager.remove(obj);
|
entityManager.remove(obj);
|
||||||
transaction.commit();
|
transaction.commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user