Class SqlAnnotations


  • public class SqlAnnotations
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private SqlAnnotations()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Optional<java.lang.String> getAnnotationValue​(java.lang.reflect.Method method)
      Returns the value() of the @SqlBatch, @SqlCall, @SqlQuery, @SqlUpdate, @SqlScripts, or @SqlScript annotation on the given method if declared and non-empty; empty otherwise.
      static java.util.Optional<java.lang.String> getAnnotationValue​(java.lang.reflect.Method method, java.util.function.Function<java.lang.String,​java.lang.String> transformation)
      Returns the value() of the @SqlBatch, @SqlCall, @SqlQuery, @SqlUpdate, @SqlScripts, or @SqlScript annotation on the given method if declared; empty otherwise.
      • Methods inherited from class java.lang.Object

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

      • SqlAnnotations

        private SqlAnnotations()
    • Method Detail

      • getAnnotationValue

        public static java.util.Optional<java.lang.String> getAnnotationValue​(java.lang.reflect.Method method)
        Returns the value() of the @SqlBatch, @SqlCall, @SqlQuery, @SqlUpdate, @SqlScripts, or @SqlScript annotation on the given method if declared and non-empty; empty otherwise.
        Parameters:
        method - the method
        Returns:
        the annotation value()
      • getAnnotationValue

        public static java.util.Optional<java.lang.String> getAnnotationValue​(java.lang.reflect.Method method,
                                                                              java.util.function.Function<java.lang.String,​java.lang.String> transformation)
        Returns the value() of the @SqlBatch, @SqlCall, @SqlQuery, @SqlUpdate, @SqlScripts, or @SqlScript annotation on the given method if declared; empty otherwise. Note: @SqlScripts values are mapped individually and concatenated with " ; ", hence the transformation parameter.
        Parameters:
        method - the method
        transformation - the String transformation (e.g. SQL lookup) to apply to the found value(s)
        Returns:
        the annotation value()