随笔,简单记录而已,
final ParameterizedType paraType = (ParameterizedType) this.getClass().getGenericSuperclass();
final Type[] types = paraType.getActualTypeArguments();
String tableName = null;
for (final Type type : types) {
final Annotation annotation = ((Class) type).getAnnotation(Table.class);
if (annotation == null) {
continue;
}
tableName = ((Table) annotation).name();
break;
}