fix error update postgresql database owner

This commit is contained in:
Peter Hormanns 2013-07-15 12:25:47 +02:00
parent fde6cbd9cd
commit c0413f7deb

View File

@ -75,8 +75,8 @@ public class PgSqlDatabaseModuleImpl extends AbstractModuleImpl {
Transaction transaction = getTransaction(); Transaction transaction = getTransaction();
EntityManager em = transaction.getEntityManager(); EntityManager em = transaction.getEntityManager();
UnixUser unixUser = transaction.getLoginUser(); UnixUser unixUser = transaction.getLoginUser();
MySqlDatabase detachtedDB = (MySqlDatabase) existingEntity; PgSqlDatabase detachtedDB = (PgSqlDatabase) existingEntity;
MySqlDatabase attachedDB = em.find(MySqlDatabase.class, detachtedDB.getId()); PgSqlDatabase attachedDB = em.find(PgSqlDatabase.class, detachtedDB.getId());
if (!attachedDB.getName().equals(detachtedDB.getName())) { if (!attachedDB.getName().equals(detachtedDB.getName())) {
throw new AuthorisationException(unixUser, "update", existingEntity, "name"); throw new AuthorisationException(unixUser, "update", existingEntity, "name");
} }