@Override
public void save() throws AppCatalogException {
EntityManager em = null;
try {
em = AppCatalogJPAUtils.getEntityManager();
ScpDataMovement existingScpDataMovement = em.find(ScpDataMovement.class, dataMovementInterfaceId);
em.close();
ScpDataMovement scpDataMovement;
em = AppCatalogJPAUtils.getEntityManager();
em.getTransaction().begin();
if (existingScpDataMovement == null) {
scpDataMovement = new ScpDataMovement();
} else {
scpDataMovement = existingScpDataMovement;
}
scpDataMovement.setQueueDescription(getQueueDescription());
scpDataMovement.setDataMovementInterfaceId(getDataMovementInterfaceId());
scpDataMovement.setSecurityProtocol(getSecurityProtocol());
scpDataMovement.setAlternativeScpHostname(getAlternativeScpHostname());
scpDataMovement.setSshPort(getSshPort());
if (existingScpDataMovement == null) {
em.persist(scpDataMovement);
} else {
em.merge(scpDataMovement);
}