io.baltoro.client.CustomQuery Maven / Gradle / Ivy
package io.baltoro.client;
import java.util.HashMap;
import java.util.Map;
public class CustomQuery
{
private Class c;
private String q;
private Map map = new HashMap<>(50);
private LocalDB db;
CustomQuery(Class c, String q, LocalDB db)
{
this.c = c;
this.q = q;
this.db = db;
}
public CustomQuery map(String colName, String propertyName)
{
map.put(colName.toLowerCase(), propertyName);
return this;
}
public RecordList execute()
{
RecordList rl = db.executeQuery(c, this);
return rl;
}
String getQuery()
{
return q;
}
Class getClassT()
{
return c;
}
String getPropertyName(String colName)
{
return map.get(colName.toLowerCase());
}
}