本文整理汇总了Java中mondrian.olap.Query类的典型用法代码示例。如果您正苦于以下问题:Java Query类的具体用法?Java Query怎么用?Java Query使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Query类属于mondrian.olap包,在下文中一共展示了Query类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createDatasource
import mondrian.olap.Query; //导入依赖的package包/类
@Override
public JRDataSource createDatasource() throws JRException
{
JRDataSource dataSource = null;
String queryStr = getQueryString();
if (connection != null && queryStr != null)
{
if (log.isDebugEnabled())
{
log.debug("MDX query: " + queryStr);
}
Query query = connection.parseQuery(queryStr);
result = connection.execute(query);
logResult();
dataSource = new JRMondrianDataSource(dataset, result);
}
return dataSource;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:23,代码来源:JRMondrianQueryExecuter.java
示例2: MondrianOlap4jCellSetMetaData
import mondrian.olap.Query; //导入依赖的package包/类
MondrianOlap4jCellSetMetaData(
MondrianOlap4jStatement olap4jStatement,
Query query)
{
this.olap4jStatement = olap4jStatement;
this.query = query;
for (final QueryAxis queryAxis : query.getAxes()) {
axesMetaData.add(
new MondrianOlap4jCellSetAxisMetaData(
this, queryAxis));
}
filterAxisMetaData =
new MondrianOlap4jCellSetAxisMetaData(
this, query.getSlicerAxis());
}
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:17,代码来源:MondrianOlap4jCellSetMetaData.java
示例3: JRMondrianResult
import mondrian.olap.Query; //导入依赖的package包/类
public JRMondrianResult(Result result)
{
this.result = result;
JRMondrianFactory factory = new JRMondrianFactory();
Query query = result.getQuery();
Axis[] resultAxes = result.getAxes();
axes = new JRMondrianAxis[resultAxes.length];
for (int i = 0; i < resultAxes.length; i++)
{
AxisOrdinal ordinal = AxisOrdinal.StandardAxisOrdinal.forLogicalOrdinal(i);
axes[i] = new JRMondrianAxis(resultAxes[i], query.getMdxHierarchiesOnAxis(ordinal), factory);
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:16,代码来源:JRMondrianResult.java
示例4: testSlicerAxisDoesNotGetNonEmptyApplied
import mondrian.olap.Query; //导入依赖的package包/类
public void testSlicerAxisDoesNotGetNonEmptyApplied() {
propSaver.set(
MondrianProperties.instance().EnableNonEmptyOnAllAxis, true);
String mdxQuery = "select from [Sales]\n"
+ "where [Time].[1997]\n";
Query query = getConnection().parseQuery(mdxQuery);
TestContext.assertEqualsVerbose(mdxQuery, query.toString());
}
开发者ID:OSBI,项目名称:mondrian,代码行数:9,代码来源:NonEmptyPropertyForAllAxisTest.java
示例5: executeQuery
import mondrian.olap.Query; //导入依赖的package包/类
protected Result executeQuery(String mdx, Connection connection) {
Query query = connection.parseQuery(mdx);
query.setResultStyle(ResultStyle.LIST);
return connection.execute(query);
}
开发者ID:OSBI,项目名称:mondrian,代码行数:6,代码来源:BatchTestCase.java
示例6: parseQuery
import mondrian.olap.Query; //导入依赖的package包/类
protected void parseQuery(Query query)
{
QueryAxis[] axes = query.getAxes();
for (QueryAxis axis : axes)
{
IROlapResultAxis jrAxis = new IROlapResultAxis();
((IROlapResult)xmlaResult).addAxis(jrAxis);
Hierarchy[] hierarchies = query.getMdxHierarchiesOnAxis(axis.getAxisOrdinal());
for (Hierarchy hierarchy : hierarchies)
{
boolean addMeasures = false;
IROlapHierarchy jrHierarchy = new IROlapHierarchy(hierarchy.getName());
if (hierarchy.getName().equals("Measures"))
{
addMeasures = true;
}
jrHierarchy.setHierarchyUniqueName( hierarchy.getUniqueName() );
Level[] levels = hierarchy.getLevels();
for (Level level : levels)
{
IROlapHierarchyLevel jrLevel = new IROlapHierarchyLevel(level.getName(), level.getDepth());
jrHierarchy.addHierarchyLevel(jrLevel);
}
jrAxis.addHierarchy(jrHierarchy);
// Add axis tubles for measures...
if (addMeasures)
{
Set<Member> memberSet = query.getMeasuresMembers();
IROlapMemberTuple tuple = new IROlapMemberTuple();
Iterator iter = memberSet.iterator();
while (iter.hasNext())
{
Member m = (Member)iter.next();
JRXmlaMember member = new JRXmlaMember(m.getName(), m.getUniqueName(), m.getDimension().getName(), m.getLevel().getName(), m.getDepth());
tuple.addMember(member);
}
jrAxis.addTuple(tuple);
}
}
}
}
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:54,代码来源:OLAPQueryExecuter.java
示例7: getQuery
import mondrian.olap.Query; //导入依赖的package包/类
/**
* @return the query
*/
public Query getQuery() {
return query;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:7,代码来源:MondrianHelper.java
示例8: setQuery
import mondrian.olap.Query; //导入依赖的package包/类
/**
* Sets the query. Automatically calls <code>{@link #setDirty}(true)</code>.
*/
public void setQuery(Query query) {
this.query = query;
setDirty();
}
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:8,代码来源:ResultCache.java
示例9: getBaseCubeCollection
import mondrian.olap.Query; //导入依赖的package包/类
Collection<RolapCube> getBaseCubeCollection(final Query query) {
return query.getBaseCubes();
}
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:4,代码来源:HighCardSqlTupleReader.java
示例10: newCellSet
import mondrian.olap.Query; //导入依赖的package包/类
public MondrianOlap4jCellSet newCellSet(
MondrianOlap4jStatement olap4jStatement,
Query query)
{
return new MondrianOlap4jCellSetJdbc4(olap4jStatement, query);
}
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:7,代码来源:FactoryJdbc4Impl.java
示例11: MondrianOlap4jCellSetJdbc4
import mondrian.olap.Query; //导入依赖的package包/类
public MondrianOlap4jCellSetJdbc4(
MondrianOlap4jStatement olap4jStatement,
Query query)
{
super(olap4jStatement, query);
}
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:7,代码来源:FactoryJdbc4Impl.java
示例12: newCellSet
import mondrian.olap.Query; //导入依赖的package包/类
public MondrianOlap4jCellSet newCellSet(
MondrianOlap4jStatement olap4jStatement,
Query query)
{
return new MondrianOlap4jCellSetJdbc3(olap4jStatement, query);
}
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:7,代码来源:FactoryJdbc3Impl.java
示例13: MondrianOlap4jCellSetJdbc3
import mondrian.olap.Query; //导入依赖的package包/类
public MondrianOlap4jCellSetJdbc3(
MondrianOlap4jStatement olap4jStatement, Query query)
{
super(olap4jStatement, query);
}
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:6,代码来源:FactoryJdbc3Impl.java
示例14: executeQuery
import mondrian.olap.Query; //导入依赖的package包/类
Result executeQuery(String mdx, Connection connection) {
Query query = connection.parseQuery(mdx);
return connection.execute(query);
}
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:5,代码来源:DataSourceChangeListenerTest.java
示例15: testCallingLoadColumnsInAddCollapsedColumnOrAddzSpecialCollapsedColumn
import mondrian.olap.Query; //导入依赖的package包/类
public void
testCallingLoadColumnsInAddCollapsedColumnOrAddzSpecialCollapsedColumn()
throws Exception
{
Logger logger = Logger.getLogger(AggGen.class);
StringWriter writer = new StringWriter();
Appender myAppender = new WriterAppender(new SimpleLayout(), writer);
logger.addAppender(myAppender);
logger.setLevel(Level.DEBUG);
final String trueValue = "true";
// This modifies the MondrianProperties for the whole of the
// test run
MondrianProperties props = MondrianProperties.instance();
// If run in Ant and with mondrian.jar, please comment out this line:
props.AggregateRules.setString("DefaultRules.xml");
props.UseAggregates.setString(trueValue);
props.ReadAggregates.setString(trueValue);
props.GenerateAggregateSql.setString(trueValue);
final RolapConnection rolapConn = (RolapConnection) getConnection();
Query query =
rolapConn.parseQuery(
"select {[Measures].[Count]} on columns from [HR]");
rolapConn.execute(query);
logger.removeAppender(myAppender);
final DataSource dataSource = rolapConn.getDataSource();
Connection sqlConnection = null;
try {
sqlConnection = dataSource.getConnection();
DatabaseMetaData dbmeta = sqlConnection.getMetaData();
JdbcSchema jdbcSchema = JdbcSchema.makeDB(dataSource);
final String catalogName = jdbcSchema.getCatalogName();
final String schemaName = jdbcSchema.getSchemaName();
String log = writer.toString();
Pattern p = Pattern.compile(
"DEBUG - Init: Column: [^:]+: `(\\w+)`.`(\\w+)`"
+ Util.nl
+ "WARN - Can not find column: \\2");
Matcher m = p.matcher(log);
while (m.find()) {
ResultSet rs =
dbmeta.getColumns(
catalogName, schemaName, m.group(1), m.group(2));
assertTrue(!rs.next());
}
} finally {
if (sqlConnection != null) {
try {
sqlConnection.close();
} catch (SQLException e) {
// ignore
}
}
}
}
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:63,代码来源:AggGenTest.java
示例16: getQuery
import mondrian.olap.Query; //导入依赖的package包/类
/**
* @return the query
*/
public Query getQuery() {
return query;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:7,代码来源:MondrianHelper.java
示例17: getQuery
import mondrian.olap.Query; //导入依赖的package包/类
/**
* Returns the {@link Query}. If you modify the query, call
* <code>{@link #setDirty}(true)</code>.
*/
public Query getQuery() {
return query;
}
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:8,代码来源:ResultCache.java
示例18: newCellSet
import mondrian.olap.Query; //导入依赖的package包/类
/**
* Creates a cell set.
*
* @param olap4jStatement Statement
* @return Cell set
*/
MondrianOlap4jCellSet newCellSet(
MondrianOlap4jStatement olap4jStatement,
Query query);
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:10,代码来源:Factory.java
示例19: getQuery
import mondrian.olap.Query; //导入依赖的package包/类
Query getQuery();
开发者ID:OSBI,项目名称:mondrian,代码行数:2,代码来源:Statement.java
示例20: setQuery
import mondrian.olap.Query; //导入依赖的package包/类
void setQuery(Query query);
开发者ID:OSBI,项目名称:mondrian,代码行数:2,代码来源:Statement.java
注:本文中的mondrian.olap.Query类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论