public XmlDataDAO getVariable(String varName) {
entering("ScopeDaoImpl.getVariable");
XmlDataDAO cached = _variables.get(varName);
if (cached != null) return _variables.get(varName);
HXmlData data;
Query qry = getSession().createQuery(QRY_VARIABLE);
qry.setString(0,varName);
qry.setLong(1,_scope.getId());
List res = qry.list();
if(res.size() > 0)
data = (HXmlData)res.get(0);
else {
data = new HXmlData();
data.setName(varName);
data.setScope(_scope);
}
XmlDataDaoImpl varDao = new XmlDataDaoImpl(_sm, data);
_variables.put(varName, varDao);
return varDao;