Lps 49124

LPS-49124 - mySQL and Oracle databases do not handle "is null (=null) and "is not null (!=null)" the same way. Modify the queries to work with Oracle databases.
LPS-49124 Simplfy deleteOrphanedLayouts method, and ensure the SQL query works with Oracle databases.