if (frequency == null) {
frequency = new SignalFrequency();
frequency.setFrequency(new BigDecimal(signalFrequencyWs.getFrequency()));
frequency.setDescription(signalFrequencyWs.getName());
FacadeDB.getInstance().getSignalFrequencyBroker().insert(frequency);
SignalFrequencyRemote frequencyRemote = new SignalFrequencyRemote(frequency);
frequencyRemote.setRemoteId(signalFrequencyWs.getId());
FacadeDB.getInstance().getSignalFrequencySyncBroker().saveSignalFrequencyRemote(frequencyRemote);
} else {
if (FacadeDB.getInstance().getSignalFrequencySyncBroker().getFrequencyRemoteBySignalFrequency(frequency) == null) {
SignalFrequencyRemote frequencyRemote = new SignalFrequencyRemote(frequency);
frequencyRemote.setRemoteId(signalFrequencyWs.getId());
FacadeDB.getInstance().getSignalFrequencySyncBroker().saveSignalFrequencyRemote(frequencyRemote);
}
}
FacadeDB.getInstance().commitTransaction();
}