ViewDefImpl is the meta-object for View Object instances. It
describes the View Object's structure.

A View Def can be created either through XML loading or programmatically.
For the former, the client is expected to generate the XML file from
design-time and make the file accessible from the classpath.
When the client asks MetaObjectManager for the View Def, it finds
the XML file, opens it, parses it, and builds a View Def from it.

When creating a View Def programmatically, the client is expected
to start with

ViewDefImpl viewDef = new ViewDefImpl("MyViewDef");

where "MyViewDef" is the name by which the View Def will identified
by MetaObjectManager. This is the name that the client should pass
when an API requires a View Def name, e.g., the defName
parameter to
ApplicationModule.createViewObject(String, String).

After instantiating the View Def, the client adds entity
usages, attributes, etc. Then, he must resolve the definition
object through resolveDefObject() and
regsiter it with MetaObjectManager through
RowDef.registerDefObject(). For a View Def
created from an XML file, the client does not need to call
these methods, as the framework calls them itself.

getQuery

setQuery

public void setQuery(java.lang.String query)

Sets the string for a user-defined query.
Note that the flag isFullSql is set to true
if this call is used to set a non-null value.
If the parameter is null, then the isFullSql flag is set
to false, so that the component parts of the SQL can be set
with the setSelectClause(), setFromClause(), and setWhereClause()
methods.

Parameters:

query - The sql statement of the query.

setQueryHint

public void setQueryHint(java.lang.String queryHint)

getQueryHint

public java.lang.String getQueryHint()

setRowMatch

public void setRowMatch(java.lang.String rowMatch)

getRowMatch

public java.lang.String getRowMatch()

findStructureDefByName

public StructureDeffindStructureDefByName(java.lang.String structDefFullName)

getWhereClauseFlags

setWhereClauseFlags

getSelectClause

setSelectClause

public void setSelectClause(java.lang.String selectClause)

Parameters:

selectClause - The SELECT list

getFromClause

public java.lang.String getFromClause()

Returns the from clause associated with this View Definition.
If the clause is configured to be generated at runtime, it
is constructed based on the entity references.
See setFromClauseFlags(int).
Use the
getFromClause(SQLBuilder)
API if a SQLBuilder is available for the
Database platform that you are working against.

setOrderByClause

buildDefaultFrom

public java.lang.String buildDefaultFrom()

Generates a "from" clause based on the entity references
in this View Definition. Use the
buildDefaultFrom(SQLBuilder)
API if a SQLBuilder is available for the
Database platform that you are working against.

getFetchMode

Get the fetch mode for rows from the query.
The value returned will be FETCH_AS_NEEDED or FETCH_ALL.

Returns:

FETCH_AS_NEEDED or FETCH_ALL.

setFetchMode

public void setFetchMode(byte fetchMode)

Set the fetch mode for rows from the query.
The valid modes are FETCH_AS_NEEDED an FETCH_ALL, or FETCH_DEFAULT.
FETCH_AS_NEEDED will only fetch the number of rows requested
whilst FETCH_ALL will pull all of the rows from the database
and close out the cursor.
FETCH_DEFAULT means this view object will use the system-level default.

Parameters:

fetchMode - is FETCH_AS_NEEDED, FETCH_ALL or FETCH_DEFAULT.

getFetchSize

public short getFetchSize()

Get the size of the fetch.

Returns:

the size, in rows, of the chunk to fetch.

setFetchSize

public void setFetchSize(short size)

Set the size of the fetch.
ViewRowSets of the query are returned in chunks. This method permits the
setting of the size of these chunks.

Parameters:

size - the size, in rows, of the chunk to fetch.

getMaxFetchSize

public int getMaxFetchSize()

setMaxFetchSize

public void setMaxFetchSize(int size)

Set the maximum number of rows to fetch during query processing.
When the maximum number of rows has been fetched, the query is
closed and no more rows are returned.
Setting a value of 0 means that there is no maximum to the number of
rows fetched.

Parameters:

size - the number of rows.

isUseGlueCode

public boolean isUseGlueCode()

setUseGlueCode

public void setUseGlueCode(boolean b)

setMaxRowsPerNode

public void setMaxRowsPerNode(int maxRowsPerNode)

getMaxRowsPerNode

public int getMaxRowsPerNode()

setMaxActiveNodes

public void setMaxActiveNodes(int maxActiveNodes)

getMaxActiveNodes

public int getMaxActiveNodes()

getRangeSize

public int getRangeSize()

setRangeSize

public void setRangeSize(int r)

getAccessMode

public byte getAccessMode()

Get the access mode for rows from the query.
The value returned will be:
RowSet.SCROLLABLE, RowSet.FORWARD_ONLY, RowSet.RANGE_PAGING,
RowSet.RANGE_PAGING_AUTO_POST, or RowSet.RANGE_PAGING_INCR.

addEntityAttribute

Adds the named attribute to the view definition.
This attribute is mapped to an attribute in the entity reference, i.e.,
the attribute must exist in the underlying entity definition.

If isPersistent is true, the view object is
to draw the data from its query statement. The underlying entity
attribute may or may not be persistent. In this case, the
attribute must have a valid database table column or expression
in the view object's query statement. If there is a mismatch
between the query statement and the VO attribute definition list,
you may see AttributeLoadException or
DataCreationException.

If the view attribute is marked not persistent and if the underlying
entity attribute is transient, the view attribute will be of the
ATTR_ENTITY_DERIVED kind.

getXMLRowElementTag

getXMLElementTag

Returns a piece of static info for the type of object this is invoked
upon. Examples are PreparedStatements for insert, update, delete,
and String containing a base the select statement for retrieving
instances of this type through the SQLInputStream