How to set id in model? I try this code:
public Community(Long id, ...) {
this.id = id;
....
}
But when I do this:
Communtiy c = new (1, ...);
c.save();
Hibernate say:
Execution exception PersistenceException occured : org.hibernate.PersistentObjectException: detached entity passed to persist: models.Community