com.businessobjects.rebean.wi
Class SamplingMode

java.lang.Object
  extended by com.businessobjects.rebean.wi.SamplingMode
All Implemented Interfaces:
java.io.Serializable

public final class SamplingMode
extends java.lang.Object
implements java.io.Serializable

Warning: This class is no longer functional from the SAP BusinessObjects 4.0 release onwards.

The SamplingMode class defines all the methods used by data base sampling

Example:Applying database sampling to a query.

        String universeId =((IUniverse)ceInfoobject).buildUniverseIdString();
        DocumentInstance doc = repEng.newDocument(universeId);
        ReportContainer report = doc.createReport("Report1");
        DataProviders dps = doc.getDataProviders();
        // Retrieve the 1st data provider
        SQLDataProvider dp = (SQLDataProvider)dps.getItem(0);
        dp.setSamplingMode(SamplingMode.REPEATABLE_RANDOM);
        dp.setSamplingSize(10);
        // Retrieve the universe objects
        DataSource ds = dp.getDataSource();
        DataSourceObject country = ds.getClasses().getChildByName("Country");
        DataSourceObject service = ds.getClasses().getChildByName("Service");
        Query q = dp.getQuery();
        // Add result objects to the query
        q.addResultObject(country);
        q.addResultObject(service);
        // Run the query and fetch the data
        dp.runQuery();
 
SQLDataProvider.setSamplingMode(SamplingMode).

Since:
12.0
See Also:
Serialized Form

Field Summary
static int _FREE_RANDOM
          int value of FREE_RANDOM.
static int _NONE
          int value of NONE.
static int _REPEATABLE_RANDOM
          int value of REPEATABLE_RANDOM.
static SamplingMode FREE_RANDOM
          Free random mode managed by DataBase.
static SamplingMode NONE
          No database sampling.
static SamplingMode REPEATABLE_RANDOM
          Repeatable random mode managed by DataBase.
 
Method Summary
static SamplingMode fromInt(int value)
          Returns a SamplingMode instance corresponding to value, or null when value does not correspond to any SamplingMode
 java.lang.String toString()
          Return a String representation of this max rows fetch mode (for debug purposes).
 int value()
          Returns the int value of this fetch mode.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_NONE

public static final int _NONE
int value of NONE.

See Also:
Constant Field Values

_FREE_RANDOM

public static final int _FREE_RANDOM
int value of FREE_RANDOM.

See Also:
Constant Field Values

_REPEATABLE_RANDOM

public static final int _REPEATABLE_RANDOM
int value of REPEATABLE_RANDOM.

See Also:
Constant Field Values

NONE

public static final SamplingMode NONE
No database sampling.


FREE_RANDOM

public static final SamplingMode FREE_RANDOM
Free random mode managed by DataBase. In this mode, fetched rows could be different during different iterations without changing SQL.


REPEATABLE_RANDOM

public static final SamplingMode REPEATABLE_RANDOM
Repeatable random mode managed by DataBase. In this mode, we get always the same fetched rows (if data in database isn't changed between two iterations).

Method Detail

fromInt

public static SamplingMode fromInt(int value)
Returns a SamplingMode instance corresponding to value, or null when value does not correspond to any SamplingMode

Parameters:
value -
Returns:
a SamplingMode instance

value

public int value()
Returns the int value of this fetch mode.

Returns:
the int value of this fetch mode.

toString

public java.lang.String toString()
Return a String representation of this max rows fetch mode (for debug purposes).

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this max rows fetch mode (for debug purposes).