Ontimize 5.2072EN

com.ontimize.report.engine.dynamicjasper
Class EntityDataSource

java.lang.Object
  extended bycom.ontimize.report.engine.dynamicjasper.EntityDataSource

public class EntityDataSource
extends java.lang.Object

Wrappers a Ontimize Entity into a Jasper data source to allow allow fill reports without data transformation.

This data source can rewinds the internal index and return to first element.

Since:
07/11/2008
Author:
Imatia Innovation S.L.
See Also:
JRDataSource, JRRewindableDataSource, JasperFillManager#fillReport(JasperReport, String, Map, JRDataSource)

Field Summary
protected  Entity entity
           
protected  java.lang.String[] keys
           
protected  java.util.Hashtable keysValues
           
protected  EntityResult result
           
protected  int sessionId
           
 
Constructor Summary
EntityDataSource(int sessionId, Entity entity)
           
 
Method Summary
protected  EntityResult doQuery()
           
 java.lang.Object getFieldValue(JRField field)
           
 void moveFirst()
           
 boolean next()
           
 void setKeys(java.lang.String[] keys)
          Set entity keys list.
 void setKeysValues(java.util.Map kv)
          Set the filter keys values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sessionId

protected int sessionId

entity

protected Entity entity

keys

protected java.lang.String[] keys

keysValues

protected java.util.Hashtable keysValues

result

protected EntityResult result
Constructor Detail

EntityDataSource

public EntityDataSource(int sessionId,
                        Entity entity)
Method Detail

getFieldValue

public java.lang.Object getFieldValue(JRField field)
                               throws JRException
Throws:
JRException

next

public boolean next()
             throws JRException
Throws:
JRException

moveFirst

public void moveFirst()

setKeys

public void setKeys(java.lang.String[] keys)

Set entity keys list.

Parameters:
keys - Entity keys list

setKeysValues

public void setKeysValues(java.util.Map kv)
Set the filter keys values.
  • If keys attribute is null, the query is filter by all keys.
  • If keys attribute is not null, only given keys are choosed.

    Parameters:
    kv - Keys values

  • doQuery

    protected EntityResult doQuery()
                            throws JRException
    Throws:
    JRException

    Ontimize