You have the problem with the object of the same id that you want to store to the db. Because the object already exists in the session and you didn't get it from there. Here's another way to save your object:
BettingProgram bettingProgramInserted = bettingProgramRepository.merge(bettingProgram);