PL-10354 The query "delete from ..." through EntityManager removes entities without soft deletion

This commit is contained in:
Andrey Subbotin 2018-03-22 18:09:56 +04:00
parent 5cace0c5c2
commit 5ecfd4f768

View File

@ -606,6 +606,8 @@ public class QueryTest {
try {
em.setSoftDeletion(false);
em.createQuery("delete from sys$FileDescriptor f").executeUpdate();
} catch (javax.persistence.PersistenceException e) {
//It's OK integrity constraint violation
} finally {
em.setSoftDeletion(true);
}
@ -613,6 +615,8 @@ public class QueryTest {
try {
AppContext.setProperty("cuba.enableDeleteStatementInSoftDeleteMode", "true");
em.createQuery("delete from sys$FileDescriptor f").executeUpdate();
} catch (javax.persistence.PersistenceException e) {
//It's OK integrity constraint violation
} finally {
AppContext.setProperty("cuba.enableDeleteStatementInSoftDeleteMode", "false");
}