public static GlobalParameterDto getGlobalParameter(DbConn cnx, String key) { return getGlobalParameter(cnx, "globalprm_select_by_key", key); }
public static GlobalParameterDto getGlobalParameter(DbConn cnx, Integer key) { return getGlobalParameter(cnx, "globalprm_select_by_id", key); }
public static GlobalParameterDto getGlobalParameter(DbConn cnx, String key) { return getGlobalParameter(cnx, "globalprm_select_by_key", key); }
public static GlobalParameterDto getGlobalParameter(DbConn cnx, Integer key) { return getGlobalParameter(cnx, "globalprm_select_by_id", key); }
public static void syncGlobalParameters(DbConn cnx, List<GlobalParameterDto> dtos) { for (GlobalParameterDto existing : getGlobalParameter(cnx)) { boolean foundInNewSet = false; for (GlobalParameterDto newdto : dtos) { if (newdto.getId() != null && newdto.getId().equals(existing.getId())) { foundInNewSet = true; break; } } if (!foundInNewSet) { deleteGlobalParameter(cnx, existing.getId()); } } for (GlobalParameterDto dto : dtos) { upsertGlobalParameter(cnx, dto); } }
public static void syncGlobalParameters(DbConn cnx, List<GlobalParameterDto> dtos) { for (GlobalParameterDto existing : getGlobalParameter(cnx)) { boolean foundInNewSet = false; for (GlobalParameterDto newdto : dtos) { if (newdto.getId() != null && newdto.getId().equals(existing.getId())) { foundInNewSet = true; break; } } if (!foundInNewSet) { deleteGlobalParameter(cnx, existing.getId()); } } for (GlobalParameterDto dto : dtos) { upsertGlobalParameter(cnx, dto); } }
Assert.assertEquals("value1", MetaService.getGlobalParameter(cnx, "key1").getValue()); Assert.assertEquals("value2", MetaService.getGlobalParameter(cnx, "key1").getValue());