Source:
<code>public static VdsStatic map(PowerManagement model, VdsStatic template) { VdsStatic entity = template != null ? template : new VdsStatic(); if (model.isSetType()) { entity.setpm_type(model.getType()); } if (model.isSetEnabled()) { entity.setpm_enabled(model.isEnabled()); } if (model.isSetAddress()) { entity.setManagmentIp(model.getAddress()); } if (model.isSetUsername()) { entity.setpm_user(model.getUsername()); } if (model.isSetPassword()) { entity.setpm_password(model.getPassword()); } if (model.isSetOptions()) { entity.setpm_options(map(model.getOptions(), null)); } if (model.isSetAgents()) { for (Agent agent : model.getAgents().getAgents()) { int order = 1; if (agent.isSetOrder()) { order = agent.getOrder(); } <START> if (order == 1) { END> if (agent.isSetType()) { entity.setpm_type(agent.getType()); } if (agent.isSetAddress()) { entity.setManagmentIp(agent.getAddress()); } if (agent.isSetUsername()) { entity.setpm_user(agent.getUsername()); } if (agent.isSetPassword()) { entity.setpm_password(agent.getPassword()); } if (agent.isSetOptions()) { entity.setpm_options(map(agent.getOptions(), null)); } } else if (order == 2) { if (agent.isSetType()) { entity.setPmSecondaryType(model.getType()); } if (agent.isSetAddress()) { entity.setPmSecondaryIp(agent.getAddress()); } if (agent.isSetUsername()) { entity.setPmSecondaryUser(agent.getUsername()); } if (agent.isSetPassword()) { entity.setPmSecondaryPassword(agent.getPassword()); } if (agent.isSetOptions()) { entity.setPmSecondaryOptions(map(agent.getOptions(), null)); } if (agent.isSetConcurrent()) { entity.setPmSecondaryConcurrent(agent.isConcurrent()); } } } } return entity; }</code><technical_language>if set order in agent, added agents, mapping override primary, move 'int order = 1;' out of for() increment order here: => order ++</technical_language>

Target:
public static VdsStatic map(PowerManagement model, VdsStatic template) { VdsStatic entity = template != null ? template : new VdsStatic(); if (model.isSetType()) { entity.setpm_type(model.getType()); } if (model.isSetEnabled()) { entity.setpm_enabled(model.isEnabled()); } if (model.isSetAddress()) { entity.setManagmentIp(model.getAddress()); } if (model.isSetUsername()) { entity.setpm_user(model.getUsername()); } if (model.isSetPassword()) { entity.setpm_password(model.getPassword()); } if (model.isSetOptions()) { entity.setpm_options(map(model.getOptions(), null)); } if (model.isSetAgents()) { int order = 1; for (Agent agent : model.getAgents().getAgents()) { if (agent.isSetOrder()) { order = agent.getOrder(); } if (order == 1) { order++; if (agent.isSetType()) { entity.setpm_type(agent.getType()); } if (agent.isSetAddress()) { entity.setManagmentIp(agent.getAddress()); } if (agent.isSetUsername()) { entity.setpm_user(agent.getUsername()); } if (agent.isSetPassword()) { entity.setpm_password(agent.getPassword()); } if (agent.isSetOptions()) { entity.setpm_options(map(agent.getOptions(), null)); } } else if (order == 2) { if (agent.isSetType()) { entity.setPmSecondaryType(model.getType()); } if (agent.isSetAddress()) { entity.setPmSecondaryIp(agent.getAddress()); } if (agent.isSetUsername()) { entity.setPmSecondaryUser(agent.getUsername()); } if (agent.isSetPassword()) { entity.setPmSecondaryPassword(agent.getPassword()); } if (agent.isSetOptions()) { entity.setPmSecondaryOptions(map(agent.getOptions(), null)); } if (agent.isSetConcurrent()) { entity.setPmSecondaryConcurrent(agent.isConcurrent()); } } } } return entity; }