我在hibernate中创建id字段有问题。我想列出mysql控制台中的所有序列。多么?
谢谢
发布于 2011-12-06 15:53:51
这在很大程度上取决于您是如何设置序列的,但是如果您使用的是自动增量@GeneratedValue(strategy = GenerationType.AUTO),下面的SQL将为您提供一个使用auto_increment的表和列的列表:
select * from information_schema.columns where extra like '%auto_increment%';如果您只想要一个表列表,请使用
select * from information_schema.tables where auto_increment is not null;发布于 2011-12-06 20:54:14
在您的Java实体包(hibernate映射)中,搜索@ID注释(假设您正在使用注释),这将显示您的ID字段和用于生成ID的策略(自动生成等)。
为了进行比较,您还可以导出auto_increment数据库的模式,并在文本编辑器中搜索mysql元数据。
但是..。你的身份证到底有什么问题?
https://stackoverflow.com/questions/8396680
复制相似问题