All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.noear.wood.wrap.NamingStrategy Maven / Gradle / Ivy

There is a newer version: 1.3.14
Show newest version
package org.noear.wood.wrap;


import org.noear.wood.WoodConfig;
import org.noear.wood.utils.NamingUtils;

import java.lang.reflect.Field;

public class NamingStrategy {
    public String classToTableName(Class clz) {
        if (WoodConfig.isUsingUnderlineColumnName) {
            return NamingUtils.toUnderlineString(clz.getSimpleName());
        } else {
            return clz.getSimpleName();
        }
    }

    public String fieldToColumnName(Class clz, Field f) {
        if (WoodConfig.isUsingUnderlineColumnName) {
            return NamingUtils.toUnderlineString(f.getName());
        } else {
            return f.getName();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy