New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daos.migration要支持Oracle和SqlServer的索引新增 #1149

Closed
wendal opened this Issue Oct 18, 2016 · 5 comments

Comments

Projects
None yet
3 participants
@wendal
Member

wendal commented Oct 18, 2016

当前实现下,启用索引自动添加的话,会抛异常

https://nutz.cn/yvr/t/pjil8oud60j58rtmkc56ss1vjr

@wendal wendal added this to the 1.r.59 milestone Oct 18, 2016

@hzl7652

This comment has been minimized.

Show comment
Hide comment
@hzl7652

hzl7652 Oct 19, 2016

Contributor

上午试着写了一下,本来以为通过以下代码可以取得索引信息的
indexRs = conn.getMetaData() .getIndexInfo(null, null, en.getTableName().toUpperCase(), false, false); while (indexRs.next()) { String index = indexRs.getString("INDEX_NAME"); _indexs.add(index); }
但是测试 Oracle 时,与看文档时发现在当索引类型为jdbc规定的 tableIndexStatistic 时 indexRs 结果集中 INDEX_NAME 为空 看来通过 jdbc元数据取索引名称不满足
Oracle 使用 SQL 查询表的索引信息语句如下:
SELECT * FROM user_indexes WHERE table_name='FACTORY_HEAD'
别的数据库不知道了

Contributor

hzl7652 commented Oct 19, 2016

上午试着写了一下,本来以为通过以下代码可以取得索引信息的
indexRs = conn.getMetaData() .getIndexInfo(null, null, en.getTableName().toUpperCase(), false, false); while (indexRs.next()) { String index = indexRs.getString("INDEX_NAME"); _indexs.add(index); }
但是测试 Oracle 时,与看文档时发现在当索引类型为jdbc规定的 tableIndexStatistic 时 indexRs 结果集中 INDEX_NAME 为空 看来通过 jdbc元数据取索引名称不满足
Oracle 使用 SQL 查询表的索引信息语句如下:
SELECT * FROM user_indexes WHERE table_name='FACTORY_HEAD'
别的数据库不知道了

@wendal

This comment has been minimized.

Show comment
Hide comment
@wendal

wendal Oct 19, 2016

Member

嗯嗯,我先试试oracle怎么搞

Member

wendal commented Oct 19, 2016

嗯嗯,我先试试oracle怎么搞

@wendal wendal closed this in 888c479 Oct 19, 2016

@wendal wendal reopened this Oct 19, 2016

@wendal wendal self-assigned this Oct 19, 2016

@wendal wendal added the 开发任务 label Nov 14, 2016

@wendal wendal modified the milestones: 1.r.60, 1.r.59 Nov 29, 2016

@wendal wendal modified the milestones: 1.r.61, 1.r.60 Jan 15, 2017

@wendal

This comment has been minimized.

Show comment
Hide comment
@wendal

wendal Feb 13, 2017

Member

pgsql也是挂

Member

wendal commented Feb 13, 2017

pgsql也是挂

@wendal wendal modified the milestones: 1.r.62, 1.r.61 Apr 17, 2017

@tanqimin

This comment has been minimized.

Show comment
Hide comment
@tanqimin

tanqimin May 12, 2017

SqlServer 查询索引的方法:
SELECT idx.name FROM sysindexes idx JOIN sysindexkeys idk ON idx.id = idk.id AND idx.indid = idk.indid JOIN sysobjects o ON idk.id = o.id AND o.xtype = 'U' WHERE o.name = 'ERP_ORGANIZATION_TYPE'

tanqimin commented May 12, 2017

SqlServer 查询索引的方法:
SELECT idx.name FROM sysindexes idx JOIN sysindexkeys idk ON idx.id = idk.id AND idx.indid = idk.indid JOIN sysobjects o ON idk.id = o.id AND o.xtype = 'U' WHERE o.name = 'ERP_ORGANIZATION_TYPE'

@wendal wendal closed this in e14eb6f May 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment