ThinkUI Data Generator 1.0.2 API

thinkui.datagen.io
Class DefaultDataObjectReader

java.lang.Object
  extended bythinkui.db.io.AbstractDataObjectReader
      extended bythinkui.datagen.io.DefaultDataObjectReader
All Implemented Interfaces:
DataObjectReader

public class DefaultDataObjectReader
extends AbstractDataObjectReader

Extends AbstractDataObjectReader to implement a DataObjectWriter for writing the generated data to the database.


Constructor Summary
DefaultDataObjectReader()
          DefaultDataObjectReader constructor.
 
Method Summary
 void close()
          Closes the reader.
 int getCount()
           
 thinkui.db.jdbc.JDBCDataObjectManager getDataObjectManager()
           
 int getMaxObjectCount()
           
 java.lang.String getSQLQuery()
           
 void init()
          Initializes the reader.
 int readAll(java.util.EventListener eventHandler)
          Read all the data objects and notify the given event handler.
 void setDataObjectManager(thinkui.db.jdbc.JDBCDataObjectManager dataObjectManager)
          Sets the data object manager to use to write the data objects.
 void setMaxObjectCount(int maxObjectCount)
          Sets the maximum object count or use -1 to indicate no limit.
 void setSQLQuery(java.lang.String sqlQuery)
          Sets the SQL query.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDataObjectReader

public DefaultDataObjectReader()
DefaultDataObjectReader constructor.

Method Detail

close

public void close()
           throws java.lang.Exception
Closes the reader.

Specified by:
close in interface DataObjectReader
Overrides:
close in class AbstractDataObjectReader
Throws:
java.lang.Exception

getCount

public final int getCount()
Returns:
the number of objects that has been read.

getDataObjectManager

public final thinkui.db.jdbc.JDBCDataObjectManager getDataObjectManager()
Returns:
the data object manager to use to write the data objects.

getMaxObjectCount

public final int getMaxObjectCount()
Returns:
the maximum object count or -1 (for no limit).

getSQLQuery

public final java.lang.String getSQLQuery()
Returns:
the SQL query or null.

init

public void init()
          throws java.lang.Exception
Initializes the reader.

Specified by:
init in interface DataObjectReader
Overrides:
init in class AbstractDataObjectReader
Throws:
java.lang.Exception

readAll

public int readAll(java.util.EventListener eventHandler)
            throws java.lang.Exception
Read all the data objects and notify the given event handler. This method should be use to ensure more efficient bulk processing.

Returns:
the number of objects that were read.
Throws:
java.lang.Exception

setDataObjectManager

public final void setDataObjectManager(thinkui.db.jdbc.JDBCDataObjectManager dataObjectManager)
Sets the data object manager to use to write the data objects.


setMaxObjectCount

public final void setMaxObjectCount(int maxObjectCount)
Sets the maximum object count or use -1 to indicate no limit. It is important to set a limit if there are a large number of records source data set since all the data will be loaded into memory.


setSQLQuery

public final void setSQLQuery(java.lang.String sqlQuery)
Sets the SQL query.


ThinkUI Data Generator 1.0.2 API

Copyright © 2007-2009. ThinkUI Software Inc. All rights reserved.