use of org.dbflute.s2dao.metadata.TnPropertyType in project dbflute-core by dbflute.
the class AbstractBatchUpdateCommand method createNonOrderedPropertyNames.
private String[] createNonOrderedPropertyNames(TnBeanMetaData bmd) {
final List<String> propertyNameList = new ArrayList<String>();
final List<TnPropertyType> ptList = bmd.getPropertyTypeList();
for (TnPropertyType pt : ptList) {
if (pt.isPersistent()) {
propertyNameList.add(pt.getPropertyName());
}
}
return propertyNameList.toArray(new String[propertyNameList.size()]);
}
use of org.dbflute.s2dao.metadata.TnPropertyType in project dbflute-core by dbflute.
the class TnRelationRowCreatorExtension method setupPropertyCache.
// ===================================================================================
// Property Cache Setup
// ====================
@Override
protected void setupPropertyCache(TnRelationRowCreationResource res) throws SQLException {
// - - - - - - - - - - -
if (res.isStopCurrentRelationMapping()) {
return;
}
// set up property cache about current bean meta data
final TnBeanMetaData nextBmd = res.getRelationBeanMetaData();
final List<TnPropertyType> ptList = nextBmd.getPropertyTypeList();
for (TnPropertyType pt : ptList) {
// already been filtered as target only
res.setCurrentPropertyType(pt);
setupPropertyCacheElement(res);
}
// set up next level relation's property cache
if (res.isStopNextRelationMapping()) {
return;
}
res.prepareNextLevelMapping();
try {
setupNextPropertyCache(res, nextBmd);
} finally {
res.closeNextLevelMapping();
}
}
use of org.dbflute.s2dao.metadata.TnPropertyType in project dbflute-core by dbflute.
the class TnBeanMetaDataImpl method setupPrimaryKey.
protected void setupPrimaryKey() {
// only called in the initialize() process
final List<TnPropertyType> keys = new ArrayList<TnPropertyType>();
for (TnPropertyType pt : _propertyTypeList) {
if (pt.isPrimaryKey()) {
keys.add(pt);
setupIdentifierGenerator(pt);
}
}
_primaryKeys = (TnPropertyType[]) keys.toArray(new TnPropertyType[keys.size()]);
}
use of org.dbflute.s2dao.metadata.TnPropertyType in project dbflute-core by dbflute.
the class TnBeanMetaDataImpl method getPropertyType.
public TnPropertyType getPropertyType(String propertyName) {
final TnPropertyType propertyType = (TnPropertyType) _propertyTypeMap.get(propertyName);
if (propertyType == null) {
String msg = "The propertyName was not found in the map:";
msg = msg + " propertyName=" + propertyName + " propertyTypeMap=" + _propertyTypeMap;
throw new IllegalStateException(msg);
}
return propertyType;
}
use of org.dbflute.s2dao.metadata.TnPropertyType in project dbflute-core by dbflute.
the class TnBeanMetaDataImpl method throwBeanMetaPropertyTypeByColumnNameNotFoundException.
protected void throwBeanMetaPropertyTypeByColumnNameNotFoundException(String columnName) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("The column was not found in the table.");
br.addItem("Bean Class");
br.addElement(_beanClass);
br.addItem("Column");
br.addElement(_tableName + "." + columnName);
br.addItem("DBMeta");
br.addElement(_dbmeta);
br.addItem("Mapping");
final Set<Entry<String, TnPropertyType>> entrySet = _columnPropertyTypeMap.entrySet();
for (Entry<String, TnPropertyType> entry : entrySet) {
br.addElement(entry.getKey() + ": " + entry.getValue());
}
final String msg = br.buildExceptionMessage();
throw new IllegalStateException(msg);
}
Aggregations