summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlzhang2012-02-01 03:32:26 (EST)
committer mwu2012-02-01 03:32:26 (EST)
commit22f60dcc378bfe64c19594d637c672a267427edc (patch)
tree48145bbbd5813f9944e2d50e267c561709f2aa5c
parentec1f0be2f15bdc2fb9024f6392558239adafc47a (diff)
downloadorg.eclipse.birt-22f60dcc378bfe64c19594d637c672a267427edc.zip
org.eclipse.birt-22f60dcc378bfe64c19594d637c672a267427edc.tar.gz
org.eclipse.birt-22f60dcc378bfe64c19594d637c672a267427edc.tar.bz2
Checkin: [BZ]Fetch method of Scripted dataset is not called each time a
chart is using it [46404]
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/querydefn/BaseDataSetDesign.java11
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/EngineExecutionHints.java18
-rw-r--r--data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/impl/ModelAdapter.java4
3 files changed, 29 insertions, 4 deletions
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/querydefn/BaseDataSetDesign.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/querydefn/BaseDataSetDesign.java
index 41b4149..fc653cf 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/querydefn/BaseDataSetDesign.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/querydefn/BaseDataSetDesign.java
@@ -64,6 +64,7 @@ public class BaseDataSetDesign implements IBaseDataSetDesign
private ULocale uLocale;
private List<ISortDefinition> sortHints = null;
+ private boolean needCache = true;
/**
* Instantiates a data set with given name.
@@ -435,4 +436,14 @@ public class BaseDataSetDesign implements IBaseDataSetDesign
{
this.nullOrdering = nullOrdering;
}
+
+ public boolean needCache()
+ {
+ return this.needCache;
+ }
+
+ public void setNeedCache( boolean needCache )
+ {
+ this.needCache = needCache;
+ }
}
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/EngineExecutionHints.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/EngineExecutionHints.java
index 513a726..96d4ffc 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/EngineExecutionHints.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/EngineExecutionHints.java
@@ -22,6 +22,7 @@ import org.eclipse.birt.data.engine.api.ICacheable;
import org.eclipse.birt.data.engine.api.IDataQueryDefinition;
import org.eclipse.birt.data.engine.api.IJointDataSetDesign;
import org.eclipse.birt.data.engine.api.IQueryDefinition;
+import org.eclipse.birt.data.engine.api.querydefn.BaseDataSetDesign;
import org.eclipse.birt.data.engine.core.DataException;
/**
@@ -65,16 +66,27 @@ public class EngineExecutionHints implements IEngineExecutionHints
if( dataSetName != null )
{
IBaseDataSetDesign design = dataEngine.getDataSetDesign( dataSetName );
+
if( design instanceof ICacheable )
this.populateDataSetNames( dataEngine.getDataSetDesign( dataSetName ), dataEngine, temp2 );
+
if( qd.getParentQuery() != null && qd.getInputParamBindings().size() == 0 )
{
- for( int i = 0; i < temp2.size( ); i++ )
+ for ( int i = 0; i < temp2.size( ); i++ )
{
- this.cachedDataSetNames.add( temp2.get( i ) );
+ if ( ( (BaseDataSetDesign) dataEngine.getDataSetDesign( temp2.get( i )
+ .toString( ) ) ).needCache( ) )
+ this.cachedDataSetNames.add( temp2.get( i ) );
+ }
+ }
+ for( int i =0;i<temp2.size( );i++)
+ {
+ if ( ( (BaseDataSetDesign) dataEngine.getDataSetDesign( temp2.get( i )
+ .toString( ) ) ).needCache( ) )
+ {
+ temp.add( temp2.get( i ) );
}
}
- temp.addAll( temp2 );
}
}
temp2.clear( );
diff --git a/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/impl/ModelAdapter.java b/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/impl/ModelAdapter.java
index aa8d6eb..a40bdbe 100644
--- a/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/impl/ModelAdapter.java
+++ b/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/impl/ModelAdapter.java
@@ -163,6 +163,7 @@ public class ModelAdapter implements IModelAdapter
design.setDataSetACL( this.adaptExpression( (Expression) handle.getACLExpression( ).getValue( ) ) );
if( handle.getRowACLExpression( )!= null )
design.setRowACL( this.adaptExpression( (Expression) handle.getRowACLExpression( ).getValue( ) ) );
+
Iterator columnHintIterator = handle.columnHintsIterator( );
while( columnHintIterator.hasNext( ))
{
@@ -175,7 +176,8 @@ public class ModelAdapter implements IModelAdapter
if( design!= null )
{
design.setCompareLocale( handle.getLocale( ) );
- design.setNullsOrdering( handle.getNullsOrdering( ) );
+ design.setNullsOrdering( handle.getNullsOrdering( ) );
+ design.setNeedCache( handle.needsCache( ) );
}
logger.fine( "handle type: " + ( handle == null ? "" : handle.getClass( ).getName( ) ) ); //$NON-NLS-1$
return design;