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.
我正在学习 JPA,我想知道我们如何告诉实体管理器主键字段是使用数据库自动递增到表中生成的?我正在使用 Mysql 5.5 和 Oracle Enterprise For Eclipse(OEFE) 感谢您的帮助
如果您有需要自动递增的 id,那么,
@Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id;