<%
    var tableAlias = util.getTableAlias(table.name);
%>
package ${entityPath}.table;

import ${package.Entity}.${entity};
import com.jy.framework.mybatis.join.QueryColumn;
import com.jy.framework.mybatis.join.Table;

public class ${entity}Table extends Table<${entity}> {

    public static ${entity}Table ${table.name} = new ${entity}Table();
    public static ${entity}Table ${tableAlias} = ${table.name}.as("${tableAlias}");

<% for(field in table.commonFields){ %>
    /**
     * ${field.comment}
     */
    public QueryColumn ${field.propertyName} = this.field(${entity}::${util.genGetter(field.propertyName)});

<% } %>
<% for(field in table.fields){ %>
    /**
     * ${field.comment}
     */
    public QueryColumn ${field.propertyName} = this.field(${entity}::${util.genGetter(field.propertyName)});

<% } %>
    private ${entity}Table() {
        super(${entity}.class);
    }

    private ${entity}Table(String alias) {
        super(${entity}.class, alias);
    }

    public ${entity}Table as(String alias) {
        return new ${entity}Table(alias);
    }

}
