Class Lambda2Sql
- java.lang.Object
-
- com.github.collinalpert.lambda2sql.Lambda2Sql
-
public class Lambda2Sql extends java.lang.ObjectA 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.StringtoSql(SerializedFunctionalInterface functionalInterface)static java.lang.StringtoSql(SerializedFunctionalInterface functionalInterface, java.lang.String prefix)Converts a lambda expression to SQL.
-
-
-
Method Detail
-
toSql
public static java.lang.String toSql(SerializedFunctionalInterface functionalInterface, java.lang.String prefix)
Converts a lambda expression to SQL.
Becomes a string:person -> person.getAge() > 50 && person.isActive()
Supported operators:"age > 50 AND active">,>=,<,<=,=,!=,&&,||,!- Parameters:
functionalInterface- AFunctionalInterfacelambda to convert.prefix- An optional prefix to proceed the column name. Usually it is supposed to be used to reference the column name including the table name.- Returns:
- A
Stringdescribing the SQL where condition.
-
toSql
public static java.lang.String toSql(SerializedFunctionalInterface functionalInterface)
-
-