query.executeUpdate();
}
private void persistComposites(PartitionEvent event, Map<Agent, FailoverListComposite> agentServerListMap) {
FailoverList fl = null;
FailoverListDetails failoverListDetails = null;
PartitionEventDetails eventDetails = null;
for (Map.Entry<Agent, FailoverListComposite> next : agentServerListMap.entrySet()) {
Agent nextAgent = next.getKey();
FailoverListComposite nextComposite = next.getValue();
fl = new FailoverList(event, nextAgent);
entityManager.persist(fl);
boolean first = true;
for (int i = 0; i < nextComposite.size(); ++i) {
ServerEntry serverEntry = nextComposite.get(i);
Server server = entityManager.find(Server.class, serverEntry.serverId);
failoverListDetails = new FailoverListDetails(fl, i, server);
entityManager.persist(failoverListDetails);
// event details only shows the current primary server topology
if (first) {
eventDetails = new PartitionEventDetails(event, nextAgent, server);
entityManager.persist(eventDetails);