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

com.zcj.util.jdbc.TableInfo Maven / Gradle / Ivy

There is a newer version: 1.1.38
Show newest version
package com.zcj.util.jdbc;

import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 * 表信息
 *
 * @author [email protected]
 * @since 2016年8月4日
 */
@Deprecated
public class TableInfo {

    private String tableName;// 表名
    private String primaryFieldName;// 主键字段名称

    public static TableInfo fromNewTableInfo(com.zcj.util.db.meta.TableInfo newTableInfo) {
        if (newTableInfo == null) {
            return null;
        }
        TableInfo oldTableInfo = new TableInfo();
        oldTableInfo.setTableName(newTableInfo.getTableName());

        List pks = newTableInfo.getPkNames();
        if (!CollectionUtils.isEmpty(pks)) {
            oldTableInfo.setPrimaryFieldName(pks.get(0));
        }
        return oldTableInfo;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getPrimaryFieldName() {
        return primaryFieldName;
    }

    public void setPrimaryFieldName(String primaryFieldName) {
        this.primaryFieldName = primaryFieldName;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy