org.tentackle.appworx
Class QbfParameter

java.lang.Object
  extended by org.tentackle.appworx.QbfParameter
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DefaultQbfParameter

public class QbfParameter
extends Object
implements Serializable

Query parameters for QbfPlugin.

Author:
harald
See Also:
Serialized Form

Field Summary
 boolean checkReadPermission
          display only objects with granted read permission
 Class<? extends AppDbObject> clazz
          The object's class.
 ContextDb contextDb
          database context
 int estimatedRowCount
          Optional estimated number of rows if withEstimatedRowCount was true.
 int fetchSize
          The fetchsize for the query.
If maxRowCount is set the fetchSize should be set to a reasonable value too, because some JDBC-drivers interpret a fetchsize of 0 to retrieve all data in one bulk.
 int limit
          max.
 int maxRowCount
          maximum number of rows displayable, 0 = unlimited (default)
 int offset
          number of rows to skip, 0 = default
 String pattern
          searchpattern
 boolean qbfPanelInvisible
          QbfPanel should not be visible (requires searchImmediate = true)
 boolean rebuildView
          view should be rebuilt for each new display of search results
 boolean searchImmediate
          start search without querying the parameters
 boolean searchInExtraThread
          run the search in an extra thread (not the GUI-thread, i.e.
 boolean showDialogIfSearchImmediateFailes
          show dialog if searchImmediate failes
 boolean showTable
          initially show table-view instead of tree-view
 String tableName
          != null if use non-default formTableName for preferences
 int warnRowCount
          number of rows displayable without warning, 0 = unlimited (default)
 long warnSleep
          time [ms] to sleep between warnRowCount packets, 0 = no sleep (default)
 boolean withEstimatedRowCount
          Flag to retrieve the estimated number of rows in a separate SELECT COUNT(*)-query.
 
Constructor Summary
QbfParameter(Class<? extends AppDbObject> clazz, ContextDb contextDb)
          Creates a QbfParameter.
 
Method Summary
 void clear()
          Clears the parameter (user's input).
 boolean isEmpty()
          Check if QBF-parameter is completely empty, i.e.
 boolean isValid()
          Checks whether the parameter is valid for a query.
 String patternAsLikeSql()
          Gets the pattern as an "sql-LIKE"-string.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

clazz

public transient Class<? extends AppDbObject> clazz
The object's class. null means "all classes".

See Also:
AppDbObject.setClassPath(java.lang.String[])

contextDb

public ContextDb contextDb
database context


checkReadPermission

public transient boolean checkReadPermission
display only objects with granted read permission


pattern

public String pattern
searchpattern


offset

public int offset
number of rows to skip, 0 = default


limit

public int limit
max. number of rows to retrieve, 0 = unlimited (default)


withEstimatedRowCount

public boolean withEstimatedRowCount
Flag to retrieve the estimated number of rows in a separate SELECT COUNT(*)-query. The flag is cleared after the query and the row count is stored in estimatedRowCount. Useful in conjunction with offset/limit.


estimatedRowCount

public transient int estimatedRowCount
Optional estimated number of rows if withEstimatedRowCount was true.


fetchSize

public int fetchSize
The fetchsize for the query.
If maxRowCount is set the fetchSize should be set to a reasonable value too, because some JDBC-drivers interpret a fetchsize of 0 to retrieve all data in one bulk. As a rule of thumb set fetchSize = maxRowCount / 2. fetchSize will be passed to the remote server! It's not transient!


searchImmediate

public transient boolean searchImmediate
start search without querying the parameters


showDialogIfSearchImmediateFailes

public transient boolean showDialogIfSearchImmediateFailes
show dialog if searchImmediate failes


qbfPanelInvisible

public transient boolean qbfPanelInvisible
QbfPanel should not be visible (requires searchImmediate = true)


searchInExtraThread

public transient boolean searchInExtraThread
run the search in an extra thread (not the GUI-thread, i.e. modificationThread)


showTable

public transient boolean showTable
initially show table-view instead of tree-view


rebuildView

public transient boolean rebuildView
view should be rebuilt for each new display of search results


tableName

public transient String tableName
!= null if use non-default formTableName for preferences


warnRowCount

public transient int warnRowCount
number of rows displayable without warning, 0 = unlimited (default)


maxRowCount

public transient int maxRowCount
maximum number of rows displayable, 0 = unlimited (default)


warnSleep

public transient long warnSleep
time [ms] to sleep between warnRowCount packets, 0 = no sleep (default)

Constructor Detail

QbfParameter

public QbfParameter(Class<? extends AppDbObject> clazz,
                    ContextDb contextDb)
Creates a QbfParameter.

Parameters:
clazz - the data object class
contextDb - the database context
Method Detail

isEmpty

public boolean isEmpty()
Check if QBF-parameter is completely empty, i.e. leads to a selectAll...

Returns:
true if parameter is empty

isValid

public boolean isValid()
Checks whether the parameter is valid for a query. The default implementation returns tr

Returns:
if ok for query

clear

public void clear()
Clears the parameter (user's input).


toString

public String toString()
Description copied from class: java.lang.Object
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Overrides:
toString in class Object
Returns:
a string representation of the object.

patternAsLikeSql

public String patternAsLikeSql()
Gets the pattern as an "sql-LIKE"-string.

Returns:
the SQL-like string


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de