org.dbflute.bhv.readable.EntityRowHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dbflute-runtime Show documentation
Show all versions of dbflute-runtime Show documentation
The runtime library of DBFlute
/*
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.dbflute.bhv.readable;
/**
* The handler of entity row.
* @param The type of entity.
* @author jflute
*/
@FunctionalInterface
public interface EntityRowHandler {
/**
* Handle entity as row.
* @param entity The entity as row. (NotNull)
*/
void handle(ENTITY entity);
/**
* Does it break the cursor? (skip next rows?)
* You can skip next records by your overriding.
* (cannot skip the first record, this determination is after one row handling)
*
* memberBhv.selectCursor(cb -> {
* cb.query().set...
* }, new EntityRowHandler<Member>() { // not lambda for override
* private boolean breakCursor;
* public void handle(Member member) {
* ...
* if (...) { // means the final row
* breakCursor = true; // skip the next records
* }
* }
* public boolean isBreakCursor() {
* return breakCursor;
* }
* });
*
* @return The determination, true or false.
*/
default boolean isBreakCursor() {
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy