// Path: src/main/java/org/olap/server/database/NamedElement.java
// public abstract class NamedElement {
// 	public String name, caption;
// }
// 
// Path: src/main/java/org/olap/server/processor/MemberQuery.java
// public class MemberQuery {
// 
// 
// 	private Level level;
// 	private ServerCatalog catalog;
// 	
// 	public MemberQuery(Catalog catalog, Level level) throws OlapException {
// 
// 		this.level = level;
// 		this.catalog = (ServerCatalog) catalog;
// 		
// 	}
// 
// 	public List<Member> getMembers() throws OlapException {
// 		
// 		if(! (level instanceof ServerLevel ) )
// 			return level.getMembers();
// 		
// 		SqlMembersQuery query = new SqlMembersQuery(catalog.getPhysicalSchema(), level);
// 
// 		query.generateQuery();
// 
// 		SqlConnector exec = SqlConnector.getConnector(catalog);
// 		
// 		exec.execute(query.toString(), query);
// 		
// 		return query.getMembers();
// 	}
// 
// }


import java.util.List;
import org.olap.server.database.NamedElement;
import org.olap.server.processor.MemberQuery;
import org.olap4j.OlapException;
import org.olap4j.impl.Olap4jUtil;
import org.olap4j.metadata.Dimension;
import org.olap4j.metadata.Hierarchy;
import org.olap4j.metadata.Level;
import org.olap4j.metadata.Member;
import org.olap4j.metadata.NamedList;
import org.olap4j.metadata.Property;

	@Override
	public Hierarchy getHierarchy() {
		return hierarchy;
	}

	@Override
	public Dimension getDimension() {
		return hierarchy.getDimension();
	}

	@Override
	public Type getLevelType() {
		return Type.REGULAR;
	}

	@Override
	public boolean isCalculated() {
		return false;
	}

	@Override
	public NamedList<Property> getProperties() {
		return Olap4jUtil.emptyNamedList();
	}

	@Override
	public List<Member> getMembers() throws OlapException {
		ServerDimension dim = (ServerDimension) getDimension();		
		MemberQuery query = new MemberQuery(dim.getServerSchema().getCatalog(), this);
// Path: src/main/java/org/olap/server/database/NamedElement.java
// public abstract class NamedElement {
// 	public String name, caption;
// }
// 
// Path: src/main/java/org/olap/server/processor/MemberQuery.java
// public class MemberQuery {
// 
// 
// 	private Level level;
// 	private ServerCatalog catalog;
// 	
// 	public MemberQuery(Catalog catalog, Level level) throws OlapException {
// 
// 		this.level = level;
// 		this.catalog = (ServerCatalog) catalog;
// 		
// 	}
// 
// 	public List<Member> getMembers() throws OlapException {
// 		
// 		if(! (level instanceof ServerLevel ) )
// 			return level.getMembers();
// 		
// 		SqlMembersQuery query = new SqlMembersQuery(catalog.getPhysicalSchema(), level);
// 
// 		query.generateQuery();
// 
// 		SqlConnector exec = SqlConnector.getConnector(catalog);
// 		
// 		exec.execute(query.toString(), query);
// 		
// 		return query.getMembers();
// 	}
// 
// }


// Path: src/main/java/org/olap/server/driver/metadata/ServerLevel.java
import java.util.List;
import org.olap.server.database.NamedElement;
import org.olap.server.processor.MemberQuery;
import org.olap4j.OlapException;
import org.olap4j.impl.Olap4jUtil;
import org.olap4j.metadata.Dimension;
import org.olap4j.metadata.Hierarchy;
import org.olap4j.metadata.Level;
import org.olap4j.metadata.Member;
import org.olap4j.metadata.NamedList;
import org.olap4j.metadata.Property;


	@Override
	public Hierarchy getHierarchy() {
		return hierarchy;
	}

	@Override
	public Dimension getDimension() {
		return hierarchy.getDimension();
	}

	@Override
	public Type getLevelType() {
		return Type.REGULAR;
	}

	@Override
	public boolean isCalculated() {
		return false;
	}

	@Override
	public NamedList<Property> getProperties() {
		return Olap4jUtil.emptyNamedList();
	}

	@Override
	public List<Member> getMembers() throws OlapException {
		ServerDimension dim = (ServerDimension) getDimension();		
		MemberQuery query = new MemberQuery(dim.getServerSchema().getCatalog(), this);
		return query.getMembers();