Resolving Contraint Voilation exception for Id Generation