if the id property is assigned by value,the exception list as below jakarta.persistence.PersistenceException: Converting org.hibernate.PersistentObjectException to JPA PersistenceException : detached entity passed to persist: demo.jpa.demo2022112104.ProductUUID if not assigned,the error message is:ids for this class must be manually assigned before calling save() the domain model is as follows
@Entity
public class ProductUUID {
@Id
@GeneratedValue(generator="assigned")
@GenericGenerator(name="assigned",
strategy="assigned",
parameters= {
@Parameter(name="entity_name",
value="ProductUUID"
)
}
)
private String id;
...
}
|