if (c == null)
c = mf.isSingleValue ? mf.getConcreteType() : mf.getSubClass();
try {
return createInstance(c, dbObj);
} catch (RuntimeException e) {
ConstructorArgs argAnn = mf.getAnnotation(ConstructorArgs.class);
if (argAnn == null)
throw e;
//TODO: now that we have a mapr, get the arg types that way by getting the fields by name. + Validate names
Object[] args = new Object[argAnn.value().length];
Class[] argTypes = new Class[argAnn.value().length];
for (int i = 0; i < argAnn.value().length; i++) {
//TODO: run converters and stuff against these. Kinda like the List of List stuff, using a fake MappedField to hold the value
Object val = dbObj.get(argAnn.value()[i]);
args[i] = val;
argTypes[i] = val.getClass();
}
try {
Constructor ctor = c.getDeclaredConstructor(argTypes);