This commit is contained in:
Looly 2022-09-24 11:54:13 +08:00
parent a4e98c6885
commit 1030f22757
2 changed files with 10 additions and 3 deletions

View File

@ -35,8 +35,8 @@ public class OracleDialect extends AnsiSqlDialect {
return find return find
.insertPreFragment("SELECT * FROM ( SELECT row_.*, rownum rownum_ from ( ") .insertPreFragment("SELECT * FROM ( SELECT row_.*, rownum rownum_ from ( ")
.append(" ) row_ where rownum <= ").append(startEnd[1])// .append(" ) row_ where rownum <= ").append(startEnd[1])//
.append(") table_alias")// .append(") table_alias_")//
.append(" where table_alias.rownum_ > ").append(startEnd[0]);// .append(" where table_alias_.rownum_ > ").append(startEnd[0]);//
} }
@Override @Override

View File

@ -150,9 +150,16 @@ public class ResultSetUtil {
*/ */
public static <T extends Entity> T toEntity(final T row, final int columnCount, final ResultSetMetaData meta, final ResultSet rs, final boolean withMetaInfo) throws SQLException { public static <T extends Entity> T toEntity(final T row, final int columnCount, final ResultSetMetaData meta, final ResultSet rs, final boolean withMetaInfo) throws SQLException {
int type; int type;
String columnLabel;
for (int i = 1; i <= columnCount; i++) { for (int i = 1; i <= columnCount; i++) {
type = meta.getColumnType(i); type = meta.getColumnType(i);
row.put(meta.getColumnLabel(i), getColumnValue(rs, i, type, null)); columnLabel = meta.getColumnLabel(i);
if("rownum_".equalsIgnoreCase(columnLabel)){
// issue#2618@Github
// 分页时会查出rownum字段此处忽略掉读取
continue;
}
row.put(columnLabel, getColumnValue(rs, i, type, null));
} }
if (withMetaInfo) { if (withMetaInfo) {
try { try {