the problem is at
# SEVERE: Duplicate entry '5' for key 1
# Jan 30, 2010 10:09:16 AM org.hibernate.event.def.AbstractFlushingEventListener performExecutions
# SEVERE: Could not synchronize database state with session
# org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
for resolving this you need to change the id of you entity as you said. for that you need to use
@GeneratedValue annotation for generating your id every time you persist them.
it should be like this
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
this way your ids will be generated automatically, there some other strategies also available for Id generation like
Identity, Sequence and Table
here what I think is some are database dependent so Table strategy is the best one and most suitable to my requirement.
if you want know more about other attributes then please try some googling like Id generation in JPA or refer the docs or post reply and I will get back with more details