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

org.nutz.plugins.sqltpl.NutSqlTpl Maven / Gradle / Ivy

There is a newer version: 1.r.69.v20220215
Show newest version
package org.nutz.plugins.sqltpl;

import org.nutz.dao.impl.sql.NutSql;
import org.nutz.dao.jdbc.ValueAdaptor;

public abstract class NutSqlTpl extends NutSql {

    private static final long serialVersionUID = 1L;
    
    protected boolean renderComplete;

    public NutSqlTpl(String source) {
        super(source);
    }
    
    public ValueAdaptor[] getAdaptors() {
        checkRender();
        return super.getAdaptors();
    }

    public String toPreparedStatement() {
        checkRender();
        return super.toPreparedStatement();
    }
    
    public Object[][] getParamMatrix() {
        checkRender();
        return super.getParamMatrix();
    }
    
    protected void checkRender() {
        if (!renderComplete) {
            render();
            renderComplete = true;
        }
    }
    
    protected abstract void render();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy