Enable junit test cases and fix defects.
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / service / EPAppCommonServiceImpl.java
index 6a0da9b..b51ea1a 100644 (file)
@@ -770,6 +770,21 @@ public class EPAppCommonServiceImpl implements EPAppService {
                        logQuery(sql);
                        query = localSession.createSQLQuery(sql);
                        query.executeUpdate();
+                       
+                       
+                       // Remove all roles, rolefunctions, appid records from ep_app_role_function
+                       // that are associated with this app
+                   sql = "DELETE FROM ep_app_role_function WHERE app_id='" + appid + "'";
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
+                        query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+                       
+                       //Remove all rolefunctions, appid records from ep_app_function
+                       // that are associated with this app
+                       sql = "DELETE FROM ep_app_function WHERE app_id='" + appid + "'";
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
 
                        // Remove all records from fn_user_role associated with this app
                        sql = "delete from fn_user_role where app_id='" + appid + "'";