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;
}
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;
}
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;
}
Aggregations