Search in sources :

Example 1 with TnRelationRowCreationResource

use of org.dbflute.s2dao.rowcreator.TnRelationRowCreationResource in project dbflute-core by dbflute.

the class TnRelationRowCreatorImpl method createResourceForPropertyCache.

protected TnRelationRowCreationResource createResourceForPropertyCache(TnRelationPropertyType rpt, Map<String, String> selectColumnMap, Map<String, Map<String, Integer>> selectIndexMap, Map<String, Map<String, TnPropertyMapping>> relPropCache, TnRelationSelector relSelector, String baseSuffix, String relationNoSuffix, int limitRelationNestLevel) throws SQLException {
    // the resource class is already customized for DBFlute
    final TnRelationRowCreationResource res = new TnRelationRowCreationResource();
    res.setRelationPropertyType(rpt);
    res.setSelectColumnMap(selectColumnMap);
    res.setSelectIndexMap(selectIndexMap);
    res.setRelPropCache(relPropCache);
    res.setRelationSelector(relSelector);
    res.setBaseSuffix(baseSuffix);
    res.setRelationNoSuffix(relationNoSuffix);
    res.setLimitRelationNestLevel(limitRelationNestLevel);
    // as default
    res.setCurrentRelationNestLevel(1);
    return res;
}
Also used : TnRelationRowCreationResource(org.dbflute.s2dao.rowcreator.TnRelationRowCreationResource)

Example 2 with TnRelationRowCreationResource

use of org.dbflute.s2dao.rowcreator.TnRelationRowCreationResource in project dbflute-core by dbflute.

the class TnRelationRowCreatorImpl method createResourceForRow.

protected TnRelationRowCreationResource createResourceForRow(ResultSet rs, TnRelationPropertyType rpt, Map<String, String> selectColumnMap, Map<String, Map<String, Integer>> selectIndexMap, TnRelationKey relKey, Map<String, Map<String, TnPropertyMapping>> relPropCache, TnRelationRowCache relRowCache, TnRelationSelector relSelector) throws SQLException {
    // the resource class is already customized for DBFlute
    final TnRelationRowCreationResource res = new TnRelationRowCreationResource();
    res.setResultSet(rs);
    res.setRelationPropertyType(rpt);
    res.setSelectColumnMap(selectColumnMap);
    res.setSelectIndexMap(selectIndexMap);
    res.setRelationKey(relKey);
    res.setRelPropCache(relPropCache);
    res.setRelRowCache(relRowCache);
    res.setRelationSelector(relSelector);
    // as base point
    res.setBaseSuffix("");
    // as first level relation
    res.setRelationNoSuffix(rpt.getRelationNoSuffixPart());
    res.setLimitRelationNestLevel(getLimitRelationNestLevel());
    // as Default
    res.setCurrentRelationNestLevel(1);
    res.setCreateDeadLink(isCreateDeadLink());
    return res;
}
Also used : TnRelationRowCreationResource(org.dbflute.s2dao.rowcreator.TnRelationRowCreationResource)

Example 3 with TnRelationRowCreationResource

use of org.dbflute.s2dao.rowcreator.TnRelationRowCreationResource in project dbflute-core by dbflute.

the class TnRelationRowCreatorImpl method createPropertyCache.

// ===================================================================================
// Property Cache Creation
// =======================
/**
 * {@inheritDoc}
 */
public Map<String, Map<String, TnPropertyMapping>> createPropertyCache(Map<String, String> selectColumnMap, Map<String, Map<String, Integer>> selectIndexMap, TnRelationSelector relSelector, TnBeanMetaData baseBmd) throws SQLException {
    // - - - - - - -
    // Entry Point!
    // - - - - - - -
    final Map<String, Map<String, TnPropertyMapping>> relPropCache = newRelationPropertyCache();
    final List<TnRelationPropertyType> relationPropertyTypeList = baseBmd.getRelationPropertyTypeList();
    for (TnRelationPropertyType rpt : relationPropertyTypeList) {
        final String baseSuffix = "";
        final String relationNoSuffix = rpt.getRelationNoSuffixPart();
        final TnRelationRowCreationResource res = createResourceForPropertyCache(rpt, selectColumnMap, selectIndexMap, relPropCache, relSelector, baseSuffix, relationNoSuffix, getLimitRelationNestLevel());
        setupPropertyCache(res);
    }
    return relPropCache;
}
Also used : TnRelationPropertyType(org.dbflute.s2dao.metadata.TnRelationPropertyType) TnRelationRowCreationResource(org.dbflute.s2dao.rowcreator.TnRelationRowCreationResource) Map(java.util.Map) StringKeyMap(org.dbflute.helper.StringKeyMap)

Aggregations

TnRelationRowCreationResource (org.dbflute.s2dao.rowcreator.TnRelationRowCreationResource)3 Map (java.util.Map)1 StringKeyMap (org.dbflute.helper.StringKeyMap)1 TnRelationPropertyType (org.dbflute.s2dao.metadata.TnRelationPropertyType)1