Reputation: 157
I can't understand the following code:
final Specifications<PaymentBatch> criteriaSpecification =
where(paymentBatchesInZone(getCurrentZone()))
.and(new PaymentBatchSearchFilter(paymentBatchSearchQueryDTO));
What do .and
and where
stand for?
Upvotes: 0
Views: 151
Reputation: 2117
This is a pattern called fluent interface.
For details see here: Is it bad practice to make a setter return "this"?
Every call to a function returns the current object so subsequent method calls may be made without having a separate reference declared.
Thus both methods where()
and and()
are parts of a DAO pattern and provide the means to create an SQL WHERE
statement.
Upvotes: 2