本文整理汇总了Java中org.olap4j.OlapException类的典型用法代码示例。如果您正苦于以下问题:Java OlapException类的具体用法?Java OlapException怎么用?Java OlapException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OlapException类属于org.olap4j包,在下文中一共展示了OlapException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
import org.olap4j.OlapException; //导入依赖的package包/类
public Expression render(AggregateTable table) throws OlapException {
VelocityContext context = new VelocityContext();
for(TableMeasure m : table.measures){
if(m.getExpression()!=null)
context.put(m.measure.replace(" ", "_"), m.getExpression().toString());
}
StringWriter w = new StringWriter();
try{
ve.evaluate(context, w, "render", this.formula);
}catch(Exception ex){
throw new OlapException("Fail to parse formula "+formula + ": "+ ex.getMessage(), ex);
}
return new CustomExpression(w.toString());
}
示例2: getPropertyValue
import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public Object getPropertyValue(Property property) throws OlapException {
if(property==Property.StandardMemberProperty.$visible){
return new Boolean(isVisible());
}else if(property==Property.StandardMemberProperty.CHILDREN_CARDINALITY){
return 0;
}else if(property==Property.StandardCellProperty.DATATYPE){
return "String";
}else if(property==Property.StandardMemberProperty.MEMBER_UNIQUE_NAME){
return getUniqueName();
}else if(property==Property.StandardMemberProperty.MEMBER_CAPTION){
return getCaption();
}else if(property==Property.StandardMemberProperty.LEVEL_UNIQUE_NAME){
return getLevel().getUniqueName();
}else if(property==Property.StandardMemberProperty.LEVEL_NUMBER){
return getLevel().getDepth();
}else{
return null;
} }
示例3: getPropertyValue
import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public Object getPropertyValue(Property property) throws OlapException {
if(property==Property.StandardMemberProperty.$visible){
return new Boolean(isVisible());
}else if(property==Property.StandardMemberProperty.CHILDREN_CARDINALITY){
return 0;
}else if(property==Property.StandardCellProperty.DATATYPE){
return "String";
}else if(property==Property.StandardMemberProperty.MEMBER_UNIQUE_NAME){
return getUniqueName();
}else if(property==Property.StandardMemberProperty.MEMBER_CAPTION){
return getCaption();
}else if(property==Property.StandardMemberProperty.LEVEL_UNIQUE_NAME){
return getLevel().getUniqueName();
}else if(property==Property.StandardMemberProperty.LEVEL_NUMBER){
return getLevel().getDepth();
}else{
return null;
}
}
示例4: getPropertyValue
import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public Object getPropertyValue(Property property) throws OlapException {
if(property==Property.StandardMemberProperty.$visible){
return new Boolean(isVisible());
}else if(property==Property.StandardMemberProperty.CHILDREN_CARDINALITY){
return 0;
}else if(property==Property.StandardCellProperty.DATATYPE){
return definition.datatype;
}else if(property==Property.StandardMemberProperty.MEMBER_UNIQUE_NAME){
return getUniqueName();
}else if(property==Property.StandardMemberProperty.MEMBER_CAPTION){
return getCaption();
}else if(property==Property.StandardMemberProperty.LEVEL_UNIQUE_NAME){
return getLevel().getUniqueName();
}else if(property==Property.StandardMemberProperty.LEVEL_NUMBER){
return getLevel().getDepth();
}else{
return null;
}
}
示例5: getPhysicalSchema
import org.olap4j.OlapException; //导入依赖的package包/类
public PhysicalSchema getPhysicalSchema() throws OlapException {
if(schema==null){
try{
schema = ResourceLoader.read(physical_schema, PhysicalSchema.class);
schema.index(this);
}catch(Exception ex){
throw new OlapException("Fail to read physical schema: "+ex.getMessage(), ex);
}
}
return schema;
}
示例6: collectAllUsedMeasures
import org.olap4j.OlapException; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public Set<ServerMeasure> collectAllUsedMeasures() throws OlapException{
Set measures = new HashSet();
for(LevelMemberSet layer : layers){
if(layer.isMeasure()){
measures.addAll(layer.getMembers());
}
measures.addAll(layer.getFunction().getAllMeasuresUsed());
}
return measures;
}
示例7: process
import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public void process(ResultSet result) throws SQLException, OlapException {
members = new ArrayList<Member>();
while(result.next()){
String key = result.getString(ID_ALIAS);
String name = result.getString(NAME_ALIAS);
members.add(new LevelMember(level, key, name, members.size()));
}
}
示例8: getConnection
import org.olap4j.OlapException; //导入依赖的package包/类
public Connection getConnection() throws OlapException{
try {
return dataSource.getConnection();
} catch (SQLException e) {
throw new OlapException("Fail to get connection", e);
}
}
示例9: memberSet
import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public List<LevelMemberSet> memberSet() throws OlapException {
Level level = MetadataUtils.lookupLevel(cube, node.getSegmentList());
if(level==null)
throw new OlapException("Level not found in cube: "+ParseUtils.toString(node));
return Collections.singletonList(new LevelMemberSet(level, node, this));
}
示例10: getCatalogs
import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public NamedList<Catalog> getCatalogs() throws OlapException {
NamedList<Catalog> list = MetadataUtils.catalogNamedList(new ArrayList<Catalog>());
for(CatalogDefinition cdef: definition.catalogs){
list.add(new ServerCatalog(this, cdef));
}
return list;
}
示例11: getMeasures
import org.olap4j.OlapException; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public List<Measure> getMeasures() {
if(measures!=null)
return measures;
try {
return (List)measureDimension.getDefaultHierarchy().getLevels().get(0).getMembers();
} catch (OlapException e) {
return null;
}
}
示例12: getOlapOp
import org.olap4j.OlapException; //导入依赖的package包/类
protected OlapOp getOlapOp(ParseTreeNode op_node, String name, Cube cube)
throws OlapException {
Class c = functionMap.get(name.toLowerCase());
if(c==null)
return null;
try {
Constructor cons = c.getConstructor(new Class[]{op_node.getClass(), Cube.class});
return (OlapOp) cons.newInstance(op_node, cube);
} catch (Exception e) {
throw new RuntimeException("Fail to run function "+name, e);
}
}
示例13: getAllMeasuresUsed
import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public Collection<ServerMeasure> getAllMeasuresUsed() throws OlapException {
if(node instanceof CallNode){
Set<ServerMeasure> result = new HashSet<ServerMeasure>();
for(IdentifierNode inode : ParseUtils.getAllIdentifiers((CallNode) node)){
Member m = cube.lookupMember(inode.getSegmentList());
if(m instanceof ServerMeasure)
result.add((ServerMeasure) m);
}
return result;
}else
return Collections.emptyList();
}
示例14: readHierarchies
import org.olap4j.OlapException; //导入依赖的package包/类
private void readHierarchies() throws OlapException {
hierarchies = MetadataUtils.metadataNamedList(new ArrayList<Hierarchy>());
Map<String, AttributeDefinition> attributeMap = new HashMap<String, AttributeDefinition>();
if(definition.attributes!=null)
for(AttributeDefinition cdef: definition.attributes){
attributeMap.put(cdef.name, cdef);
if(cdef.auto_hierarchy){
hierarchies.add(new ServerHierarchy(this, cdef, Collections.singletonList((NamedElement)cdef)));
}
}
if(definition.hierarchies!=null)
for(HierarchyDefinition hdef : definition.hierarchies){
List<NamedElement> levelDefs = new ArrayList<NamedElement>();
for(String level : hdef.levels){
AttributeDefinition attr_def = attributeMap.get(level);
if(attr_def==null)
throw new OlapException("Fail to find attribute "+level+" used in dimension "+ getName());
levelDefs.add(attr_def);
}
hierarchies.add(new ServerHierarchy(this, hdef, levelDefs));
}
}
示例15: getCubes
import org.olap4j.OlapException; //导入依赖的package包/类
@Override
public NamedList<Cube> getCubes() throws OlapException {
NamedList<Cube> list = MetadataUtils.metadataNamedList(new ArrayList<Cube>());
for(CubeDefinition def : definition.cubes){
list.add(new ServerCube(this, def));
}
return list;
}