com.sagframe.sagacity.sqltoy.plus.FiledMappingStrategy Maven / Gradle / Ivy
package com.sagframe.sagacity.sqltoy.plus;
import java.lang.reflect.Field;
import java.util.Arrays;
public interface FiledMappingStrategy {
String getColumnName(Class> clazz, String filedName);
default String getEntityName(Class> clazz) {
return clazz.getSimpleName();
}
default String[] getEntityFields(Class> clazz) {
return Arrays.stream(clazz.getDeclaredFields()).map(Field::getName).toArray(String[]::new);
}
}