@Override
public void save() throws AppCatalogException {
EntityManager em = null;
try {
em = AppCatalogJPAUtils.getEntityManager();
GridftpDataMovement existingGridftpDataMovement = em.find(GridftpDataMovement.class, dataMovementInterfaceId);
em.close();
GridftpDataMovement gridftpDataMovement;
em = AppCatalogJPAUtils.getEntityManager();
em.getTransaction().begin();
if (existingGridftpDataMovement == null) {
gridftpDataMovement = new GridftpDataMovement();
} else {
gridftpDataMovement = existingGridftpDataMovement;
}
gridftpDataMovement.setDataMovementInterfaceId(getDataMovementInterfaceId());
gridftpDataMovement.setSecurityProtocol(getSecurityProtocol());
if (existingGridftpDataMovement == null) {
em.persist(gridftpDataMovement);
} else {
em.merge(gridftpDataMovement);
}