Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.skife.jdbi.v2.sqlobject.customizers;
 
 
Used to specify the maximum numb er of rows to return on a result set. Passes through to setMaxRows on the JDBC prepared statement.
public @interface MaxRows
{
    
The max number of rows to return from the query.
    int value();
    static class Factory implements SqlStatementCustomizerFactory
    {
        public SqlStatementCustomizer createForMethod(Annotation annotationClass sqlObjectTypeMethod method)
        {
            final int va = ((MaxRows)annotation).value();
            return new SqlStatementCustomizer()
            {
                public void apply(SQLStatement qthrows SQLException
                {
                    assert q instanceof Query;
                    ((Query)q).setMaxRows(va);
                }
            };
        }
        public SqlStatementCustomizer createForType(Annotation annotationClass sqlObjectType)
        {
            final int va = ((MaxRows)annotation).value();
            return new SqlStatementCustomizer()
            {
                public void apply(SQLStatement qthrows SQLException
                {
                    assert q instanceof Query;
                    ((Query)q).setMaxRows(va);
                }
            };
        }
        public SqlStatementCustomizer createForParameter(Annotation annotationClass sqlObjectTypeMethod methodObject arg)
        {
            final Integer va = (Integerarg;
            return new SqlStatementCustomizer()
            {
                public void apply(SQLStatement qthrows SQLException
                {
                    assert q instanceof Query;
                    ((Query)q).setMaxRows(va);
                }
            };
        }
    }
New to GrepCode? Check out our FAQ X