if (profession == null) {
profession = new Profession();
profession.setName(professionWs.getName());
profession.setDescription(professionWs.getDescription());
FacadeDB.getInstance().getProfessionBroker().insert(profession);
ProfessionRemote professionRemote = new ProfessionRemote(profession);
professionRemote.setRemoteId(professionWs.getId());
FacadeDB.getInstance().getProfessionSyncBroker().saveProfessionRemote(professionRemote);
} else {
if (FacadeDB.getInstance().getProfessionSyncBroker().getProfessionRemoteByProfession(profession) == null) {
ProfessionRemote professionRemote = new ProfessionRemote(profession);
professionRemote.setRemoteId(professionWs.getId());
FacadeDB.getInstance().getProfessionSyncBroker().saveProfessionRemote(professionRemote);
}
}
FacadeDB.getInstance().commitTransaction();
}