Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用休眠,我用我的 bean 映射了我的表。如果我没有将任何特定的列值分配为@id,它会抛出“没有为实体指定标识符”错误,但它不是我的数据表中的主键。我想添加具有相同数据的多条记录。我该怎么做?当我用@id 注释我的产品名称列时,我的代码运行完美。
Hibernate 需要每个实体的标识符。但是,可以使用本机查询来插入新记录。并且,以同样的方式,恢复它们。