imran
imran

Reputation: 157

What do ".and" and "where" stand for?

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

Answers (1)

Marcinek
Marcinek

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

Related Questions