metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kaspersorensen <...@git.apache.org>
Subject [GitHub] metamodel pull request #137: Metamodel 1132 sql native paging
Date Fri, 09 Dec 2016 22:44:35 GMT
Github user kaspersorensen commented on a diff in the pull request:

    https://github.com/apache/metamodel/pull/137#discussion_r91810278
  
    --- Diff: jdbc/src/main/java/org/apache/metamodel/jdbc/dialects/AbstractQueryRewriter.java
---
    @@ -460,4 +460,25 @@ public Object getResultSetValue(ResultSet resultSet, int columnIndex,
Column col
             }
             return resultSet.getObject(columnIndex);
         }
    +
    +    protected boolean isSupportedVersion(String databaseProductName, int databaseVersion)
{
    +
    +        if(databaseProductName.equals(_dataContext.getDatabaseProductName())
    +                && databaseVersion <= databaseVersionToInt(_dataContext.getDatabaseVersion()))
{
    +            return true;
    +        }
    +        return false;
    +    }
    +
    +    private int databaseVersionToInt(String version) {
    +        int firstDot = -1;
    +        if(version != null) {
    +            firstDot = version.indexOf('.');
    +        }
    +        if(firstDot >= 0) {
    +            return Integer.valueOf(version.substring(0, firstDot));
    --- End diff --
    
    This could throw an exception if the version from the DB is something like `R12.0`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message