text:
package org.docksidestage.oracle.dbflute.bsbhv;

import java.util.List;

import org.dbflute.*;
import org.dbflute.bhv.*;
import org.dbflute.bhv.core.BehaviorCommandInvoker;
import org.dbflute.bhv.readable.*;
import org.dbflute.bhv.writable.*;
import org.dbflute.bhv.referrer.*;
import org.dbflute.cbean.*;
import org.dbflute.cbean.chelper.HpSLSFunction;
import org.dbflute.cbean.result.*;
import org.dbflute.exception.*;
import org.dbflute.hook.CommonColumnAutoSetupper;
import org.dbflute.optional.OptionalEntity;
import org.dbflute.outsidesql.executor.*;
import org.docksidestage.oracle.dbflute.exbhv.*;
import org.docksidestage.oracle.dbflute.bsbhv.loader.*;
import org.docksidestage.oracle.dbflute.exentity.*;
import org.docksidestage.oracle.dbflute.bsentity.dbmeta.*;
import org.docksidestage.oracle.dbflute.cbean.*;

/**
 * The behavior of (会員)SYNONYM_MEMBER as SYNONYM.

 *

 * [primary key]
 *     MEMBER_ID
 *
 * [column]
 *     MEMBER_ID, MEMBER_NAME, MEMBER_ACCOUNT, MEMBER_STATUS_CODE, FORMALIZED_DATETIME, BIRTHDATE, REGISTER_DATETIME, REGISTER_USER, REGISTER_PROCESS, UPDATE_DATETIME, UPDATE_USER, UPDATE_PROCESS, VERSION_NO
 *
 * [sequence]
 *
 *
 * [identity]
 *
 *
 * [version-no]
 *     VERSION_NO
 *
 * [foreign table]
 *     MEMBER_STATUS, SYNONYM_MEMBER_WITHDRAWAL(AsOne)
 *
 * [referrer table]
 *     SYNONYM_MEMBER_LOGIN, SYNONYM_MEMBER_WITHDRAWAL
 *
 * [foreign property]
 *     memberStatus, synonymMemberWithdrawalAsOne
 *
 * [referrer property]
 *     synonymMemberLoginList
 *

 * @author oracleman
 */
public abstract class BsSynonymMemberBhv extends AbstractBehaviorWritable<SynonymMember, SynonymMemberCB> {

    // ===================================================================================
    //                                                                          Definition
    //                                                                          ==========
    /*df:beginQueryPath*/
    /*df:endQueryPath*/

    // ===================================================================================
    //                                                                             DB Meta
    //                                                                             =======
    /** {@inheritDoc} */
    public SynonymMemberDbm asDBMeta() { return SynonymMemberDbm.getInstance(); }
    /** {@inheritDoc} */
    public String asTableDbName() { return "SYNONYM_MEMBER"; }

    // ===================================================================================
    //                                                                        New Instance
    //                                                                        ============
    /** {@inheritDoc} */
    public SynonymMemberCB newConditionBean() { return new SynonymMemberCB(); }

    // ===================================================================================
    //                                                                        Count Select
    //                                                                        ============
    /**
     * Select the count of uniquely-selected records by the condition-bean. {IgnorePagingCondition, IgnoreSpecifyColumn}

     * SpecifyColumn is ignored but you can use it only to remove text type column for union's distinct.
     *

     * int count = synonymMemberBhv.selectCount(cb -> {
     *     cb.query().set...
     * });
     *

     * @param cbLambda The callback for condition-bean of SynonymMember. (NotNull)
     * @return The count for the condition. (NotMinus)
     */
    public int selectCount(CBCall<SynonymMemberCB> cbLambda) {
        return facadeSelectCount(createCB(cbLambda));
    }

    /**
     * Select the count of uniquely-selected records by the condition-bean. {IgnorePagingCondition, IgnoreSpecifyColumn}

     * SpecifyColumn is ignored but you can use it only to remove text type column for union's distinct.
     *

     * SynonymMemberCB cb = new SynonymMemberCB();
     * cb.query().setFoo...(value);
     * int count = synonymMemberBhv.selectCount(cb);
     *

     * @param cb The condition-bean of SynonymMember. (NotNull)
     * @return The count for the condition. (NotMinus)
     */
    public int selectCount(SynonymMemberCB cb) {
        return facadeSelectCount(cb);
    }

    // ===================================================================================
    //                                                                       Entity Select
    //                                                                       =============
    /**
     * Select the entity by the condition-bean.

     * It returns not-null optional entity, so you should ...

     * If the data is always present as your business rule, alwaysPresent().

     * If it might be no data, isPresent() and orElse(), ...
     *

     * // if the data always exists as your business rule
     * synonymMemberBhv.selectEntity(cb -> {
     *     cb.query().set...
     * }).alwaysPresent(synonymMember -> {
     *     // called if present, or exception
     *     ... = synonymMember.get...
     * });
     *
     * // if it might be no data, ...
     * synonymMemberBhv.selectEntity(cb -> {
     *     cb.query().set...
     * }).ifPresent(synonymMember -> {
     *     // called if present
     *     ... = synonymMember.get...
     * }).orElse(() -> {
     *     // called if not present
     * });
     *

     * @param cbLambda The callback for condition-bean of SynonymMember. (NotNull)
     * @return The optional entity selected by the condition. (NotNull: if no data, empty entity)
     * @throws EntityAlreadyDeletedException When get(), required() of return value is called and the value is null, which means entity has already been deleted (not found).
     * @throws EntityDuplicatedException When the entity has been duplicated.
     * @throws SelectEntityConditionNotFoundException When the condition for selecting an entity is not found.
     */
    public OptionalEntity<SynonymMember> selectEntity(CBCall<SynonymMemberCB> cbLambda) {
        return facadeSelectEntity(createCB(cbLambda));
    }

    /**
     * Select the entity by the condition-bean.

     * It returns not-null optional entity, so you should ...

     * If the data always exists as your business rule, alwaysPresent().

     * If it might be no data, get() after check by isPresent() or orElse(), ...
     *

     * SynonymMemberCB cb = new SynonymMemberCB();
     * cb.query().set...
     *
     * // if the data always exists as your business rule
     * synonymMemberBhv.selectEntity(cb)}).alwaysPresent(synonymMember -> {
     *     // called if present, or exception
     *     ... = synonymMember.get...
     * });
     *
     * // if it might be no data, ...
     * synonymMemberBhv.selectEntity(cb).ifPresent(synonymMember -> {
     *     // called if present
     *     ... = synonymMember.get...
     * }).orElse(() -> {
     *     // called if not present
     * });
     *

     * @param cb The condition-bean of SynonymMember. (NotNull)
     * @return The optional entity selected by the condition. (NotNull: if no data, empty entity)
     * @throws EntityAlreadyDeletedException When get(), required() of return value is called and the value is null, which means entity has already been deleted (not found).
     * @throws EntityDuplicatedException When the entity has been duplicated.
     * @throws SelectEntityConditionNotFoundException When the condition for selecting an entity is not found.
     */
    public OptionalEntity<SynonymMember> selectEntity(SynonymMemberCB cb) {
        return facadeSelectEntity(cb);
    }

    protected OptionalEntity<SynonymMember> facadeSelectEntity(SynonymMemberCB cb) {
        return doSelectOptionalEntity(cb, typeOfSelectedEntity());
    }

    protected <ENTITY extends SynonymMember> OptionalEntity<ENTITY> doSelectOptionalEntity(SynonymMemberCB cb, Class<? extends ENTITY> tp) {
        return createOptionalEntity(doSelectEntity(cb, tp), cb);
    }

    protected Entity doReadEntity(ConditionBean cb) { return facadeSelectEntity(downcast(cb)).orElse(null); }

    /**
     * Select the entity by the condition-bean with deleted check.

     * If the data is always present as your business rule, this method is good.
     *

     * SynonymMember synonymMember = synonymMemberBhv.selectEntityWithDeletedCheck(cb -> cb.acceptPK(1));
     * ... = synonymMember.get...(); // the entity always be not null
     *

     * @param cbLambda The callback for condition-bean of SynonymMember. (NotNull)
     * @return The entity selected by the condition. (NotNull: if no data, throws exception)
     * @throws EntityAlreadyDeletedException When the entity has already been deleted. (not found)
     * @throws EntityDuplicatedException When the entity has been duplicated.
     * @throws SelectEntityConditionNotFoundException When the condition for selecting an entity is not found.
     */
    public SynonymMember selectEntityWithDeletedCheck(CBCall<SynonymMemberCB> cbLambda) {
        return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
    }

    /**
     * Select the entity by the condition-bean with deleted check.

     * If the data is always present as your business rule, this method is good.
     *

     * SynonymMemberCB cb = new SynonymMemberCB();
     * cb.query().set...;
     * SynonymMember synonymMember = synonymMemberBhv.selectEntityWithDeletedCheck(cb);
     * ... = synonymMember.get...(); // the entity always be not null
     *

     * @param cb The condition-bean of SynonymMember. (NotNull)
     * @return The entity selected by the condition. (NotNull: if no data, throws exception)
     * @throws EntityAlreadyDeletedException When the entity has already been deleted. (not found)
     * @throws EntityDuplicatedException When the entity has been duplicated.
     * @throws SelectEntityConditionNotFoundException When the condition for selecting an entity is not found.
     */
    public SynonymMember selectEntityWithDeletedCheck(SynonymMemberCB cb) {
        return facadeSelectEntityWithDeletedCheck(cb);
    }

    /**
     * Select the entity by the primary-key value.
     * @param memberId (会員ID): PK, NotNull, NUMBER(9). (NotNull)
     * @return The optional entity selected by the PK. (NotNull: if no data, empty entity)
     * @throws EntityAlreadyDeletedException When get(), required() of return value is called and the value is null, which means entity has already been deleted (not found).
     * @throws EntityDuplicatedException When the entity has been duplicated.
     * @throws SelectEntityConditionNotFoundException When the condition for selecting an entity is not found.
     */
    public OptionalEntity<SynonymMember> selectByPK(Integer memberId) {
        return facadeSelectByPK(memberId);
    }

    protected OptionalEntity<SynonymMember> facadeSelectByPK(Integer memberId) {
        return doSelectOptionalByPK(memberId, typeOfSelectedEntity());
    }

    protected <ENTITY extends SynonymMember> ENTITY doSelectByPK(Integer memberId, Class<? extends ENTITY> tp) {
        return doSelectEntity(xprepareCBAsPK(memberId), tp);
    }

    protected <ENTITY extends SynonymMember> OptionalEntity<ENTITY> doSelectOptionalByPK(Integer memberId, Class<? extends ENTITY> tp) {
        return createOptionalEntity(doSelectByPK(memberId, tp), memberId);
    }

    protected SynonymMemberCB xprepareCBAsPK(Integer memberId) {
        assertObjectNotNull("memberId", memberId);
        return newConditionBean().acceptPK(memberId);
    }

    /**
     * Select the entity by the unique-key value.
     * @param memberAccount (会員アカウント): UQ, NotNull, VARCHAR2(50). (NotNull)
     * @return The optional entity selected by the unique key. (NotNull: if no data, empty entity)
     * @throws EntityAlreadyDeletedException When get(), required() of return value is called and the value is null, which means entity has already been deleted (not found).
     * @throws EntityDuplicatedException When the entity has been duplicated.
     * @throws SelectEntityConditionNotFoundException When the condition for selecting an entity is not found.
     */
    public OptionalEntity<SynonymMember> selectByUniqueOf(String memberAccount) {
        return facadeSelectByUniqueOf(memberAccount);
    }

    protected OptionalEntity<SynonymMember> facadeSelectByUniqueOf(String memberAccount) {
        return doSelectByUniqueOf(memberAccount, typeOfSelectedEntity());
    }

    protected <ENTITY extends SynonymMember> OptionalEntity<ENTITY> doSelectByUniqueOf(String memberAccount, Class<? extends ENTITY> tp) {
        return createOptionalEntity(doSelectEntity(xprepareCBAsUniqueOf(memberAccount), tp), memberAccount);
    }

    protected SynonymMemberCB xprepareCBAsUniqueOf(String memberAccount) {
        assertObjectNotNull("memberAccount", memberAccount);
        return newConditionBean().acceptUniqueOf(memberAccount);
    }

    // ===================================================================================
    //                                                                         List Select
    //                                                                         ===========
    /**
     * Select the list as result bean.
     *

     * ListResultBean<SynonymMember> synonymMemberList = synonymMemberBhv.selectList(cb -> {
     *     cb.query().set...;
     *     cb.query().addOrderBy...;
     * });
     * for (SynonymMember synonymMember : synonymMemberList) {
     *     ... = synonymMember.get...;
     * }
     *

     * @param cbLambda The callback for condition-bean of SynonymMember. (NotNull)
     * @return The result bean of selected list. (NotNull: if no data, returns empty list)
     * @throws DangerousResultSizeException When the result size is over the specified safety size.
     */
    public ListResultBean<SynonymMember> selectList(CBCall<SynonymMemberCB> cbLambda) {
        return facadeSelectList(createCB(cbLambda));
    }

    /**
     * Select the list as result bean.
     *

     * SynonymMemberCB cb = new SynonymMemberCB();
     * cb.query().set...;
     * cb.query().addOrderBy...;
     * ListResultBean<SynonymMember> synonymMemberList = synonymMemberBhv.selectList(cb);
     * for (SynonymMember synonymMember : synonymMemberList) {
     *     ... = synonymMember.get...;
     * }
     *

     * @param cb The condition-bean of SynonymMember. (NotNull)
     * @return The result bean of selected list. (NotNull: if no data, returns empty list)
     * @throws DangerousResultSizeException When the result size is over the specified safety size.
     */
    public ListResultBean<SynonymMember> selectList(SynonymMemberCB cb) {
        return facadeSelectList(cb);
    }

    @Override
    protected boolean isEntityDerivedMappable() { return true; }

    // ===================================================================================
    //                                                                         Page Select
    //                                                                         ===========
    /**
     * Select the page as result bean.

     * (both count-select and paging-select are executed)
     *

     * PagingResultBean<SynonymMember> page = synonymMemberBhv.selectPage(cb -> {
     *     cb.query().set...
     *     cb.query().addOrderBy...
     *     cb.paging(20, 3); // 20 records per a page and current page number is 3
     * });
     * int allRecordCount = page.getAllRecordCount();
     * int allPageCount = page.getAllPageCount();
     * boolean isExistPrePage = page.isExistPrePage();
     * boolean isExistNextPage = page.isExistNextPage();
     * ...
     * for (SynonymMember synonymMember : page) {
     *     ... = synonymMember.get...;
     * }
     *

     * @param cbLambda The callback for condition-bean of SynonymMember. (NotNull)
     * @return The result bean of selected page. (NotNull: if no data, returns bean as empty list)
     * @throws DangerousResultSizeException When the result size is over the specified safety size.
     */
    public PagingResultBean<SynonymMember> selectPage(CBCall<SynonymMemberCB> cbLambda) {
        return facadeSelectPage(createCB(cbLambda));
    }

    /**
     * Select the page as result bean.

     * (both count-select and paging-select are executed)
     *

     * SynonymMemberCB cb = new SynonymMemberCB();
     * cb.query().setFoo...(value);
     * cb.query().addOrderBy_Bar...();
     * cb.paging(20, 3); // 20 records per a page and current page number is 3
     * PagingResultBean<SynonymMember> page = synonymMemberBhv.selectPage(cb);
     * int allRecordCount = page.getAllRecordCount();
     * int allPageCount = page.getAllPageCount();
     * boolean isExistPrePage = page.isExistPrePage();
     * boolean isExistNextPage = page.isExistNextPage();
     * ...
     * for (SynonymMember synonymMember : page) {
     *     ... = synonymMember.get...();
     * }
     *

     * @param cb The condition-bean of SynonymMember. (NotNull)
     * @return The result bean of selected page. (NotNull: if no data, returns bean as empty list)
     * @throws DangerousResultSizeException When the result size is over the specified safety size.
     */
    public PagingResultBean<SynonymMember> selectPage(SynonymMemberCB cb) {
        return facadeSelectPage(cb);
    }

    // ===================================================================================
    //                                                                       Cursor Select
    //                                                                       =============
    /**
     * Select the cursor by the condition-bean.
     *

     * synonymMemberBhv.selectCursor(cb -> {
     *     cb.query().set...
     * }, member -> {
     *     ... = member.getMemberName();
     * });
     *

     * @param cbLambda The callback for condition-bean of SynonymMember. (NotNull)
     * @param entityLambda The handler of entity row of SynonymMember. (NotNull)
     */
    public void selectCursor(CBCall<SynonymMemberCB> cbLambda, EntityRowHandler<SynonymMember> entityLambda) {
        facadeSelectCursor(createCB(cbLambda), entityLambda);
    }

    /**
     * Select the cursor by the condition-bean.
     *

     * SynonymMemberCB cb = new SynonymMemberCB();
     * cb.query().set...
     * synonymMemberBhv.selectCursor(cb, member -> {
     *     ... = member.getMemberName();
     * });
     *

     * @param cb The condition-bean of SynonymMember. (NotNull)
     * @param entityRowHandler The handler of entity row of SynonymMember. (NotNull)
     */
    public void selectCursor(SynonymMemberCB cb, EntityRowHandler<SynonymMember> entityRowHandler) {
        facadeSelectCursor(cb, entityRowHandler);
    }

    // ===================================================================================
    //                                                                       Scalar Select
    //                                                                       =============
    /**
     * Select the scalar value derived by a function from uniquely-selected records.

     * You should call a function method after this method called like as follows:
     *

     * synonymMemberBhv.selectScalar(Date.class).max(cb -> {
     *     cb.specify().column...; // required for the function
     *     cb.query().set...
     * });
     *

     * @param <RESULT> The type of result.
     * @param resultType The type of result. (NotNull)
     * @return The scalar function object to specify function for scalar value. (NotNull)
     */
    public <RESULT> HpSLSFunction<SynonymMemberCB, RESULT> selectScalar(Class<RESULT> resultType) {
        return facadeScalarSelect(resultType);
    }

    // ===================================================================================
    //                                                                            Sequence
    //                                                                            ========
    @Override
    protected Number doReadNextVal() {
        String msg = "This table is NOT related to sequence: " + asTableDbName();
        throw new UnsupportedOperationException(msg);
    }

    // ===================================================================================
    //                                                                       Load Referrer
    //                                                                       =============
    /**
     * Load referrer for the list by the referrer loader.
     *

     * List<Member> memberList = memberBhv.selectList(cb -> {
     *     cb.query().set...
     * });
     * memberBhv.load(memberList, memberLoader -> {
     *     memberLoader.loadPurchase(purchaseCB -> {
     *         purchaseCB.setupSelect...
     *         purchaseCB.query().set...
     *         purchaseCB.query().addOrderBy...
     *     }); // you can also load nested referrer from here
     *     //}).withNestedReferrer(purchaseLoader -> {
     *     //    purchaseLoader.loadPurchasePayment(...);
     *     //});
     *
     *     // you can also pull out foreign table and load its referrer
     *     // (setupSelect of the foreign table should be called)
     *     //memberLoader.pulloutMemberStatus().loadMemberLogin(...)
     * });
     * for (Member member : memberList) {
     *     List<Purchase> purchaseList = member.getPurchaseList();
     *     for (Purchase purchase : purchaseList) {
     *         ...
     *     }
     * }
     *

     * About internal policy, the value of primary key (and others too) is treated as case-insensitive.

     * The condition-bean, which the set-upper provides, has order by FK before callback.
     * @param synonymMemberList The entity list of synonymMember. (NotNull)
     * @param loaderLambda The callback to handle the referrer loader for actually loading referrer. (NotNull)
     */
    public void load(List<SynonymMember> synonymMemberList, ReferrerLoaderHandler<LoaderOfSynonymMember> loaderLambda) {
        xassLRArg(synonymMemberList, loaderLambda);
        loaderLambda.handle(new LoaderOfSynonymMember().ready(synonymMemberList, _behaviorSelector));
    }

    /**
     * Load referrer for the entity by the referrer loader.
     *

     * Member member = memberBhv.selectEntityWithDeletedCheck(cb -> cb.acceptPK(1));
     * memberBhv.load(member, memberLoader -> {
     *     memberLoader.loadPurchase(purchaseCB -> {
     *         purchaseCB.setupSelect...
     *         purchaseCB.query().set...
     *         purchaseCB.query().addOrderBy...
     *     }); // you can also load nested referrer from here
     *     //}).withNestedReferrer(purchaseLoader -> {
     *     //    purchaseLoader.loadPurchasePayment(...);
     *     //});
     *
     *     // you can also pull out foreign table and load its referrer
     *     // (setupSelect of the foreign table should be called)
     *     //memberLoader.pulloutMemberStatus().loadMemberLogin(...)
     * });
     * List<Purchase> purchaseList = member.getPurchaseList();
     * for (Purchase purchase : purchaseList) {
     *     ...
     * }
     *

     * About internal policy, the value of primary key (and others too) is treated as case-insensitive.

     * The condition-bean, which the set-upper provides, has order by FK before callback.
     * @param synonymMember The entity of synonymMember. (NotNull)
     * @param loaderLambda The callback to handle the referrer loader for actually loading referrer. (NotNull)
     */
    public void load(SynonymMember synonymMember, ReferrerLoaderHandler<LoaderOfSynonymMember> loaderLambda) {
        xassLRArg(synonymMember, loaderLambda);
        loaderLambda.handle(new LoaderOfSynonymMember().ready(xnewLRAryLs(synonymMember), _behaviorSelector));
    }

    /**
     * Load referrer of synonymMemberLoginList by the set-upper of referrer.

     * (会員ログイン)SYNONYM_MEMBER_LOGIN by MEMBER_ID, named 'synonymMemberLoginList'.
     *

     * synonymMemberBhv.loadSynonymMemberLogin(synonymMemberList, loginCB -> {
     *     loginCB.setupSelect...
     *     loginCB.query().set...
     *     loginCB.query().addOrderBy...
     * }); // you can load nested referrer from here
     * //}).withNestedReferrer(referrerList -> {
     * //    ...
     * //});
     * for (SynonymMember synonymMember : synonymMemberList) {
     *     ... = synonymMember.getSynonymMemberLoginList();
     * }
     *

     * About internal policy, the value of primary key (and others too) is treated as case-insensitive.

     * The condition-bean, which the set-upper provides, has settings before callback as follows:
     *

     * cb.query().setMemberId_InScope(pkList);
     * cb.query().addOrderBy_MemberId_Asc();
     *

     * @param synonymMemberList The entity list of synonymMember. (NotNull)
     * @param refCBLambda The callback to set up referrer condition-bean for loading referrer. (NotNull)
     * @return The callback interface which you can load nested referrer by calling withNestedReferrer(). (NotNull)
     */
    public NestedReferrerListGateway<SynonymMemberLogin> loadSynonymMemberLogin(List<SynonymMember> synonymMemberList, ConditionBeanSetupper<SynonymMemberLoginCB> refCBLambda) {
        xassLRArg(synonymMemberList, refCBLambda);
        return doLoadSynonymMemberLogin(synonymMemberList, new LoadReferrerOption<SynonymMemberLoginCB, SynonymMemberLogin>().xinit(refCBLambda));
    }

    /**
     * Load referrer of synonymMemberLoginList by the set-upper of referrer.

     * (会員ログイン)SYNONYM_MEMBER_LOGIN by MEMBER_ID, named 'synonymMemberLoginList'.
     *

     * synonymMemberBhv.loadSynonymMemberLogin(synonymMember, loginCB -> {
     *     loginCB.setupSelect...
     *     loginCB.query().set...
     *     loginCB.query().addOrderBy...
     * }); // you can load nested referrer from here
     * //}).withNestedReferrer(referrerList -> {
     * //    ...
     * //});
     * ... = synonymMember.getSynonymMemberLoginList();
     *

     * About internal policy, the value of primary key (and others too) is treated as case-insensitive.

     * The condition-bean, which the set-upper provides, has settings before callback as follows:
     *

     * cb.query().setMemberId_InScope(pkList);
     * cb.query().addOrderBy_MemberId_Asc();
     *

     * @param synonymMember The entity of synonymMember. (NotNull)
     * @param refCBLambda The callback to set up referrer condition-bean for loading referrer. (NotNull)
     * @return The callback interface which you can load nested referrer by calling withNestedReferrer(). (NotNull)
     */
    public NestedReferrerListGateway<SynonymMemberLogin> loadSynonymMemberLogin(SynonymMember synonymMember, ConditionBeanSetupper<SynonymMemberLoginCB> refCBLambda) {
        xassLRArg(synonymMember, refCBLambda);
        return doLoadSynonymMemberLogin(xnewLRLs(synonymMember), new LoadReferrerOption<SynonymMemberLoginCB, SynonymMemberLogin>().xinit(refCBLambda));
    }

    /**
     * {Refer to overload method that has an argument of the list of entity.} #beforejava8
     * @param synonymMember The entity of synonymMember. (NotNull)
     * @param loadReferrerOption The option of load-referrer. (NotNull)
     * @return The callback interface which you can load nested referrer by calling withNestedReferrer(). (NotNull)
     */
    public NestedReferrerListGateway<SynonymMemberLogin> loadSynonymMemberLogin(SynonymMember synonymMember, LoadReferrerOption<SynonymMemberLoginCB, SynonymMemberLogin> loadReferrerOption) {
        xassLRArg(synonymMember, loadReferrerOption);
        return loadSynonymMemberLogin(xnewLRLs(synonymMember), loadReferrerOption);
    }

    /**
     * {Refer to overload method that has an argument of condition-bean set-upper} #beforejava8
     * @param synonymMemberList The entity list of synonymMember. (NotNull)
     * @param loadReferrerOption The option of load-referrer. (NotNull)
     * @return The callback interface which you can load nested referrer by calling withNestedReferrer(). (NotNull)
     */
    @SuppressWarnings("unchecked")
    public NestedReferrerListGateway<SynonymMemberLogin> loadSynonymMemberLogin(List<SynonymMember> synonymMemberList, LoadReferrerOption<SynonymMemberLoginCB, SynonymMemberLogin> loadReferrerOption) {
        xassLRArg(synonymMemberList, loadReferrerOption);
        if (synonymMemberList.isEmpty()) { return (NestedReferrerListGateway<SynonymMemberLogin>)EMPTY_NREF_LGWAY; }
        return doLoadSynonymMemberLogin(synonymMemberList, loadReferrerOption);
    }

    protected NestedReferrerListGateway<SynonymMemberLogin> doLoadSynonymMemberLogin(List<SynonymMember> synonymMemberList, LoadReferrerOption<SynonymMemberLoginCB, SynonymMemberLogin> option) {
        return helpLoadReferrerInternally(synonymMemberList, option, "synonymMemberLoginList");
    }

    // ===================================================================================
    //                                                                   Pull out Relation
    //                                                                   =================
    /**
     * Pull out the list of foreign table 'MemberStatus'.
     * @param synonymMemberList The list of synonymMember. (NotNull, EmptyAllowed)
     * @return The list of foreign table. (NotNull, EmptyAllowed, NotNullElement)
     */
    public List<MemberStatus> pulloutMemberStatus(List<SynonymMember> synonymMemberList)
    { return helpPulloutInternally(synonymMemberList, "memberStatus"); }

    /**
     * Pull out the list of referrer-as-one table 'SynonymMemberWithdrawal'.
     * @param synonymMemberList The list of synonymMember. (NotNull, EmptyAllowed)
     * @return The list of referrer-as-one table. (NotNull, EmptyAllowed, NotNullElement)
     */
    public List<SynonymMemberWithdrawal> pulloutSynonymMemberWithdrawalAsOne(List<SynonymMember> synonymMemberList)
    { return helpPulloutInternally(synonymMemberList, "synonymMemberWithdrawalAsOne"); }

    // ===================================================================================
    //                                                                      Extract Column
    //                                                                      ==============
    /**
     * Extract the value list of (single) primary key memberId.
     * @param synonymMemberList The list of synonymMember. (NotNull, EmptyAllowed)
     * @return The list of the column value. (NotNull, EmptyAllowed, NotNullElement)
     */
    public List<Integer> extractMemberIdList(List<SynonymMember> synonymMemberList)
    { return helpExtractListInternally(synonymMemberList, "memberId"); }

    /**
     * Extract the value list of (single) unique key memberAccount.
     * @param synonymMemberList The list of synonymMember. (NotNull, EmptyAllowed)
     * @return The list of the column value. (NotNull, EmptyAllowed, NotNullElement)
     */
    public List<String> extractMemberAccountList(List<SynonymMember> synonymMemberList)
    { return helpExtractListInternally(synonymMemberList, "memberAccount"); }

    // ===================================================================================
    //                                                                       Entity Update
    //                                                                       =============
    /**
     * Insert the entity modified-only. (DefaultConstraintsEnabled)
     *

     * SynonymMember synonymMember = new SynonymMember();
     * // if auto-increment, you don't need to set the PK value
     * synonymMember.setFoo...(value);
     * synonymMember.setBar...(value);
     * // you don't need to set values of common columns
     * //synonymMember.setRegisterUser(value);
     * //synonymMember.set...;
     * synonymMemberBhv.insert(synonymMember);
     * ... = synonymMember.getPK...(); // if auto-increment, you can get the value after
     *

     *
While, when the entity is created by select, all columns are registered.

     * @param synonymMember The entity of insert. (NotNull, PrimaryKeyNullAllowed: when auto-increment)
     * @throws EntityAlreadyExistsException When the entity already exists. (unique constraint violation)
     */
    public void insert(SynonymMember synonymMember) {
        doInsert(synonymMember, null);
    }

    /**
     * Update the entity modified-only. (ZeroUpdateException, ExclusiveControl)

     * By PK as default, and also you can update by unique keys using entity's uniqueOf().
     *

     * SynonymMember synonymMember = new SynonymMember();
     * synonymMember.setPK...(value); // required
     * synonymMember.setFoo...(value); // you should set only modified columns
     * // you don't need to set values of common columns
     * //synonymMember.setRegisterUser(value);
     * //synonymMember.set...;
     * // if exclusive control, the value of concurrency column is required
     * synonymMember.setVersionNo(value);
     * synonymMemberBhv.update(synonymMember);
     *

     * @param synonymMember The entity of update. (NotNull, PrimaryKeyNotNull, ConcurrencyColumnNotNull)
     * @throws EntityAlreadyUpdatedException When the entity has already been updated.
     * @throws EntityDuplicatedException When the entity has been duplicated.
     * @throws EntityAlreadyExistsException When the entity already exists. (unique constraint violation)
     */
    public void update(SynonymMember synonymMember) {
        doUpdate(synonymMember, null);
    }

    /**
     * Update the entity non-strictly modified-only. (ZeroUpdateException, NonExclusiveControl)

     * By PK as default, and also you can update by unique keys using entity's uniqueOf().
     *

     * SynonymMember synonymMember = new SynonymMember();
     * synonymMember.setPK...(value); // required
     * synonymMember.setFoo...(value); // you should set only modified columns
     * // you don't need to set values of common columns
     * //synonymMember.setRegisterUser(value);
     * //synonymMember.set...;
     * // you don't need to set a value of concurrency column
     * // (auto-increment for version number is valid though non-exclusive control)
     * //synonymMember.setVersionNo(value);
     * synonymMemberBhv.updateNonstrict(synonymMember);
     *

     * @param synonymMember The entity of update. (NotNull, PrimaryKeyNotNull)
     * @throws EntityAlreadyDeletedException When the entity has already been deleted. (not found)
     * @throws EntityDuplicatedException When the entity has been duplicated.
     * @throws EntityAlreadyExistsException When the entity already exists. (unique constraint violation)
     */
    public void updateNonstrict(SynonymMember synonymMember) {
        doUpdateNonstrict(synonymMember, null);
    }

    /**
     * Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl)

     * if (the entity has no PK) { insert() } else { update(), but no data, insert() }

     *
Also you can update by unique keys using entity's uniqueOf().

     * @param synonymMember The entity of insert or update. (NotNull, ...depends on insert or update)
     * @throws EntityAlreadyUpdatedException When the entity has already been updated.
     * @throws EntityDuplicatedException When the entity has been duplicated.
     * @throws EntityAlreadyExistsException When the entity already exists. (unique constraint violation)
     */
    public void insertOrUpdate(SynonymMember synonymMember) {
        doInsertOrUpdate(synonymMember, null, null);
    }

    /**
     * Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)

     * if (the entity has no PK) { insert() } else { update(), but no data, insert() }
     *
Also you can update by unique keys using entity's uniqueOf().

     * @param synonymMember The entity of insert or update. (NotNull, ...depends on insert or update)
     * @throws EntityAlreadyDeletedException When the entity has already been deleted. (not found)
     * @throws EntityDuplicatedException When the entity has been duplicated.
     * @throws EntityAlreadyExistsException When the entity already exists. (unique constraint violation)
     */
    public void insertOrUpdateNonstrict(SynonymMember synonymMember) {
        doInsertOrUpdateNonstrict(synonymMember, null, null);
    }

    /**
     * Delete the entity. (ZeroUpdateException, ExclusiveControl)

     * By PK as default, and also you can delete by unique keys using entity's uniqueOf().
     *

     * SynonymMember synonymMember = new SynonymMember();
     * synonymMember.setPK...(value); // required
     * // if exclusive control, the value of concurrency column is required
     * synonymMember.setVersionNo(value);
     * try {
     *     synonymMemberBhv.delete(synonymMember);
     * } catch (EntityAlreadyUpdatedException e) { // if concurrent update
     *     ...
     * }
     *

     * @param synonymMember The entity of delete. (NotNull, PrimaryKeyNotNull, ConcurrencyColumnNotNull)
     * @throws EntityAlreadyUpdatedException When the entity has already been updated.
     * @throws EntityDuplicatedException When the entity has been duplicated.
     */
    public void delete(SynonymMember synonymMember) {
        doDelete(synonymMember, null);
    }

    /**
     * Delete the entity non-strictly. {ZeroUpdateException, NonExclusiveControl}

     * By PK as default, and also you can delete by unique keys using entity's uniqueOf().
     *

     * SynonymMember synonymMember = new SynonymMember();
     * synonymMember.setPK...(value); // required
     * // you don't need to set a value of concurrency column
     * // (auto-increment for version number is valid though non-exclusive control)
     * //synonymMember.setVersionNo(value);
     * synonymMemberBhv.deleteNonstrict(synonymMember);
     *

     * @param synonymMember The entity of delete. (NotNull, PrimaryKeyNotNull)
     * @throws EntityAlreadyDeletedException When the entity has already been deleted. (not found)
     * @throws EntityDuplicatedException When the entity has been duplicated.
     */
    public void deleteNonstrict(SynonymMember synonymMember) {
        doDeleteNonstrict(synonymMember, null);
    }

    // ===================================================================================
    //                                                                        Batch Update
    //                                                                        ============
    /**
     * Batch-insert the entity list modified-only of same-set columns. (DefaultConstraintsEnabled)

     * This method uses executeBatch() of java.sql.PreparedStatement.

     *
The columns of least common multiple are registered like this:

     *

     * for (... : ...) {
     *     SynonymMember synonymMember = new SynonymMember();
     *     synonymMember.setFooName("foo");
     *     if (...) {
     *         synonymMember.setFooPrice(123);
     *     }
     *     // FOO_NAME and FOO_PRICE (and record meta columns) are registered
     *     // FOO_PRICE not-called in any entities are registered as null without default value
     *     // columns not-called in all entities are registered as null or default value
     *     synonymMemberList.add(synonymMember);
     * }
     * synonymMemberBhv.batchInsert(synonymMemberList);
     *

     *
While, when the entities are created by select, all columns are registered.

     *
And if the table has an identity, entities after the process don't have incremented values.
     * (When you use the (normal) insert(), you can get the incremented value from your entity)

     * @param synonymMemberList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
     * @return The array of inserted count. (NotNull, EmptyAllowed)
     */
    public int[] batchInsert(List<SynonymMember> synonymMemberList) {
        return doBatchInsert(synonymMemberList, null);
    }

    /**
     * Batch-update the entity list modified-only of same-set columns. (ExclusiveControl)

     * This method uses executeBatch() of java.sql.PreparedStatement.

     * You should specify same-set columns to all entities like this:
     *

     * for (... : ...) {
     *     SynonymMember synonymMember = new SynonymMember();
     *     synonymMember.setFooName("foo");
     *     if (...) {
     *         synonymMember.setFooPrice(123);
     *     } else {
     *         synonymMember.setFooPrice(null); // updated as null
     *         //synonymMember.setFooDate(...); // *not allowed, fragmented
     *     }
     *     // FOO_NAME and FOO_PRICE (and record meta columns) are updated
     *     // (others are not updated: their values are kept)
     *     synonymMemberList.add(synonymMember);
     * }
     * synonymMemberBhv.batchUpdate(synonymMemberList);
     *

     * @param synonymMemberList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull, ConcurrencyColumnNotNull)
     * @return The array of updated count. (NotNull, EmptyAllowed)
     * @throws BatchEntityAlreadyUpdatedException When the entity has already been updated. This exception extends EntityAlreadyUpdatedException.
     */
    public int[] batchUpdate(List<SynonymMember> synonymMemberList) {
        return doBatchUpdate(synonymMemberList, null);
    }

    /**
     * Batch-update the entity list non-strictly modified-only of same-set columns. (NonExclusiveControl)

     * This method uses executeBatch() of java.sql.PreparedStatement.

     * You should specify same-set columns to all entities like this:
     *

     * for (... : ...) {
     *     SynonymMember synonymMember = new SynonymMember();
     *     synonymMember.setFooName("foo");
     *     if (...) {
     *         synonymMember.setFooPrice(123);
     *     } else {
     *         synonymMember.setFooPrice(null); // updated as null
     *         //synonymMember.setFooDate(...); // *not allowed, fragmented
     *     }
     *     // FOO_NAME and FOO_PRICE (and record meta columns) are updated
     *     // (others are not updated: their values are kept)
     *     synonymMemberList.add(synonymMember);
     * }
     * synonymMemberBhv.batchUpdate(synonymMemberList);
     *

     * @param synonymMemberList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
     * @return The array of updated count. (NotNull, EmptyAllowed)
     * @throws EntityAlreadyDeletedException When the entity has already been deleted. (not found)
     */
    public int[] batchUpdateNonstrict(List<SynonymMember> synonymMemberList) {
        return doBatchUpdateNonstrict(synonymMemberList, null);
    }

    /**
     * Batch-delete the entity list. (ExclusiveControl)

     * This method uses executeBatch() of java.sql.PreparedStatement.
     * @param synonymMemberList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
     * @return The array of deleted count. (NotNull, EmptyAllowed)
     * @throws BatchEntityAlreadyUpdatedException When the entity has already been updated. This exception extends EntityAlreadyUpdatedException.
     */
    public int[] batchDelete(List<SynonymMember> synonymMemberList) {
        return doBatchDelete(synonymMemberList, null);
    }

    /**
     * Batch-delete the entity list non-strictly. {NonExclusiveControl}

     * This method uses executeBatch() of java.sql.PreparedStatement.
     * @param synonymMemberList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
     * @return The array of deleted count. (NotNull, EmptyAllowed)
     * @throws EntityAlreadyDeletedException When the entity has already been deleted. (not found)
     */
    public int[] batchDeleteNonstrict(List<SynonymMember> synonymMemberList) {
        return doBatchDeleteNonstrict(synonymMemberList, null);
    }

    // ===================================================================================
    //                                                                        Query Update
    //                                                                        ============
    /**
     * Insert the several entities by query (modified-only for fixed value).
     *

     * synonymMemberBhv.queryInsert(new QueryInsertSetupper<SynonymMember, SynonymMemberCB>() {
     *     public ConditionBean setup(SynonymMember entity, SynonymMemberCB intoCB) {
     *         FooCB cb = FooCB();
     *         cb.setupSelect_Bar();
     *
     *         // mapping
     *         intoCB.specify().columnMyName().mappedFrom(cb.specify().columnFooName());
     *         intoCB.specify().columnMyCount().mappedFrom(cb.specify().columnFooCount());
     *         intoCB.specify().columnMyDate().mappedFrom(cb.specify().specifyBar().columnBarDate());
     *         entity.setMyFixedValue("foo"); // fixed value
     *         // you don't need to set values of common columns
     *         //entity.setRegisterUser(value);
     *         //entity.set...;
     *         // you don't need to set a value of concurrency column
     *         //entity.setVersionNo(value);
     *
     *         return cb;
     *     }
     * });
     *

     * @param manyArgLambda The callback to set up query-insert. (NotNull)
     * @return The inserted count.
     */
    public int queryInsert(QueryInsertSetupper<SynonymMember, SynonymMemberCB> manyArgLambda) {
        return doQueryInsert(manyArgLambda, null);
    }

    /**
     * Update the several entities by query non-strictly modified-only. (NonExclusiveControl)
     *

     * SynonymMember synonymMember = new SynonymMember();
     * // you don't need to set PK value
     * //synonymMember.setPK...(value);
     * synonymMember.setFoo...(value); // you should set only modified columns
     * // you don't need to set values of common columns
     * //synonymMember.setRegisterUser(value);
     * //synonymMember.set...;
     * // you don't need to set a value of concurrency column
     * // (auto-increment for version number is valid though non-exclusive control)
     * //synonymMember.setVersionNo(value);
     * synonymMemberBhv.queryUpdate(synonymMember, cb -> {
     *     cb.query().setFoo...
     * });
     *

     * @param synonymMember The entity that contains update values. (NotNull, PrimaryKeyNullAllowed)
     * @param cbLambda The callback for condition-bean of SynonymMember. (NotNull)
     * @return The updated count.
     * @throws NonQueryUpdateNotAllowedException When the query has no condition.
     */
    public int queryUpdate(SynonymMember synonymMember, CBCall<SynonymMemberCB> cbLambda) {
        return doQueryUpdate(synonymMember, createCB(cbLambda), null);
    }

    /**
     * Update the several entities by query non-strictly modified-only. (NonExclusiveControl)
     *

     * SynonymMember synonymMember = new SynonymMember();
     * // you don't need to set PK value
     * //synonymMember.setPK...(value);
     * synonymMember.setFoo...(value); // you should set only modified columns
     * // you don't need to set values of common columns
     * //synonymMember.setRegisterUser(value);
     * //synonymMember.set...;
     * // you don't need to set a value of concurrency column
     * // (auto-increment for version number is valid though non-exclusive control)
     * //synonymMember.setVersionNo(value);
     * SynonymMemberCB cb = new SynonymMemberCB();
     * cb.query().setFoo...(value);
     * synonymMemberBhv.queryUpdate(synonymMember, cb);
     *

     * @param synonymMember The entity that contains update values. (NotNull, PrimaryKeyNullAllowed)
     * @param cb The condition-bean of SynonymMember. (NotNull)
     * @return The updated count.
     * @throws NonQueryUpdateNotAllowedException When the query has no condition.
     */
    public int queryUpdate(SynonymMember synonymMember, SynonymMemberCB cb) {
        return doQueryUpdate(synonymMember, cb, null);
    }

    /**
     * Delete the several entities by query. (NonExclusiveControl)
     *

     * synonymMemberBhv.queryDelete(synonymMember, cb -> {
     *     cb.query().setFoo...
     * });
     *

     * @param cbLambda The callback for condition-bean of SynonymMember. (NotNull)
     * @return The deleted count.
     * @throws NonQueryDeleteNotAllowedException When the query has no condition.
     */
    public int queryDelete(CBCall<SynonymMemberCB> cbLambda) {
        return doQueryDelete(createCB(cbLambda), null);
    }

    /**
     * Delete the several entities by query. (NonExclusiveControl)
     *

     * SynonymMemberCB cb = new SynonymMemberCB();
     * cb.query().setFoo...(value);
     * synonymMemberBhv.queryDelete(synonymMember, cb);
     *

     * @param cb The condition-bean of SynonymMember. (NotNull)
     * @return The deleted count.
     * @throws NonQueryDeleteNotAllowedException When the query has no condition.
     */
    public int queryDelete(SynonymMemberCB cb) {
        return doQueryDelete(cb, null);
    }

    // ===================================================================================
    //                                                                      Varying Update
    //                                                                      ==============
    // -----------------------------------------------------
    //                                         Entity Update
    //                                         -------------
    /**
     * Insert the entity with varying requests.

     * For example, disableCommonColumnAutoSetup(), disablePrimaryKeyIdentity().

     * Other specifications are same as insert(entity).
     *

     * SynonymMember synonymMember = new SynonymMember();
     * // if auto-increment, you don't need to set the PK value
     * synonymMember.setFoo...(value);
     * synonymMember.setBar...(value);
     * synonymMemberBhv.varyingInsert(synonymMember, op -> {
     *     // you can insert by your values for common columns
     *     op.disableCommonColumnAutoSetup();
     * });
     * ... = synonymMember.getPK...(); // if auto-increment, you can get the value after
     *

     * @param synonymMember The entity of insert. (NotNull, PrimaryKeyNullAllowed: when auto-increment)
     * @param opLambda The callback for option of insert for varying requests. (NotNull)
     * @throws EntityAlreadyExistsException When the entity already exists. (unique constraint violation)
     */
    public void varyingInsert(SynonymMember synonymMember, WritableOptionCall<SynonymMemberCB, InsertOption<SynonymMemberCB>> opLambda) {
        doInsert(synonymMember, createInsertOption(opLambda));
    }

    /**
     * Update the entity with varying requests modified-only. (ZeroUpdateException, ExclusiveControl)

     * For example, self(selfCalculationSpecification), specify(updateColumnSpecification), disableCommonColumnAutoSetup().

     * Other specifications are same as update(entity).
     *

     * SynonymMember synonymMember = new SynonymMember();
     * synonymMember.setPK...(value); // required
     * synonymMember.setOther...(value); // you should set only modified columns
     * // if exclusive control, the value of concurrency column is required
     * synonymMember.setVersionNo(value);
     * // you can update by self calculation values
     * synonymMemberBhv.varyingUpdate(synonymMember, op -> {
     *     op.self(cb -> {
     *         cb.specify().columnXxxCount();
     *     }).plus(1); // XXX_COUNT = XXX_COUNT + 1
     * });
     *

     * @param synonymMember The entity of update. (NotNull, PrimaryKeyNotNull, ConcurrencyColumnNotNull)
     * @param opLambda The callback for option of update for varying requests. (NotNull)
     * @throws EntityAlreadyUpdatedException When the entity has already been updated.
     * @throws EntityDuplicatedException When the entity has been duplicated.
     * @throws EntityAlreadyExistsException When the entity already exists. (unique constraint violation)
     */
    public void varyingUpdate(SynonymMember synonymMember, WritableOptionCall<SynonymMemberCB, UpdateOption<SynonymMemberCB>> opLambda) {
        doUpdate(synonymMember, createUpdateOption(opLambda));
    }

    /**
     * Update the entity with varying requests non-strictly modified-only. (ZeroUpdateException, NonExclusiveControl)

     * For example, self(selfCalculationSpecification), specify(updateColumnSpecification), disableCommonColumnAutoSetup().

     * Other specifications are same as updateNonstrict(entity).
     *

     * // ex) you can update by self calculation values
     * SynonymMember synonymMember = new SynonymMember();
     * synonymMember.setPK...(value); // required
     * synonymMember.setOther...(value); // you should set only modified columns
     * // you don't need to set a value of concurrency column
     * // (auto-increment for version number is valid though non-exclusive control)
     * //synonymMember.setVersionNo(value);
     * synonymMemberBhv.varyingUpdateNonstrict(synonymMember, op -> {
     *     op.self(cb -> {
     *         cb.specify().columnXxxCount();
     *     }).plus(1); // XXX_COUNT = XXX_COUNT + 1
     * });
     *

     * @param synonymMember The entity of update. (NotNull, PrimaryKeyNotNull)
     * @param opLambda The callback for option of update for varying requests. (NotNull)
     * @throws EntityAlreadyDeletedException When the entity has already been deleted. (not found)
     * @throws EntityDuplicatedException When the entity has been duplicated.
     * @throws EntityAlreadyExistsException When the entity already exists. (unique constraint violation)
     */
    public void varyingUpdateNonstrict(SynonymMember synonymMember, WritableOptionCall<SynonymMemberCB, UpdateOption<SynonymMemberCB>> opLambda) {
        doUpdateNonstrict(synonymMember, createUpdateOption(opLambda));
    }

    /**
     * Insert or update the entity with varying requests. (ExclusiveControl: when update)

     * Other specifications are same as insertOrUpdate(entity).
     * @param synonymMember The entity of insert or update. (NotNull)
     * @param insertOpLambda The callback for option of insert for varying requests. (NotNull)
     * @param updateOpLambda The callback for option of update for varying requests. (NotNull)
     * @throws EntityAlreadyUpdatedException When the entity has already been updated.
     * @throws EntityDuplicatedException When the entity has been duplicated.
     * @throws EntityAlreadyExistsException When the entity already exists. (unique constraint violation)
     */
    public void varyingInsertOrUpdate(SynonymMember synonymMember, WritableOptionCall<SynonymMemberCB, InsertOption<SynonymMemberCB>> insertOpLambda, WritableOptionCall<SynonymMemberCB, UpdateOption<SynonymMemberCB>> updateOpLambda) {
        doInsertOrUpdate(synonymMember, createInsertOption(insertOpLambda), createUpdateOption(updateOpLambda));
    }

    /**
     * Insert or update the entity with varying requests non-strictly. (NonExclusiveControl: when update)

     * Other specifications are same as insertOrUpdateNonstrict(entity).
     * @param synonymMember The entity of insert or update. (NotNull)
     * @param insertOpLambda The callback for option of insert for varying requests. (NotNull)
     * @param updateOpLambda The callback for option of update for varying requests. (NotNull)
     * @throws EntityAlreadyDeletedException When the entity has already been deleted. (not found)
     * @throws EntityDuplicatedException When the entity has been duplicated.
     * @throws EntityAlreadyExistsException When the entity already exists. (unique constraint violation)
     */
    public void varyingInsertOrUpdateNonstrict(SynonymMember synonymMember, WritableOptionCall<SynonymMemberCB, InsertOption<SynonymMemberCB>> insertOpLambda, WritableOptionCall<SynonymMemberCB, UpdateOption<SynonymMemberCB>> updateOpLambda) {
        doInsertOrUpdateNonstrict(synonymMember, createInsertOption(insertOpLambda), createUpdateOption(updateOpLambda));
    }

    /**
     * Delete the entity with varying requests. (ZeroUpdateException, ExclusiveControl)

     * Now a valid option does not exist.

     * Other specifications are same as delete(entity).
     * @param synonymMember The entity of delete. (NotNull, PrimaryKeyNotNull, ConcurrencyColumnNotNull)
     * @param opLambda The callback for option of delete for varying requests. (NotNull)
     * @throws EntityAlreadyUpdatedException When the entity has already been updated.
     * @throws EntityDuplicatedException When the entity has been duplicated.
     */
    public void varyingDelete(SynonymMember synonymMember, WritableOptionCall<SynonymMemberCB, DeleteOption<SynonymMemberCB>> opLambda) {
        doDelete(synonymMember, createDeleteOption(opLambda));
    }

    /**
     * Delete the entity with varying requests non-strictly. (ZeroUpdateException, NonExclusiveControl)

     * Now a valid option does not exist.

     * Other specifications are same as deleteNonstrict(entity).
     * @param synonymMember The entity of delete. (NotNull, PrimaryKeyNotNull, ConcurrencyColumnNotNull)
     * @param opLambda The callback for option of delete for varying requests. (NotNull)
     * @throws EntityAlreadyDeletedException When the entity has already been deleted. (not found)
     * @throws EntityDuplicatedException When the entity has been duplicated.
     */
    public void varyingDeleteNonstrict(SynonymMember synonymMember, WritableOptionCall<SynonymMemberCB, DeleteOption<SynonymMemberCB>> opLambda) {
        doDeleteNonstrict(synonymMember, createDeleteOption(opLambda));
    }

    // -----------------------------------------------------
    //                                          Batch Update
    //                                          ------------
    /**
     * Batch-insert the list with varying requests.

     * For example, disableCommonColumnAutoSetup()
     * , disablePrimaryKeyIdentity(), limitBatchInsertLogging().

     * Other specifications are same as batchInsert(entityList).
     * @param synonymMemberList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
     * @param opLambda The callback for option of insert for varying requests. (NotNull)
     * @return The array of updated count. (NotNull, EmptyAllowed)
     */
    public int[] varyingBatchInsert(List<SynonymMember> synonymMemberList, WritableOptionCall<SynonymMemberCB, InsertOption<SynonymMemberCB>> opLambda) {
        return doBatchInsert(synonymMemberList, createInsertOption(opLambda));
    }

    /**
     * Batch-update the list with varying requests.

     * For example, self(selfCalculationSpecification), specify(updateColumnSpecification)
     * , disableCommonColumnAutoSetup(), limitBatchUpdateLogging().

     * Other specifications are same as batchUpdate(entityList).
     * @param synonymMemberList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
     * @param opLambda The callback for option of update for varying requests. (NotNull)
     * @return The array of updated count. (NotNull, EmptyAllowed)
     */
    public int[] varyingBatchUpdate(List<SynonymMember> synonymMemberList, WritableOptionCall<SynonymMemberCB, UpdateOption<SynonymMemberCB>> opLambda) {
        return doBatchUpdate(synonymMemberList, createUpdateOption(opLambda));
    }

    /**
     * Batch-update the list with varying requests non-strictly.

     * For example, self(selfCalculationSpecification), specify(updateColumnSpecification)
     * , disableCommonColumnAutoSetup(), limitBatchUpdateLogging().

     * Other specifications are same as batchUpdateNonstrict(entityList).
     * @param synonymMemberList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
     * @param opLambda The callback for option of update for varying requests. (NotNull)
     * @return The array of updated count. (NotNull, EmptyAllowed)
     */
    public int[] varyingBatchUpdateNonstrict(List<SynonymMember> synonymMemberList, WritableOptionCall<SynonymMemberCB, UpdateOption<SynonymMemberCB>> opLambda) {
        return doBatchUpdateNonstrict(synonymMemberList, createUpdateOption(opLambda));
    }

    /**
     * Batch-delete the list with varying requests.

     * For example, limitBatchDeleteLogging().

     * Other specifications are same as batchDelete(entityList).
     * @param synonymMemberList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
     * @param opLambda The callback for option of delete for varying requests. (NotNull)
     * @return The array of deleted count. (NotNull, EmptyAllowed)
     */
    public int[] varyingBatchDelete(List<SynonymMember> synonymMemberList, WritableOptionCall<SynonymMemberCB, DeleteOption<SynonymMemberCB>> opLambda) {
        return doBatchDelete(synonymMemberList, createDeleteOption(opLambda));
    }

    /**
     * Batch-delete the list with varying requests non-strictly.

     * For example, limitBatchDeleteLogging().

     * Other specifications are same as batchDeleteNonstrict(entityList).
     * @param synonymMemberList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
     * @param opLambda The callback for option of delete for varying requests. (NotNull)
     * @return The array of deleted count. (NotNull, EmptyAllowed)
     */
    public int[] varyingBatchDeleteNonstrict(List<SynonymMember> synonymMemberList, WritableOptionCall<SynonymMemberCB, DeleteOption<SynonymMemberCB>> opLambda) {
        return doBatchDeleteNonstrict(synonymMemberList, createDeleteOption(opLambda));
    }

    // -----------------------------------------------------
    //                                          Query Update
    //                                          ------------
    /**
     * Insert the several entities by query with varying requests (modified-only for fixed value).

     * For example, disableCommonColumnAutoSetup(), disablePrimaryKeyIdentity().

     * Other specifications are same as queryInsert(entity, setupper).
     * @param manyArgLambda The set-upper of query-insert. (NotNull)
     * @param opLambda The callback for option of insert for varying requests. (NotNull)
     * @return The inserted count.
     */
    public int varyingQueryInsert(QueryInsertSetupper<SynonymMember, SynonymMemberCB> manyArgLambda, WritableOptionCall<SynonymMemberCB, InsertOption<SynonymMemberCB>> opLambda) {
        return doQueryInsert(manyArgLambda, createInsertOption(opLambda));
    }

    /**
     * Update the several entities by query with varying requests non-strictly modified-only. {NonExclusiveControl}

     * For example, self(selfCalculationSpecification), specify(updateColumnSpecification)
     * , disableCommonColumnAutoSetup(), allowNonQueryUpdate().

     * Other specifications are same as queryUpdate(entity, cb).
     *

     * // ex) you can update by self calculation values
     * SynonymMember synonymMember = new SynonymMember();
     * // you don't need to set PK value
     * //synonymMember.setPK...(value);
     * synonymMember.setOther...(value); // you should set only modified columns
     * // you don't need to set a value of concurrency column
     * // (auto-increment for version number is valid though non-exclusive control)
     * //synonymMember.setVersionNo(value);
     * synonymMemberBhv.varyingQueryUpdate(synonymMember, cb -> {
     *     cb.query().setFoo...
     * }, op -> {
     *     op.self(colCB -> {
     *         colCB.specify().columnFooCount();
     *     }).plus(1); // FOO_COUNT = FOO_COUNT + 1
     * });
     *

     * @param synonymMember The entity that contains update values. (NotNull) {PrimaryKeyNotRequired}
     * @param cbLambda The callback for condition-bean of SynonymMember. (NotNull)
     * @param opLambda The callback for option of update for varying requests. (NotNull)
     * @return The updated count.
     * @throws NonQueryUpdateNotAllowedException When the query has no condition (if not allowed).
     */
    public int varyingQueryUpdate(SynonymMember synonymMember, CBCall<SynonymMemberCB> cbLambda, WritableOptionCall<SynonymMemberCB, UpdateOption<SynonymMemberCB>> opLambda) {
        return doQueryUpdate(synonymMember, createCB(cbLambda), createUpdateOption(opLambda));
    }

    /**
     * Update the several entities by query with varying requests non-strictly modified-only. {NonExclusiveControl}

     * For example, self(selfCalculationSpecification), specify(updateColumnSpecification)
     * , disableCommonColumnAutoSetup(), allowNonQueryUpdate().

     * Other specifications are same as queryUpdate(entity, cb).
     *

     * // ex) you can update by self calculation values
     * SynonymMember synonymMember = new SynonymMember();
     * // you don't need to set PK value
     * //synonymMember.setPK...(value);
     * synonymMember.setOther...(value); // you should set only modified columns
     * // you don't need to set a value of concurrency column
     * // (auto-increment for version number is valid though non-exclusive control)
     * //synonymMember.setVersionNo(value);
     * SynonymMemberCB cb = new SynonymMemberCB();
     * cb.query().setFoo...(value);
     * synonymMemberBhv.varyingQueryUpdate(synonymMember, cb, op -> {
     *     op.self(colCB -> {
     *         colCB.specify().columnFooCount();
     *     }).plus(1); // FOO_COUNT = FOO_COUNT + 1
     * });
     *

     * @param synonymMember The entity that contains update values. (NotNull) {PrimaryKeyNotRequired}
     * @param cb The condition-bean of SynonymMember. (NotNull)
     * @param opLambda The callback for option of update for varying requests. (NotNull)
     * @return The updated count.
     * @throws NonQueryUpdateNotAllowedException When the query has no condition (if not allowed).
     */
    public int varyingQueryUpdate(SynonymMember synonymMember, SynonymMemberCB cb, WritableOptionCall<SynonymMemberCB, UpdateOption<SynonymMemberCB>> opLambda) {
        return doQueryUpdate(synonymMember, cb, createUpdateOption(opLambda));
    }

    /**
     * Delete the several entities by query with varying requests non-strictly.

     * For example, allowNonQueryDelete().

     * Other specifications are same as queryDelete(cb).
     *

     * synonymMemberBhv.queryDelete(synonymMember, cb -> {
     *     cb.query().setFoo...
     * }, op -> {
     *     op...
     * });
     *

     * @param cbLambda The callback for condition-bean of SynonymMember. (NotNull)
     * @param opLambda The callback for option of delete for varying requests. (NotNull)
     * @return The deleted count.
     * @throws NonQueryDeleteNotAllowedException When the query has no condition (if not allowed).
     */
    public int varyingQueryDelete(CBCall<SynonymMemberCB> cbLambda, WritableOptionCall<SynonymMemberCB, DeleteOption<SynonymMemberCB>> opLambda) {
        return doQueryDelete(createCB(cbLambda), createDeleteOption(opLambda));
    }

    /**
     * Delete the several entities by query with varying requests non-strictly.

     * For example, allowNonQueryDelete().

     * Other specifications are same as queryDelete(cb).
     * @param cb The condition-bean of SynonymMember. (NotNull)
     * @param opLambda The callback for option of delete for varying requests. (NotNull)
     * @return The deleted count.
     * @throws NonQueryDeleteNotAllowedException When the query has no condition (if not allowed).
     */
    public int varyingQueryDelete(SynonymMemberCB cb, WritableOptionCall<SynonymMemberCB, DeleteOption<SynonymMemberCB>> opLambda) {
        return doQueryDelete(cb, createDeleteOption(opLambda));
    }

    // ===================================================================================
    //                                                                          OutsideSql
    //                                                                          ==========
    /**
     * Prepare the all facade executor of outside-SQL to execute it.
     *

     * // main style
     * synonymMemberBhv.outideSql().selectEntity(pmb); // optional
     * synonymMemberBhv.outideSql().selectList(pmb); // ListResultBean
     * synonymMemberBhv.outideSql().selectPage(pmb); // PagingResultBean
     * synonymMemberBhv.outideSql().selectPagedListOnly(pmb); // ListResultBean
     * synonymMemberBhv.outideSql().selectCursor(pmb, handler); // (by handler)
     * synonymMemberBhv.outideSql().execute(pmb); // int (updated count)
     * synonymMemberBhv.outideSql().call(pmb); // void (pmb has OUT parameters)
     *
     * // traditional style
     * synonymMemberBhv.outideSql().traditionalStyle().selectEntity(path, pmb, entityType);
     * synonymMemberBhv.outideSql().traditionalStyle().selectList(path, pmb, entityType);
     * synonymMemberBhv.outideSql().traditionalStyle().selectPage(path, pmb, entityType);
     * synonymMemberBhv.outideSql().traditionalStyle().selectPagedListOnly(path, pmb, entityType);
     * synonymMemberBhv.outideSql().traditionalStyle().selectCursor(path, pmb, handler);
     * synonymMemberBhv.outideSql().traditionalStyle().execute(path, pmb);
     *
     * // options
     * synonymMemberBhv.outideSql().removeBlockComment().selectList()
     * synonymMemberBhv.outideSql().removeLineComment().selectList()
     * synonymMemberBhv.outideSql().formatSql().selectList()
     *

     *
The invoker of behavior command should be not null when you call this method.

     * @return The new-created all facade executor of outside-SQL. (NotNull)
     */
    public OutsideSqlAllFacadeExecutor<SynonymMemberBhv> outsideSql() {
        return doOutsideSql();
    }

    // ===================================================================================
    //                                                                Optimistic Lock Info
    //                                                                ====================
    @Override
    protected boolean hasVersionNoValue(Entity et) { return downcast(et).getVersionNo() != null; }

    // ===================================================================================
    //                                                                         Type Helper
    //                                                                         ===========
    protected Class<? extends SynonymMember> typeOfSelectedEntity() { return SynonymMember.class; }
    protected Class<SynonymMember> typeOfHandlingEntity() { return SynonymMember.class; }
    protected Class<SynonymMemberCB> typeOfHandlingConditionBean() { return SynonymMemberCB.class; }

    // ===================================================================================
    //                                                                            Accessor
    //                                                                            ========
    @Override
    @javax.annotation.Resource(name="behaviorCommandInvoker")
    public void setBehaviorCommandInvoker(BehaviorCommandInvoker behaviorCommandInvoker) {
        super.setBehaviorCommandInvoker(behaviorCommandInvoker);
    }

    @Override
    @javax.annotation.Resource(name="behaviorSelector")
    public void setBehaviorSelector(BehaviorSelector behaviorSelector) {
        super.setBehaviorSelector(behaviorSelector);
    }

    @Override
    @javax.annotation.Resource(name="commonColumnAutoSetupper")
    public void setCommonColumnAutoSetupper(CommonColumnAutoSetupper commonColumnAutoSetupper) {
        super.setCommonColumnAutoSetupper(commonColumnAutoSetupper);
    }
}


text:
package org.apache.nifi.controller.repository.metrics;

public class NanoTimePerformanceTracker implements PerformanceTracker {
    private final Timer contentReadTimer = new Timer();
    private final Timer contentWriteTimer = new Timer();
    private final Timer sessionCommitTimer = new Timer();

    @Override
    public void beginContentRead() {
        contentReadTimer.start();
    }

    @Override
    public void endContentRead() {
        contentReadTimer.stop();
    }

    @Override
    public long getContentReadNanos() {
        return contentReadTimer.get();
    }

    @Override
    public void beginContentWrite() {
        contentWriteTimer.start();
    }

    @Override
    public void endContentWrite() {
        contentWriteTimer.stop();
    }

    @Override
    public long getContentWriteNanos() {
        return contentWriteTimer.get();
    }

    @Override
    public void beginSessionCommit() {
        sessionCommitTimer.start();
    }

    @Override
    public void endSessionCommit() {
        sessionCommitTimer.stop();
    }

    @Override
    public long getSessionCommitNanos() {
        return sessionCommitTimer.get();
    }

    private static class Timer {
        private long start = -1L;
        private long total;

        public void start() {
            start = System.nanoTime();
        }

        public void stop() {
            if (start == -1) {
                return;
            }

            total += (System.nanoTime() - start);
            start = -1L;
        }

        public long get() {
            return total;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
using Freelancer.Data.Infrastructure;
using Freelancer.Data.Repositories;
using Freelancer.Model.Common;
using Freelancer.Model.Models.Base;
using Freelancer.Model.Models.Pets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
namespace Freelancer.Service
{
    public interface IPetService

    {
        IEnumerable<Pet> GetAllPets(string name = null);

        Pet GetPet(int id);
        IEnumerable<Pet> GetPet(string name);
        void CreatePet(Pet employeeTypes);
        ListResult<PetListModel> GetAll(SearchParameters searchParameters, PetSearchModel model);
        void Update(Pet animal);
        SelectList GetAllPetDropdown(string Value = null);
        void SavePet();
    }

    public class PetService : IPetService
    {
        private readonly IPetRepository petRepository;
        private readonly IUnitOfWork unitOfWork;

        public PetService(IPetRepository petRepository, IUnitOfWork unitOfWork)
        {
            this.petRepository = petRepository;
            this.unitOfWork = unitOfWork;
        }
        public SelectList GetAllPetDropdown(string Value = null)
        {
            if (string.IsNullOrEmpty(Value))
            {
                var listItems = petRepository.GetMany(x => x.del == false).Select(i => new SelectListItem()
                {
                    Text = i.Name,
                    Value = i.AnimalId.ToString()
                }).ToList();

                listItems.Add(new SelectListItem() { Value = "-1", Text = "Others" });
                return new SelectList(listItems, "Value", "Text");

            }

            else
            {
                var listItems = petRepository.GetMany(x => x.del == false).Select(i => new SelectListItem()
                {
                    Text = i.Name,
                    Value = i.AnimalId.ToString()
                }).ToList();

                listItems.Add(new SelectListItem() { Value = "-1", Text = "Others" });
                return new SelectList(listItems, "Value", "Text", Value);

            }
        }

        public void Update(Pet animal)
        {

            petRepository.Update(animal);
        }
        public PetListModel ConvertToModel(Pet item)
        {
            return new PetListModel
            {
                AnimalId = item.AnimalId,
                DateCreated = item.DateCreated,
                del = item.del,
                Name = item.Name,

            };
        }

        public IEnumerable<PetListModel> ConvertToModel(IEnumerable<Pet> item)
        {

            return item.Select(x => ConvertToModel(x));

        }

        #region
        public ListResult<PetListModel> GetAll(SearchParameters searchParameters, PetSearchModel model)
        {
            try
            {
                if (searchParameters == null)
                {
                    throw new NullReferenceException("Search Parameters Cannot be null");
                }

                var items = petRepository.GetAll().AsQueryable();

                // Filter records using method implemented in drive class.
                items = FilterRecords(items, searchParameters, model);

                // Get total count of Filtered Records
                var totalRecords = items.Count();

                // Apply Sort Order
                items = CommonHelper.ApplyPetPaging(searchParameters, items);

                // Return Result
                var returnObject = new ListResult<PetListModel>();

                returnObject.TotalRecords = totalRecords;

                returnObject.ResultData = ConvertToModel(items).ToList(); ;
                //add row number
                int r = searchParameters.PageStart;
                returnObject.ResultData.ForEach(i => i.SNo = ++r);
                return returnObject;

            }
            catch (Exception ex)
            {

                throw ex;
            }
        }

        public IEnumerable<Pet> GetAllPets(string name = null)
        {

            ///

            if (string.IsNullOrEmpty(name))
                return petRepository.GetAll();
            else
                return petRepository.GetAll().Where(c => c.Name == name);
        }

        public Pet GetPet(int id)
        {
            var animal = petRepository.GetById(id);
            return animal;
        }

        public IEnumerable<Pet> GetPet(string name)
        {
            var animal = petRepository.GetAnimalName(name);
            return animal;
        }

        public void CreatePet(Pet pet)
        {
            petRepository.Add(pet);
        }

        public void SavePet()
        {
            unitOfWork.Commit();
        }
        private IQueryable<Pet> FilterOnSearchText(IQueryable<Pet> items, SearchParameters searchParameters)
        {

            if (!string.IsNullOrEmpty(searchParameters.SearchText))
            {
                items = items.Where(x =>
                                        x.Name.ToLower().Contains(searchParameters.SearchText.ToLower())

                                   );
            }

            return items;
        }

        public IQueryable<Pet> FilterRecords(IQueryable<Pet> items, SearchParameters searchParameters, PetSearchModel model)
        {

            // items = items.Where(w => w.del == false);

            // Filter Records on search text
            items = FilterOnSearchText(items, searchParameters);

            return items;

        }

        #endregion
    }
}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using Pear.InteractionEngine.Events;
using UnityEngine;

namespace Pear.InteractionEngine.EventListeners
{
	public class Outline : MonoBehaviour, IEventListener<RaycastHit?>
	{
		private const string LOG_TAG = "[Outline]";

		// The value of the outline width when the outline is not showing
		private const float NoOutlineValue = 0f;

		// The name of the material
		private const string MaterialName = "__outlineMat__";

		[Tooltip("Outline material")]
		public Material OutlineMaterialTemplate;

		// If true the outline will show
		// Will not show otherwise
		private static int counter = 0;
		private bool _showOutline = false;
		public bool ShowOutline
		{
			get { return _showOutline; }
			set
			{
				// If nothing changed return
				if (_showOutline == value)
					return;

				// Always remove any existing outline (brute force)
				RemoveOutline();

				// If we're showing the outline add it
				if (value)
					AddOutline();

				// Update the internal value
				_showOutline = value;
			}
		}

		private void Awake()
		{

		}

		public void ValueChanged(EventArgs<RaycastHit?> args)
		{
			ShowOutline = args.NewValue.HasValue;
		}

		private void AddOutline()
		{
			//Debug.Log(String.Format("{0} adding outline to {1}", LOG_TAG, name));

			Renderer[] renderers = GetComponentsInChildren<Renderer>();
			foreach (Renderer renderer in renderers)
			{
				Material outlineMaterial = Instantiate(OutlineMaterialTemplate);
				outlineMaterial.name = MaterialName;

				List<Material> materials = new List<Material>(renderer.sharedMaterials);
				materials.Add(outlineMaterial);
				renderer.sharedMaterials = materials.ToArray();
			}
		}

		private void RemoveOutline()
		{
			//Debug.Log(String.Format("{0} removing outline from {1}", LOG_TAG, name));

			Renderer[] renderers = GetComponentsInChildren<Renderer>();
			foreach (Renderer renderer in renderers)
			{
				// Remove any outline materials
				List<Material> newMaterials = new List<Material>(renderer.sharedMaterials);
				newMaterials.RemoveAll(material => material.name.Contains(MaterialName));
				renderer.sharedMaterials = newMaterials.ToArray();
			}
		}
	}
}


text:
"""
    SALTS XBMC Addon
    Copyright (C) 2014 tknorris

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""
import scraper
import urllib
import urlparse
import re
import xbmcaddon
from salts_lib import dom_parser
from salts_lib.constants import VIDEO_TYPES
from salts_lib.constants import QUALITIES

BASE_URL = 'https://beinmovie.com'
DETAIL_URL = '/movie-detail.php?%s'
PLAYER_URL = '/movie-player.php?%s'

QUALITY_MAP = {'HD': QUALITIES.HD720, 'FULL HD': QUALITIES.HD1080, 'DVD': QUALITIES.MEDIUM}

class BeinMovie_Scraper(scraper.Scraper):
    base_url = BASE_URL

    def __init__(self, timeout=scraper.DEFAULT_TIMEOUT):
        self.timeout = timeout
        self.base_url = xbmcaddon.Addon().getSetting('%s-base_url' % (self.get_name()))

    @classmethod
    def provides(cls):
        return frozenset([VIDEO_TYPES.MOVIE])

    @classmethod
    def get_name(cls):
        return 'beinmovie'

    def resolve_link(self, link):
        if self.base_url in link:
            html = self._http_get(link, cache_limit=.5)
            match = re.search('<source\s+src="([^"]+)', html)
            if match and match.group(1) != 'nop':
                return match.group(1)

        else:
            return link

    def format_source_label(self, item):
        label = '[%s] %s' % (item['quality'], item['host'])
        if 'views' in item and item['views']:
            label += ' (%s views)' % item['views']
        return label

    def get_sources(self, video):
        source_url = self.get_url(video)
        hosters = []
        if source_url:
            url = urlparse.urljoin(self.base_url, source_url)
            html = self._http_get(url, cache_limit=.5)

            fragment = dom_parser.parse_dom(html, 'div', {'class': '[^"]*movie_langs_list[^"]*'})
            if fragment:
                for match in re.finditer('href="([^"]+)', fragment[0]):
                    match = re.search('movie-player/(.*)', match.group(1))
                    if match:
                        player_url = urlparse.urljoin(self.base_url, PLAYER_URL % (match.group(1)))
                        html = self._http_get(player_url, cache_limit=.5)
                        match = re.search('<source\s+src="([^"]+)', html)
                        if match:
                            stream_url = match.group(1)
                            hoster = {'multi-part': False, 'url': stream_url, 'class': self, 'quality': self._gv_get_quality(stream_url), 'host': self._get_direct_hostname(stream_url), 'rating': None, 'views': None, 'direct': True}
                            hosters.append(hoster)

                        fragment2 = dom_parser.parse_dom(html, 'ul', {'class': 'servers'})
                        if fragment2:
                            for match in re.finditer('href="([^"]+).*?<span>(.*?)</span>', fragment2[0]):
                                other_url, quality = match.groups()
                                match = re.search('movie-player/(.*)', other_url)
                                if match:
                                    other_url = urlparse.urljoin(self.base_url, PLAYER_URL % (match.group(1)))
                                    if other_url == player_url: continue
                                    hoster = {'multi-part': False, 'url': other_url, 'class': self, 'quality': QUALITY_MAP.get(quality, QUALITIES.HD720), 'host': self._get_direct_hostname(other_url), 'rating': None, 'views': None, 'direct': True}
                                    hosters.append(hoster)

        return hosters

    def get_url(self, video):
        return super(BeinMovie_Scraper, self)._default_get_url(video)

    def search(self, video_type, title, year):
        search_url = urlparse.urljoin(self.base_url, '/movies-list.php?b=search&v=%s')
        search_url = search_url % (urllib.quote_plus(title))
        html = self._http_get(search_url, cache_limit=0)
        results = []
        for movie in dom_parser.parse_dom(html, 'li', {'class': '[^"]*movie[^"]*'}):
            href = dom_parser.parse_dom(movie, 'a', ret='href')
            title = dom_parser.parse_dom(movie, 'h4')

            if href and title:
                match = re.search('movie-detail/(.*?)/', href[0])
                if match:
                    result = {'url': DETAIL_URL % (match.group(1)), 'title': title[0], 'year': ''}
                    results.append(result)
        return results

    def _http_get(self, url, cache_limit=8):
        return super(BeinMovie_Scraper, self)._cached_http_get(url, self.base_url, self.timeout, cache_limit=cache_limit)


text:
const sass = require('gulp-sass');
const autoprefixer = require('gulp-autoprefixer');

const input = 'src/templates/**/*.scss';
const output = 'tmp/css';
const sassOptions = {
  errLogToConsole: true,
  outputStyle: 'expanded'
};

function sassTask(gulp, data) {
  return gulp.src(input)
          .pipe(sass(sassOptions).on('error', sass.logError))
          .pipe(autoprefixer())
          .pipe(gulp.dest(output));
};

module.exports = sassTask;


text:
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>PlayBook</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link href="../node_modules/@angular/material/prebuilt-themes/indigo-pink.css" rel="stylesheet">
</head>
<body>
  <app-root>Loading...</app-root>
</body>
</html>


text:
ALTER TABLE `addons`
 DROP COLUMN `locale_disambiguation`;


text:
#include "org_mitk_gui_qt_properties_Activator.h"
#include "QmitkPropertyTreeView.h"

ctkPluginContext* mitk::org_mitk_gui_qt_properties_Activator::m_Context = nullptr;

ctkPluginContext* mitk::org_mitk_gui_qt_properties_Activator::GetContext()
{
  return m_Context;
}

void mitk::org_mitk_gui_qt_properties_Activator::start(ctkPluginContext* context)
{
  BERRY_REGISTER_EXTENSION_CLASS(QmitkPropertyTreeView, context);
  m_Context = context;
}

void mitk::org_mitk_gui_qt_properties_Activator::stop(ctkPluginContext*)
{
  m_Context = nullptr;
}


text:
package edu.emory.cci.aiw.i2b2etl.dest;

import edu.emory.cci.aiw.i2b2etl.dest.config.Configuration;
import edu.emory.cci.aiw.i2b2etl.dest.config.Database;
import edu.emory.cci.aiw.i2b2etl.dest.config.DatabaseSpec;
import edu.emory.cci.aiw.i2b2etl.dest.metadata.MetadataUtil;
import edu.emory.cci.aiw.i2b2etl.ksb.QueryConstructor;
import edu.emory.cci.aiw.i2b2etl.ksb.QueryExecutor;
import edu.emory.cci.aiw.i2b2etl.ksb.ResultSetReader;
import edu.emory.cci.aiw.i2b2etl.ksb.TableAccessReader;
import edu.emory.cci.aiw.i2b2etl.ksb.UniqueIdTempTableHandler;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.arp.javautil.arrays.Arrays;
import org.arp.javautil.sql.ConnectionSpec;
import org.arp.javautil.sql.DatabaseProduct;
import org.protempa.KnowledgeSourceReadException;
import org.protempa.ProtempaUtil;
import org.protempa.dest.Statistics;
import org.protempa.dest.StatisticsException;

/**
 *
 * @author Andrew Post
 */
public class I2b2Statistics implements Statistics {

    private final ConnectionSpec dataConnectionSpec;
    private final ConnectionSpec metaConnectionSpec;
    private final String metaTableName;
    private final Object numberOfKeysMonitor = new Object();
    private final Object populatorMonitor = new Object();
    private Integer numberOfKeys;
    private final Set<String> currentPropIds;
    private Map<String, Integer> counts;
    private Map<String, String> childrenToParents;

    public I2b2Statistics(Configuration config) throws StatisticsException {
        Database databaseSection = config.getDatabase();
        DatabaseSpec dataSchemaSpec = databaseSection.getDataSpec();
        this.dataConnectionSpec = dataSchemaSpec.toConnectionSpec();
        DatabaseSpec metaSchemaSpec = databaseSection.getMetadataSpec();
        this.metaConnectionSpec = metaSchemaSpec.toConnectionSpec();
        this.metaTableName = config.getSettings().getMetaTableName();
        this.currentPropIds = new HashSet<>();
    }

    @Override
    public int getNumberOfKeys() throws StatisticsException {
        synchronized (this.numberOfKeysMonitor) {
            if (this.numberOfKeys == null) {
                try (Connection conn = this.dataConnectionSpec.getOrCreate();
                        Statement stmt = conn.createStatement();
                        ResultSet resultSet = stmt.executeQuery("SELECT COUNT(*) FROM PATIENT_DIMENSION");) {
                    if (!resultSet.next()) {
                        throw new AssertionError("No count retrieved for i2b2 destination");
                    }
                    this.numberOfKeys = resultSet.getInt(1);
                } catch (SQLException ex) {
                    throw new StatisticsException("Could not retrieve statistics from i2b2 destination", ex);
                }
            }
            return this.numberOfKeys;
        }
    }

    @Override
    public Map<String, String> getChildrenToParents() throws StatisticsException {
        return getChildrenToParents(null);
    }

    @Override
    public Map<String, String> getChildrenToParents(String[] propIds) throws StatisticsException {
        synchronized (this.populatorMonitor) {
            updateState(propIds);
            populateCountsAndChildrenToParentsIfNeeded();
            return this.childrenToParents;
        }
    }

    @Override
    public Map<String, Integer> getCounts() throws StatisticsException {
        return getCounts(null);
    }

    @Override
    public Map<String, Integer> getCounts(String[] propIds) throws StatisticsException {
        synchronized (this.populatorMonitor) {
            updateState(propIds);
            populateCountsAndChildrenToParentsIfNeeded();
            return this.counts;
        }
    }

    private void updateState(String[] propIds) {
        if (propIds != null && propIds.length > 0) {
            ProtempaUtil.checkArrayForNullElement(propIds, "propIds");
            for (String propId : propIds) {
                if (!this.currentPropIds.contains(propId)) {
                    this.counts = null;
                    this.childrenToParents = null;
                    this.currentPropIds.clear();
                    Arrays.addAll(this.currentPropIds, propIds);
                    break;
                }
            }

        } else {
            if (!this.currentPropIds.isEmpty()) {
                this.counts = null;
                this.childrenToParents = null;
                this.currentPropIds.clear();
            }
        }
    }

    public void clear() {
        synchronized (this) {
            this.numberOfKeys = null;
            this.counts = null;
            this.childrenToParents = null;
            this.currentPropIds.clear();
        }
    }

    private void populateCountsAndChildrenToParentsIfNeeded() throws StatisticsException {
        if (this.counts == null) {
            try (Connection conn = this.metaConnectionSpec.getOrCreate()) {
                try {
                    if (!this.currentPropIds.isEmpty()) {
                        populateUniqueIdTempTable(conn);
                    }

                    collectParentsAndCountsFromEurekafiedTables(conn);

                    if (this.metaTableName != null) {
                        collectParentsAndCountsFromEurekaOwnedTable(conn);
                    }
                    conn.commit();
                } catch (SQLException | KnowledgeSourceReadException ex) {
                    try {
                        conn.rollback();
                    } catch (SQLException ignore) {
                    } finally {
                        throw ex;
                    }
                }
            } catch (SQLException | KnowledgeSourceReadException ex) {
                throw new StatisticsException("Could not retrieve statistics from i2b2 destination", ex);
            }
            counts = Collections.unmodifiableMap(counts);
            childrenToParents = Collections.unmodifiableMap(childrenToParents);
        }
    }

    private void populateUniqueIdTempTable(final Connection conn) throws SQLException {
        try (UniqueIdTempTableHandler childTempTableHandler =
                new UniqueIdTempTableHandler(
                        DatabaseProduct.fromMetaData(
                                conn.getMetaData()), conn, false)) {
            for (String propId : this.currentPropIds) {
                childTempTableHandler.insert(propId);
            }
        }
    }

    private void collectParentsAndCountsFromEurekafiedTables(final Connection conn) throws KnowledgeSourceReadException {
        DatabaseProduct databaseProduct;
        try {
            databaseProduct = DatabaseProduct.fromMetaData(conn.getMetaData());
        } catch (SQLException ex) {
            throw new KnowledgeSourceReadException("Could not collect parents and counts", ex);
        }
        QueryExecutor queryExecutor = new QueryExecutor(conn, new QueryConstructor() {

            @Override
            public void appendStatement(StringBuilder sql, String table) {
                if (I2b2Statistics.this.currentPropIds.isEmpty()) {
                    sql.append("SELECT A1.EK_UNIQUE_ID EK_UNIQUE_ID, A2.EK_UNIQUE_ID PARENT_EK_UNIQUE_ID, A1.C_TOTALNUM FROM ").append(table).append(" A1 LEFT OUTER JOIN ").append(table).append(" A2 ON (A1.C_PATH=A2.C_FULLNAME) WHERE A1.C_HLEVEL=(SELECT MIN(C_HLEVEL) FROM TABLE_ACCESS WHERE C_TABLE_NAME='").append(table).append("') AND A1.M_APPLIED_PATH='@' AND A1.EK_UNIQUE_ID NOT LIKE '" + MetadataUtil.DEFAULT_CONCEPT_ID_PREFIX_INTERNAL + "%'");
                } else {
                    sql.append("SELECT A1.EK_UNIQUE_ID EK_UNIQUE_ID, A2.EK_UNIQUE_ID PARENT_EK_UNIQUE_ID, A1.C_TOTALNUM FROM ").append(table).append(" A1 LEFT OUTER JOIN ").append(table).append(" A2 ON (A1.C_PATH=A2.C_FULLNAME) JOIN EK_TEMP_UNIQUE_IDS A3 ON (A2.EK_UNIQUE_ID=A3.UNIQUE_ID) WHERE A2.M_APPLIED_PATH='@' AND A2.EK_UNIQUE_ID NOT LIKE '" + MetadataUtil.DEFAULT_CONCEPT_ID_PREFIX_INTERNAL + "%'");
                }
            }
        },
                new TableAccessReader(databaseProduct, this.metaTableName));
        IntStatisticsBuilder b = queryExecutor.execute(new ResultSetReader<IntStatisticsBuilder>() {

            @Override
            public IntStatisticsBuilder read(ResultSet rs) throws KnowledgeSourceReadException {
                return doProcess(rs);
            }

        });
        counts = b.counts;
        childrenToParents = b.childrenToParents;
    }

    private void collectParentsAndCountsFromEurekaOwnedTable(final Connection conn) throws StatisticsException {
        try (Statement stmt = conn.createStatement();
                ResultSet rs = stmt.executeQuery(
                        I2b2Statistics.this.currentPropIds.isEmpty()
                                ? "SELECT A1.C_BASECODE C_BASECODE, A2.C_BASECODE PARENT_C_BASECODE, A1.C_TOTALNUM FROM " + this.metaTableName + " A1 LEFT OUTER JOIN " + this.metaTableName + " A2 ON (A1.C_PATH=A2.C_FULLNAME) WHERE (A1.C_HLEVEL=(SELECT MIN(C_HLEVEL) FROM TABLE_ACCESS WHERE C_TABLE_NAME='" + this.metaTableName + "') OR A1.C_PATH=(SELECT C_FULLNAME FROM " + this.metaTableName + " WHERE C_BASECODE='AIW|Phenotypes')) AND A1.M_APPLIED_PATH='@' AND A1.C_BASECODE NOT LIKE '" + MetadataUtil.DEFAULT_CONCEPT_ID_PREFIX_INTERNAL + "%'"
                                : "SELECT A1.C_BASECODE C_BASECODE, A2.C_BASECODE PARENT_C_BASECODE, A1.C_TOTALNUM FROM " + this.metaTableName + " A1 LEFT OUTER JOIN " + this.metaTableName + " A2 ON (A1.C_PATH=A2.C_FULLNAME) JOIN EK_TEMP_UNIQUE_IDS A3 ON (A2.C_BASECODE=A3.UNIQUE_ID) WHERE A2.M_APPLIED_PATH='@' AND A2.C_BASECODE NOT LIKE '" + MetadataUtil.DEFAULT_CONCEPT_ID_PREFIX_INTERNAL + "%'")) {
            IntStatisticsBuilder c = doProcess(rs);
            counts.putAll(c.counts);
            for (Map.Entry<String, String> me : c.childrenToParents.entrySet()) {
                if (!childrenToParents.containsKey(me.getKey())) {
                    childrenToParents.put(me.getKey(), me.getValue());
                }
            }
        } catch (SQLException | KnowledgeSourceReadException ex) {
            throw new StatisticsException("Could not retrieve statistics from i2b2 destination", ex);
        }
    }

    private static class IntStatisticsBuilder {

        int numberOfKeys;
        Map<String, Integer> counts;
        Map<String, String> childrenToParents;
    }

    private static IntStatisticsBuilder doProcess(ResultSet rs) throws KnowledgeSourceReadException {
        IntStatisticsBuilder r = new IntStatisticsBuilder();
        Map<String, Integer> counts = new HashMap<>();
        Map<String, String> childrenToParents = new HashMap<>();
        try {
            while (rs.next()) {
                String key = rs.getString(1);
                String parentKey = rs.getString(2);
                childrenToParents.put(key, parentKey);
                Integer totalNum = rs.getObject(3) != null ? rs.getInt(3) : null;
                if (totalNum != null) {
                    counts.put(key, totalNum);
                }
            }
        } catch (SQLException ex) {
            throw new KnowledgeSourceReadException(ex);
        }
        r.counts = counts;
        r.childrenToParents = childrenToParents;
        return r;
    }

}