use of org.dbflute.jdbc.ClassificationMeta in project dbflute-core by dbflute.
the class AbstractDBMeta method ccls.
// -----------------------------------------------------
// Write Converter
// ---------------
// these are static to avoid the FindBugs headache
// (implementations of PropertyGateway can be static class)
protected static void ccls(Entity entity, ColumnInfo columnInfo, Object code) {
// old style, for compatibility, check only on entity after Java8
if (code == null) {
// no check null value which means no existence on DB
return;
}
final ClassificationMeta meta = columnInfo.getClassificationMeta();
if (meta == null) {
// no way (just in case)
return;
}
final ClassificationUndefinedHandlingType undefinedHandlingType = meta.undefinedHandlingType();
if (!undefinedHandlingType.isChecked()) {
// basically no way (not called if no check)
return;
}
final Classification classification = gcls(entity, columnInfo, code);
if (classification == null) {
final String tableDbName = columnInfo.getDBMeta().getTableDbName();
final String columnDbName = columnInfo.getColumnDbName();
final boolean allowedByOption = entity.myundefinedClassificationAccessAllowed();
FunCustodial.handleUndefinedClassificationCode(tableDbName, columnDbName, meta, code, allowedByOption);
}
}
use of org.dbflute.jdbc.ClassificationMeta in project lastaflute by lastaflute.
the class LaClassificationUtil method nativeFindMeta.
// -----------------------------------------------------
// meta.find(name)
// ---------------
protected static OptionalThing<ClassificationMeta> nativeFindMeta(Class<?> defmetaType, String classificationName) {
// old method
assertArgumentNotNull("defmetaType", defmetaType);
assertArgumentNotNull("classificationName", classificationName);
final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(defmetaType);
final String methodName = "find";
final Method method;
try {
method = beanDesc.getMethod(methodName, new Class<?>[] { String.class });
} catch (BeanMethodNotFoundException e) {
String msg = "Failed to get the method " + methodName + "() of the def-meta type: " + defmetaType;
throw new ClassificationMetaFindMethodNotFoundException(msg, e);
}
@SuppressWarnings("unchecked") OptionalThing<ClassificationMeta> opt = (OptionalThing<ClassificationMeta>) DfReflectionUtil.invokeStatic(method, new Object[] { classificationName });
return opt;
}
Aggregations