io.github.nichetoolkit.mybatis.style.DefaultLowerStyle 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;
/**
* DefaultLowerStyle
* The default lower style class.
* @see io.github.nichetoolkit.mybatis.MybatisTableStyle
* @author Cyan ([email protected])
* @since Jdk1.8
*/
public class DefaultLowerStyle implements MybatisTableStyle {
@Override
public StyleType getStyleType() {
return StyleType.LOWER;
}
@Override
public String tableName(Class> entityType) {
return entityType.getSimpleName().toLowerCase();
}
@Override
public String tableAlias(Class> entityType) {
String tableName = entityType.getSimpleName();
return GeneralUtils.abbreviate(tableName);
}
@Override
public String columnName(Field field) {
return field.getName().toLowerCase();
}
@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