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

org.nbone.persistence.util.JpaAnnotationUtils Maven / Gradle / Ivy

package org.nbone.persistence.util;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 *
 *
 * @author chenyicheng
 * @version 1.0
 * @since 2018/11/20
 */
public class JpaAnnotationUtils {

    /**
     * 获取配置的表名称
     * @param entityClass
     * @param 
     * @return
     */
    public static  String  getTableName(Class entityClass){
        if(entityClass.isAnnotationPresent(Table.class) && entityClass.isAnnotationPresent(Entity.class)){
            Table an  = entityClass.getAnnotation(Table.class);
            return  an.name() != null ? an.name() : null;
        }
        return  null;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy