Class SQLOperation<T>

  • Type Parameters:
    T - The return type of the operation.

    public abstract class SQLOperation<T>
    extends java.lang.Object
    A functional interface (oh, please come Java 8 - you cannot come soon enough) to help manage out-of-control boilerplate-itis in SQL code.
    Author:
    Alex Kalderimis
    • Constructor Summary

      Constructors 
      Constructor Description
      SQLOperation()  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract T run​(java.sql.PreparedStatement stm)
      The code that the operation represents.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SQLOperation

        public SQLOperation()
    • Method Detail

      • run

        public abstract T run​(java.sql.PreparedStatement stm)
                       throws java.sql.SQLException
        The code that the operation represents.
        Parameters:
        stm - A prepared statement.
        Returns:
        A T (whatever that is).
        Throws:
        java.sql.SQLException - whenever you even think of touching the statement.