Class Lambda2Sql


  • public class Lambda2Sql
    extends java.lang.Object
    A utility class for converting java lambdas to SQL.
    • Constructor Summary

      Constructors 
      Constructor Description
      Lambda2Sql()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String toSql​(SerializedFunctionalInterface functionalInterface)
      Converts a lambda expression to SQL.
      • Methods inherited from class java.lang.Object

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

      • Lambda2Sql

        public Lambda2Sql()
    • Method Detail

      • toSql

        public static java.lang.String toSql​(SerializedFunctionalInterface functionalInterface)
        Converts a lambda expression to SQL.
        person -> person.getAge() > 50 && person.isActive() 
        Becomes a string:
        "age > 50 AND active" 
        Supported operators: >,>=,<,<=,=,!=,&&,||,!
        Parameters:
        functionalInterface - The lambda to convert.
        Returns:
        A String describing the SQL where condition.