Package io.ebean
Class Pairs
- java.lang.Object
-
- io.ebean.Pairs
-
public final class Pairs extends Object
Holds a list of value object pairs.This feature is to enable use of L2 cache with complex natural keys with findList() queries in cases where the IN clause is not a single property but instead a pair of properties.
These queries can have predicates that can be translated into a list of complex natural keys such that the L2 cache can be hit with these keys to obtain some or all of the beans from L2 cache rather than the DB.
{@code // where a bean is annotated with a complex // natural key made of several properties
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Pairs.Entry
A pair of 2 value objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Pairs
add(Object a, Object b)
Add a pair of value objects.String
concatSeparator()
Return the separator character used with DB varchar concatenation to combine the 2 values.Pairs
concatSeparator(String concatSeparator)
Set the separator character used with DB varchar concatenation to combine the 2 values.String
concatSuffix()
Return a suffix used with DB varchar concatenation to combine the 2 values.Pairs
concatSuffix(String concatSuffix)
Add a suffix used with DB varchar concatenation to combine the 2 values.List<Pairs.Entry>
entries()
Return all the value pairs.String
property0()
Return the first property name.String
property1()
Return the second property name.Pairs
setConcatSeparator(String concatSeparator)
Deprecated.Pairs
setConcatSuffix(String concatSuffix)
Deprecated.String
toString()
-
-
-
Method Detail
-
add
public Pairs add(Object a, Object b)
Add a pair of value objects.Both values are expected to be immutable with equals and hashCode implementations.
- Parameters:
a
- Value of the first propertyb
- Value of the second property
-
entries
public List<Pairs.Entry> entries()
Return all the value pairs.
-
concatSeparator
public String concatSeparator()
Return the separator character used with DB varchar concatenation to combine the 2 values.
-
concatSeparator
public Pairs concatSeparator(String concatSeparator)
Set the separator character used with DB varchar concatenation to combine the 2 values.
-
setConcatSeparator
@Deprecated public Pairs setConcatSeparator(String concatSeparator)
Deprecated.Deprecated migrate to concatSeparator()
-
concatSuffix
public String concatSuffix()
Return a suffix used with DB varchar concatenation to combine the 2 values.
-
concatSuffix
public Pairs concatSuffix(String concatSuffix)
Add a suffix used with DB varchar concatenation to combine the 2 values.
-
setConcatSuffix
@Deprecated public Pairs setConcatSuffix(String concatSuffix)
Deprecated.Deprecated migrate to concatSuffix()
-
-