1 13 package com.tonbeller.jpivot.test.olap; 14 15 import javax.sql.DataSource ; 16 17 import com.tonbeller.jpivot.core.ExtensionSupport; 18 import com.tonbeller.jpivot.olap.model.Member; 19 import com.tonbeller.jpivot.olap.model.Property; 20 import com.tonbeller.jpivot.param.SqlAccess; 21 import com.tonbeller.wcf.param.SessionParam; 22 23 26 public class TestSqlAccess extends ExtensionSupport implements SqlAccess { 27 28 public DataSource getDataSource() { 29 return null; 30 } 31 32 public SessionParam createParameter(Member m, String paramName) { 33 SessionParam p = new SessionParam(); 34 p.setDisplayName(m.getLevel().getLabel()); 35 p.setDisplayValue(m.getLabel()); 36 p.setMdxValue(m.getLabel()); 37 p.setName(paramName); 38 p.setSqlValue(m.getLabel()); 39 return p; 40 } 41 42 public SessionParam createParameter(Member m, String paramName, String propertyName) { 43 SessionParam p = new SessionParam(); 44 p.setDisplayName(m.getLevel().getLabel()); 45 p.setDisplayValue(m.getLabel()); 46 p.setMdxValue(m.getLabel()); 47 p.setName(paramName); 48 Property prop = m.getProperty(propertyName); 49 p.setSqlValue(prop.getValue()); 50 return p; 51 } 52 53 } 54 | Popular Tags |