-
Notifications
You must be signed in to change notification settings - Fork 609
NMS-18234: Delete one or more sources by ID (also deletes associated events) #7897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# Conflicts: # opennms-webapp-rest/src/main/java/org/opennms/web/rest/v2/EventConfPersistenceService.java # opennms-webapp-rest/src/main/java/org/opennms/web/rest/v2/EventConfRestService.java # opennms-webapp-rest/src/main/java/org/opennms/web/rest/v2/api/EventConfRestApi.java # opennms-webapp-rest/src/test/java/org/opennms/web/rest/v2/EventConfPersistenceServiceIT.java # opennms-webapp-rest/src/test/java/org/opennms/web/rest/v2/EventConfRestServiceIT.java
|
|
||
| String hql = "delete from EventConfSource s where s.id in (" + placeholders + ")"; | ||
|
|
||
| int deletedCount = getHibernateTemplate().bulkUpdate(hql, sourceIds.toArray()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be we can improve this:
int deletedCount = getHibernateTemplate().execute(session ->
session.createQuery("delete from EventConfSource s where s.id in (:ids)")
.setParameterList("ids", sourceIds)
.executeUpdate()
);
|
Also you need to resolve merge conflicts. |
# Conflicts: # opennms-dao-api/src/main/java/org/opennms/netmgt/dao/api/EventConfSourceDao.java # opennms-dao/src/main/java/org/opennms/netmgt/dao/hibernate/EventConfSourceDaoHibernate.java # opennms-webapp-rest/src/main/java/org/opennms/web/rest/v2/EventConfPersistenceService.java # opennms-webapp-rest/src/main/java/org/opennms/web/rest/v2/EventConfRestService.java # opennms-webapp-rest/src/main/java/org/opennms/web/rest/v2/api/EventConfRestApi.java # opennms-webapp-rest/src/test/java/org/opennms/web/rest/v2/EventConfPersistenceServiceIT.java # opennms-webapp-rest/src/test/java/org/opennms/web/rest/v2/EventConfRestServiceIT.java
…events): Implement reviews changes.
cgorantla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
# Conflicts: # opennms-webapp-rest/src/test/java/org/opennms/web/rest/v2/EventConfPersistenceServiceIT.java
External References