package io.ebeaninternal.server.query;
import io.ebean.meta.MetaQueryPlan;
class DQueryPlanOutput implements MetaQueryPlan {
private final Class<?> beanType;
private final String label;
private final String sql;
private final String bind;
private final String plan;
private String planHash;
private long queryTimeMicros;
private long captureCount;
DQueryPlanOutput(Class<?> beanType, String label, String sql, String bind, String plan) {
this.beanType = beanType;
this.label = label;
this.sql = sql;
this.bind = bind;
this.plan = plan;
}
@Override
public String getQueryPlanHash() {
return planHash;
}
@Override
public Class<?> getBeanType() {
return beanType;
}
@Override
public String getLabel() {
return label;
}
@Override
public String getSql() {
return sql;
}
@Override
public String getBind() {
return bind;
}
@Override
public String getPlan() {
return plan;
}
@Override
public long getQueryTimeMicros() {
return queryTimeMicros;
}
@Override
public long getCaptureCount() {
return captureCount;
}
@Override
public String toString() {
return " BeanType:" + ((beanType == null) ? "" : beanType.getSimpleName()) + " planHash:" + planHash + " label:" + label + " queryTimeMicros:" + queryTimeMicros + " captureCount:" + captureCount + "\n SQL:" + sql + "\nBIND:" + bind + "\nPLAN:" + plan;
}
void with(long queryTimeMicros, long captureCount, String planHash) {
this.queryTimeMicros = queryTimeMicros;
this.captureCount = captureCount;
this.planHash = planHash;
}
}