@Override
@Transactional
public RackEntity addRack(String name, List<String> hosts) {
RackEntity entity = new RackEntity(name);
for (String host : hosts) {
PhysicalHostEntity hostEntity = new PhysicalHostEntity(host);
hostEntity.setRack(entity);
entity.getHosts().add(hostEntity);
}
insert(entity);
return entity;
}