public interface IDfCollection extends IDfTypedObject
Modifier and Type | Field and Description |
---|---|
static int |
DF_CLOSED_STATE
Indicates a collection is closed.
|
static int |
DF_INITIAL_STATE
Indicates a new collection waiting for the first next() call.
|
static int |
DF_NO_MORE_ROWS_STATE
Indicates the collection has no more rows.
|
static int |
DF_READY_STATE
Indicates a collection is positioned on a row ready for reading.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes a collection object.
|
java.io.ByteArrayInputStream |
getBytesBuffer(java.lang.String cmd,
java.lang.String buf,
java.lang.String buflen,
int length)
Reserved for internal use.
|
int |
getState()
Returns the state of a collection object.
|
int |
getStateEx()
Returns the state of a collection object.
|
IDfTypedObject |
getTypedObject()
Returns a row in the collection as an
IDfTypedObject for later use. |
boolean |
next()
Gets the next row in a collection.
|
appendBoolean, appendDouble, appendId, appendInt, appendString, appendTime, appendValue, dump, enumAttrs, findAttrIndex, findBoolean, findDouble, findId, findInt, findString, findTime, findValue, getAllRepeatingStrings, getAttr, getAttrCount, getAttrDataType, getBoolean, getDouble, getId, getInt, getLong, getObjectId, getObjectSession, getOriginalSession, getRepeatingBoolean, getRepeatingDouble, getRepeatingId, getRepeatingInt, getRepeatingLong, getRepeatingString, getRepeatingTime, getRepeatingValue, getSession, getSessionManager, getString, getTime, getValue, getValueAt, getValueCount, hasAttr, insertBoolean, insertDouble, insertId, insertInt, insertString, insertTime, insertValue, isAttrRepeating, isNull, remove, removeAll, setBoolean, setDouble, setId, setInt, setNull, setRepeatingBoolean, setRepeatingDouble, setRepeatingId, setRepeatingInt, setRepeatingString, setRepeatingTime, setRepeatingValue, setSessionManager, setString, setTime, setValue, truncate
static final int DF_INITIAL_STATE
static final int DF_READY_STATE
static final int DF_CLOSED_STATE
static final int DF_NO_MORE_ROWS_STATE
boolean next() throws DfException
next
method once for each row that you want to retrieve in a collection object.
Refer to the DocumentumTM Server Fundamentals for more information about
processing queries.
The following code example demonstrates how to obtain an IDfQuery interface, set a DQL query to the object,
execute the query, then process the results:
IDfCollection col = null; IDfQuery q = null; IDfId idObj = null; String strVal = ""; int intVal = 0; try { q = new DfQuery(); q.setDQL("select object_name, i_contents_id, r_page_cnt from dm_document where object_name like 'My Name%"); col = q.execute(sess, IDfQuery.READ_QUERY); while (col.next()) { strVal = col.getString("object_name"); idObj = col.getId("i_contents_id"); intVal = col.getInt("r_page_cnt"); // Process info... } } catch(DfException ex) { // Error handling routine... }
true
if there is another row in the collection; false
if there are no more rows
in the collection.DfException
- if a server error occurs.IDfTypedObject getTypedObject() throws DfException
IDfTypedObject
for later use.
Once you make a next
call, the collection is advanced to the next row of data and there is no
mechanism for going back to a previous row. If you need to retain a row for later use, call this method.
The following code example demonstrates how to obtain an IDfQuery interface, set a DQL query to the object,
execute the query, then save each row in a vector as an IDfTypedObject interface:
DfQuery q = new DfQuery(); q.setDQL("select r_object_id, object_name, r_modify_date from dm_document where object_name like 'My Name%"); // Assume that m_myRows is declared as a member variable of type vector m_myRows = new Vector(); try { IDfCollection col = q.execute(session, IDfQuery.READ_QUERY); while(col.next()) { m_myRows.addElement(col.getTypedObject()); } } catch(DfException dfc) { // Error handling code } ... // Elsewhere in your code try { int cnt = n_myRows.size(); for (inti=0; i < cnt; i++) { IDfTypedObject row = (IDfTypedObject) m_myRows.elementAt(i); IDfId id = row.getId("r_object_id"); String name = row.getString("object_name"); IDfTime time = row.getTime("r_modify_date"); // Etc., etc... } } catch(DfException dfc); { // Error handling code }
DfException
- if a server error occurs.void close() throws DfException
"Failed to close
collection identifier (QID=collection ID)
" IDfQuery q = new DfQuery(); q.setDQL("select * from dm_document"); IDfCollection col = q.execute(sess, DfQuery.DF_READ_QUERY); col.close();
DfException
- if a server error occurs.next()
,
IDfQuery.setDQL(java.lang.String)
,
IDfQuery.execute(com.documentum.fc.client.IDfSession, int)
int getState()
Integer Collection State Defined Static Variable 1 Ready IDfCollection.DF_READY_STATE 2 Closed IDfCollection.DF_CLOSED_STATE 3 No More Rows IDfCollection.DF_NO_MORE_ROWS_STATE
DF_READY_STATE
,
DF_CLOSED_STATE
,
DF_NO_MORE_ROWS_STATE
int getStateEx()
Integer Collection State Defined Static Variable 0 Initial IDfCollection.DF_INITIAL_STATE 1 Ready IDfCollection.DF_READY_STATE 2 Closed IDfCollection.DF_CLOSED_STATE 3 No More Rows IDfCollection.DF_NO_MORE_ROWS_STATE
DF_INITIAL_STATE
,
DF_READY_STATE
,
DF_CLOSED_STATE
,
DF_NO_MORE_ROWS_STATE
java.io.ByteArrayInputStream getBytesBuffer(java.lang.String cmd, java.lang.String buf, java.lang.String buflen, int length) throws DfException
cmd
- the server API that returned the collection objectbuf
- the name of the server API's attribute that points to the contents stored in memorybuflen
- the name of the server API's attribute that specifies the size, in bytes, of the contents stored in
memoryDfException
- if a server error occursCopyright 1994-2023 OpenText Corporation. All rights reserved.