io.github.nichetoolkit.mybatis.style.DefaultNormalStyle Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mybatis-toolkit-context Show documentation
Show all versions of mybatis-toolkit-context Show documentation
Mybatis toolkit context project for Spring Boot
The newest version!
package io.github.nichetoolkit.mybatis.style;
import io.github.nichetoolkit.mybatis.MybatisField;
import io.github.nichetoolkit.mybatis.MybatisTableStyle;
import io.github.nichetoolkit.mybatis.MybatisTable;
import io.github.nichetoolkit.rice.enums.StyleType;
import io.github.nichetoolkit.rest.util.GeneralUtils;
import java.lang.reflect.Field;
/**
* DefaultNormalStyle
* The default normal style class.
* @see io.github.nichetoolkit.mybatis.MybatisTableStyle
* @author Cyan ([email protected])
* @since Jdk1.8
*/
public class DefaultNormalStyle implements MybatisTableStyle {
@Override
public StyleType getStyleType() {
return StyleType.NORMAL;
}
@Override
public String tableName(Class> entityType) {
return entityType.getSimpleName();
}
@Override
public String tableAlias(Class> entityType) {
String tableName = entityType.getSimpleName();
return GeneralUtils.abbreviate(tableName);
}
@Override
public String columnName(Field field) {
return field.getName();
}
@Override
public String columnName(MybatisField field) {
return columnName(field.field());
}
@Override
public String columnName(MybatisTable table, MybatisField field) {
return columnName(field);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy