org.hibernate.id.IdentifierGenerationException 【问题】org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): 【原因】在添加数据的时候没有添加主键对应的数据,在测试的时候就会出错,不允许添加数据。 【解决方式】主键设置的是非空的,添加主键对应的数据即可!