List entries = assoc.getEntries();
Iterator innerIter = entries.iterator();
while (innerIter.hasNext()) {
buf = new StringBuffer();
AssociationEntry entry = (AssociationEntry)innerIter.next();
buf.append("INSERT INTO association_entries VALUES (");
buf.append("'").
append(name).
append("'");
// IP address must be present
buf.append(", '").
append(entry.getIpAddress()).
append("'");
if (entry.getMac() != null) {
// Prefix explicit MAC addresses so they can be detected on load
buf.append(", '").
append(entry.isExplicitMac() ? EXPLICIT_MAC_PREFIX : "").
append(entry.getMac()).
append("'");
} else {
buf.append(", NULL");
}
if (entry.getHostname() != null) {
buf.append(", '").
append(entry.getHostname()).
append("'");
} else {
buf.append(", NULL");
}
if (entry.getGateway() != null) {
buf.append(", '").
append(entry.getGateway()).
append("'");
} else {
buf.append(", NULL");
}
if (entry.getBroadcast() != null) {
buf.append(", '").
append(entry.getBroadcast()).
append("'");
} else {
buf.append(", NULL");
}
if (entry.getSubnetMask() != null) {
buf.append(", '").
append(entry.getSubnetMask()).
append("'");
} else {
buf.append(", NULL");
}
if (entry.isInUse()) {
buf.append(", 1)");
} else {
buf.append(", 0)");
}