Table tableAnn = clazz.getAnnotation(Table.class);
String table = tableAnn == null ? "" : tableAnn.name();
table = "".equals(table.trim()) ? clazz.getSimpleName()
.replace("PO", "").replace("POJO", "").replace("Entity", "")
.replace("Model", "") : table;
ORMConfigBean ormBean = new ORMConfigBean();
ormBean.setClazz(clazz.getName());
ormBean.setId(clazz.getSimpleName());
ormBean.setTable(table);
List<Property> pList = getProperties(clazz, null, false);
List<Property> superList = new ArrayList<Property>();
Class<?> superClazz = clazz.getSuperclass();
try {
for (; superClazz != Object.class && superClazz != null; superClazz = superClazz
.getSuperclass()) {
if (!superClazz.isAnnotationPresent(MappedSuperclass.class))
continue;
List<Property> list = getProperties(superClazz, pList, true);
if (list != null)
superList.addAll(list);
}
} catch (Error er) {
log.debug("the action class new instance failued -> " + clsName + " | " + er.toString());
return false;
} catch (Exception e) {
log.debug("the action class new instance failued -> " + clsName + " | " + e.toString());
return false;
}
List<Property> properties = new ArrayList<Property>(superList);
properties.addAll(pList);
ormBean.setProperty(properties);
ORMConfigBeanCache.add(clazz, ormBean);
return true;
}