SnmpInterface and IpInterface cannot be deleted when using the according DAO
Description
When you delete a snmpIfInterface using the snmpIfInterfaceDAO it is not working properly.
The problem here is, that the SnmpIfInterface has a relationship to IpInterface, therefore you have not only to delete the SnmpIfInterface, but also disconnect the connection between them.
In addition to that one has to remove the connection on the associated node. Because each node has a list of all snmpIfInterfaces and ipInterfaces.
If this is not done, hibernate complains, because the object model is in an invalid state.
Either the according DAO must take care of this, or the persistence model (e.g. OnmsSnmpInterface object) has to be annotated correctly.
I manually implemented a disconnection in the DatabasePopulator:
To verify if this works, please add a test to SnmpInterfaceDaoIT which deletes a SnmpInterface by invoking "snmpInterfaceDao.delete(interface)" The same goes for OnmsIpInterface and IpInterfaceDao
When you delete a snmpIfInterface using the snmpIfInterfaceDAO it is not working properly.
The problem here is, that the SnmpIfInterface has a relationship to IpInterface, therefore you have not only to delete the SnmpIfInterface, but also disconnect the connection between them.
In addition to that one has to remove the connection on the associated node.
Because each node has a list of all snmpIfInterfaces and ipInterfaces.
If this is not done, hibernate complains, because the object model is in an invalid state.
Either the according DAO must take care of this, or the persistence model (e.g. OnmsSnmpInterface object) has to be annotated correctly.
I manually implemented a disconnection in the DatabasePopulator:
To verify if this works, please add a test to SnmpInterfaceDaoIT which deletes a SnmpInterface by invoking "snmpInterfaceDao.delete(interface)"
The same goes for OnmsIpInterface and IpInterfaceDao