| 
 | WebObjects 5.2.3 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.webobjects.eoaccess.EOAdaptorChannel
com.webobjects.jndiadaptor.JNDIChannel
The JNDIChannel class represents a communication channel to a
 Java Naming and Directory Interface service.
| Nested Class Summary | 
| Nested classes inherited from class com.webobjects.eoaccess.EOAdaptorChannel | 
| EOAdaptorChannel.Delegate | 
| Field Summary | 
| Fields inherited from class com.webobjects.eoaccess.EOAdaptorChannel | 
| AdaptorFailureKey, AdaptorOperationsKey, AdaptorOptimisticLockingFailure, FailedAdaptorOperationKey | 
| Constructor Summary | |
| JNDIChannel(JNDIContext context)Creates a new instance of JNDIChannel. | |
| Method Summary | |
|  NSArray | attributesToFetch()An abstract method that should be implemented by subclasses to return the set of attributes to retrieve when fetchRowis next invoked. | 
|  void | cancelFetch()An abstract method that should be implemented by subclasses to clear all result sets established by the last selectAttributes,executeStoredProcedure,
 orevaluateExpressionmessage and terminate the current
 fetch, so thatisFetchInProgressreturnsfalse. | 
|  void | closeChannel()An abstract method that should be implemented by subclasses to close the EOAdaptorChannel so that it can't perform operations with the server. | 
|  int | deleteRowsDescribedByQualifier(EOQualifier qualifier,
                               EOEntity entity)An abstract method that should be implemented by subclasses to delete the rows described by qualifierfrom the
 database table corresponding toentity. | 
|  EOModel | describeModelWithTableNames(NSArray tableNames)The default implementation of this method returns null. | 
|  NSArray | describeResults()An abstract method that should be implemented by subclasses to return an array of EOAttributes describing the properties available in the current result set, as determined by selectAttributes,executeStoredProcedure, or a statement evaluated byevaluateExpression. | 
|  NSArray | describeTableNames()The default implementation of this method returns an empty array. | 
|  void | evaluateExpression(EOSQLExpression expression)An abstract method that should be implemented by subclasses to send expressionto the database server for evaluation, beginning a transaction
 first and committing it after evaluation if a transaction isn't already
 in progress. | 
|  void | executeStoredProcedure(EOStoredProcedure storedProcedure,
                       NSDictionary values)An abstract method that should be implemented by subclasses to execute storedProcedure. | 
|  NSMutableDictionary | fetchRow()An abstract method that should be implemented by subclasses to fetch the next row from the result set of the last selectAttributes,executeStoredProcedure, orevaluateExpressionmessage sent to the receiver. | 
|  void | insertRow(NSDictionary row,
          EOEntity entity)An abstract method that should be implemented by subclasses to insert the values of rowinto the table in the 
 database that corresponds toentity. | 
|  boolean | isFetchInProgress()An abstract method that should be implemented by subclasses to return trueif the receiver is fetching,falseotherwise. | 
|  boolean | isOpen()An abstract method that should be implemented by subclasses to return trueif the channel has been opened withopenChannel,falseif not. | 
|  void | openChannel()An abstract method that should be implemented by subclasses to put the channel, and both its context and adaptor, into a state where they are ready to perform database operations. | 
|  NSArray | primaryKeysForNewRowsWithEntity(int count,
                                EOEntity entity)Returns an NSArray of primary key dictionaries for the number of new rows specified by countin the database table that corresponds toentity. | 
|  NSDictionary | returnValuesForLastStoredProcedureInvocation()An abstract method that should be implemented by subclasses to return values from the execution of a stored procedure. | 
|  void | selectAttributes(NSArray attributes,
                 EOFetchSpecification fetchSpecification,
                 boolean isLocking,
                 EOEntity entity)An abstract method that should be implemented by subclasses to select attributes in rows matching the qualifier in fetchSpecificationand set the receiver's attributes 
 to fetch. | 
|  void | setAttributesToFetch(NSArray attributes)An abstract method that should be implemented by subclasses to specify the set of attributesused to
 describe fetch data from a corresponding select. | 
|  int | updateValuesInRowsDescribedByQualifier(NSDictionary row,
                                       EOQualifier qualifier,
                                       EOEntity entity)An abstract method that should be implemented by subclasses to update the rows described by qualifierwith the values
 inrow. | 
| Methods inherited from class com.webobjects.eoaccess.EOAdaptorChannel | 
| adaptorContext, addStoredProceduresNamed, delegate, deleteRowDescribedByQualifier, describeStoredProcedureNames, dictionaryWithObjectsForAttributes, lockRowComparingAttributes, performAdaptorOperation, performAdaptorOperations, primaryKeyForNewRowWithEntity, setDelegate, updateValuesInRowDescribedByQualifier | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public JNDIChannel(JNDIContext context)
JNDIChannel.
context - - the contextEOAdaptorChannel.EOAdaptorChannel(EOAdaptorContext)| Method Detail | 
public NSArray attributesToFetch()
EOAdaptorChannelfetchRow is next invoked.
attributesToFetch in class EOAdaptorChannelEOAdaptorChannel.fetchRow()public void cancelFetch()
EOAdaptorChannelselectAttributes, executeStoredProcedure,
 or evaluateExpression message and terminate the current
 fetch, so that isFetchInProgress returns false.
cancelFetch in class EOAdaptorChannelEOAdaptorChannel.selectAttributes(NSArray attributes, EOFetchSpecification
         fetchSpecification, boolean flag, EOEntity entity), 
EOAdaptorChannel.executeStoredProcedure(EOStoredProcedure storedProcedure,
         NSDictionary values), 
EOAdaptorChannel.evaluateExpression(EOSQLExpression expression), 
EOAdaptorChannel.isFetchInProgress()public void closeChannel()
EOAdaptorChannelIf the receiver is the last open channel in an adaptor context and if the channel's adaptor context has outstanding transactions, closing the channel has server-dependent results: some database servers roll back all outstanding transactions but others do nothing. Regardless of whether outstanding transactions are rolled back, this method has the side effect of closing the receiver's adaptor context's connection with the database if the receiver is its adaptor context's last open channel.
closeChannel in class EOAdaptorChannelEOAdaptorChannel.cancelFetch(), 
EOAdaptorContext.hasOpenTransaction()
public int deleteRowsDescribedByQualifier(EOQualifier qualifier,
                                          EOEntity entity)
EOAdaptorChannelqualifier from the
 database table corresponding to entity. Should return
 the number of rows deleted. Should throw a runtime exception on
 failure. Some possible reasons for failure are:
 
deleteRowsDescribedByQualifier in class EOAdaptorChannelqualifier - Describes the row(s) to delete.entity - The entity corresponding to the row(s) to delete.
EOAdaptorChannel.deleteRowDescribedByQualifier(EOQualifier qualifier, EOEntity entity), 
EOAdaptorChannel.isFetchInProgress(), 
EOAdaptorContext.hasOpenTransaction(), 
EOEntity, 
EOQualifierpublic EOModel describeModelWithTableNames(NSArray tableNames)
EOAdaptorChannelnull.  It can be
 overridden by subclasses to create and return a default model
 containing entities for the tables specified in tableNames and
 assign the adaptor name and connection dictionary to the new model.
 This method is typically used in conjunction
 with describeTableNames and describeStoredProcedureNames.
describeModelWithTableNames in class EOAdaptorChanneltableNames - The entity names for database tables.
tableNames.EOAdaptorChannel.describeTableNames(), 
EOAdaptorChannel.describeStoredProcedureNames(), 
EOModelpublic NSArray describeResults()
EOAdaptorChannelselectAttributes,
 executeStoredProcedure, or a statement evaluated by
 evaluateExpression. Only invoke this method if
 a fetch is in progress as determined by isFetchInProgress.
describeResults in class EOAdaptorChannelEOAdaptorChannel.selectAttributes(NSArray attributes,
         EOFetchSpecification fetchSpecification,
         boolean flag, EOEntity entity), 
EOAdaptorChannel.executeStoredProcedure(EOStoredProcedure storedProcedure,
         NSDictionary values), 
EOAdaptorChannel.evaluateExpression(EOSQLExpression expression), 
EOAdaptorChannel.isFetchInProgress(), 
EOAttributepublic NSArray describeTableNames()
EOAdaptorChannelThis method is used in conjunction with describeStoredProcedureNames to build a
 default model in EOModeler. 
describeTableNames in class EOAdaptorChannelEOAdaptorChannel.describeModelWithTableNames(NSArray tableNames)public void evaluateExpression(EOSQLExpression expression)
EOAdaptorChannelexpression to the database server for evaluation, beginning a transaction
 first and committing it after evaluation if a transaction isn't already
 in progress. Should throw a runtime exception if an error occurs. An adaptor channel  
 uses this method to send SQL expressions to the database.
 If expression results in a select operation being performed, you
 can fetch the results as you would if you had invoked selectAttributes.
 You must use the method setAttributesToFetch before you begin fetching.
 If expression evaluates to multiple result sets, you must invoke 
 setAttributesToFetch before you begin fetching each subsequent set.
evaluateExpression invokes the delegate methods
 adaptorChannelShouldEvaluateExpression and
 adaptorChannelDidEvaluateExpression.
The upper layers of the Framework never invoke evaluateExpression
 directly. Thus, in adaptors for data stores that don't naturally support
 an expression language (for example, flat file adaptors), the implementation
 of this method doesn't need to do anything in order for the adaptor to work with the Framework.
evaluateExpression in class EOAdaptorChannelexpression - An expression to be evaluated by the database server.EOAdaptorChannel.fetchRow(), 
EOAdaptorChannel.selectAttributes( NSArray attributes,
                   EOFetchSpecification fetchSpecification,
                   boolean flag, EOEntity entity), 
EOAdaptorChannel.setAttributesToFetch(NSArray attributes), 
EOAdaptorChannel.Delegate.adaptorChannelShouldEvaluateExpression(
                   EOAdaptorChannel channel, EOSQLExpression expression), 
EOAdaptorChannel.Delegate.adaptorChannelDidEvaluateExpression(
                   EOAdaptorChannel channel, EOSQLExpression expression), 
EOSQLExpression
public void executeStoredProcedure(EOStoredProcedure storedProcedure,
                                   NSDictionary values)
EOAdaptorChannelstoredProcedure. Any arguments to the stored procedure are in values,
 a dictionary whose keys are the argument names. You should use
 fetchRow to get result rows and
 returnValuesForLastStoredProcedureInvocation to get
 return arguments and result status, if any.
 Should throw a runtime exception if an error occurs.
 The upper layers of the Framework never invoke executeStoredProcedure
 directly. Thus, in adaptors for data stores that don't naturally support
 stored procedures, the implementation
 of this method doesn't need to do anything in order for the 
 adaptor to work with the Framework.
executeStoredProcedure in class EOAdaptorChannelstoredProcedure - The stored procedure to execute.values - A dictionary whose keys are the argument names
                        and whose values are the argument values to be
                        passed to storedProcedure.EOAdaptorChannel.returnValuesForLastStoredProcedureInvocation(), 
EOAdaptorChannel.fetchRow(), 
(EOStoredProcedure storedProcedure,
                         NSDictionary values), 
EOStoredProcedurepublic NSMutableDictionary fetchRow()
EOAdaptorChannelselectAttributes, 
 executeStoredProcedure, or evaluateExpression message sent to the receiver.
 Should return values for the receiver's attributesToFetch in a dictionary whose keys are
 the attribute names. When there are no more rows in the current result set,
 this method should return null and invoke the delegate method
 adaptorChannelDidChangeResultSet if there are more results sets.
 When there are no more rows or result sets, this method should return
 null, end the fetch, and invoke adaptorChannelDidFinishFetching.
 isFetchInProgress returns true until the fetch is canceled or
 until this method exhausts all result sets and returns null.
adaptorChannelWillFetchRow
 and adaptorChannelDidFetchRow. Should throw a runtime exception if an error occurs.
fetchRow in class EOAdaptorChannelattributesToFetch in a dictionary
         whose keys are the attribute names.EOAdaptorChannel.executeStoredProcedure(EOStoredProcedure storedProcedure,
         NSDictionary values), 
EOAdaptorChannel.selectAttributes(NSArray attributes,
         EOFetchSpecification fetchSpecification,
         boolean flag, EOEntity entity), 
EOAdaptorChannel.evaluateExpression(EOSQLExpression expression), 
EOAdaptorChannel.attributesToFetch(), 
(EOAdaptorChannel channel), 
EOAdaptorChannel.Delegate.adaptorChannelDidFinishFetching(
         EOAdaptorChannel channel), 
EOAdaptorChannel.Delegate.adaptorChannelWillFetchRow(
         EOAdaptorChannel channel), 
EOAdaptorChannel.Delegate.adaptorChannelDidFetchRow(EOAdaptorChannel channel
         , NSMutableDictionary row), 
EOAdaptorChannel.setAttributesToFetch(NSArray attributes)
public void insertRow(NSDictionary row,
                      EOEntity entity)
EOAdaptorChannelrow into the table in the 
 database that corresponds to entity. row 
 is a dictionary whose keys are attribute names and whose
 values are the values to insert. Row keys must refer to attributes 
 that all belong to entity and that are either non-
 flattened or all flattened through the same relationship path.
 Should throw a runtime exception on failure. Some possible reasons 
 for failure are:
 
insertRow in class EOAdaptorChannelrow - An NSDictionary whose keys are attribute names and
               whose values are the values that will be inserted.entity - The entity that corresponds to row.EOEntitypublic boolean isFetchInProgress()
EOAdaptorChanneltrue if the receiver is fetching, false otherwise.
 An adaptor channel is fetching if:
 selectAttributes.executeStoredProcedure.evaluateExpression resulted in
 a select operation being performed. An adaptor channel stops fetching when there are no more records
 to fetch or when cancelFetch is invoked.
isFetchInProgress in class EOAdaptorChanneltrue if the receiver is fetching, else
         false.EOAdaptorChannel.fetchRow(), 
EOAdaptorChannel.evaluateExpression(EOSQLExpression expression), 
EOAdaptorChannel.selectAttributes(NSArray attributes,
         EOFetchSpecification fetchSpecification,
         boolean flag, EOEntity entity), 
EOAdaptorChannel.executeStoredProcedure(EOStoredProcedure storedProcedure,
         NSDictionary values)public boolean isOpen()
EOAdaptorChanneltrue if the channel has been opened with 
 openChannel, false if not.
isOpen in class EOAdaptorChanneltrue if the channel has been 
         opened with  openChannel().EOAdaptorChannel.openChannel(), 
EOAdaptorChannel.closeChannel()public void openChannel()
EOAdaptorChannel
openChannel in class EOAdaptorChannelEOAdaptorChannel.isOpen(), 
EOAdaptorChannel.closeChannel()
public NSArray primaryKeysForNewRowsWithEntity(int count,
                                               EOEntity entity)
EOAdaptorChannelcount in the database table that corresponds to entity.
 The primary keys returned from this method are dictionaries whose keys are the primary key
 attribute names. For example, suppose you've got a table MOVIE with primary key MOVIE_ID,
 and the corresponding Movie entity's primary key attribute is movieID. In this scenario,
 each dictionary in the NSArray returned from this method has one entry whose key is movieID and
 whose value is the unique value to assign. 
If the primary key is compound (made up of more than one attribute), the dictionary should contain an entry for each primary key attribute. Note, however, that the Enterprise Objects Frameworks adaptors don't handle compound primary keys; they return null if the primary key is compound.
primaryKeysForNewRowsWithEntity in class EOAdaptorChannelcount - The number of new rows for which to generate primary keys.entity - The entity for which to assign primary keys.
null if the adaptor is unable to provide 
               the primary key values.EOEntitypublic NSDictionary returnValuesForLastStoredProcedureInvocation()
EOAdaptorChannelexecuteStoredProcedure. The dictionary
 returned by this method should have entries whose keys are the names
 of the stored procedure's parameters and whose values are the 
 parameter values. The dictionary also should contain a special entry
 for the stored procedure's return value with the key 
 "returnValue". 
 Should return an empty dictionary for stored procedures that have
 void return types. Should return null if the stored
 procedure has results to fetch. In this case, you must use 
 fetchRow until there are no more results to fetch 
 before the return value will be available.
returnValuesForLastStoredProcedureInvocation in class EOAdaptorChannelEOAdaptorChannel.executeStoredProcedure(EOStoredProcedure storedProcedure,
                                NSDictionary values), 
EOAdaptorChannel.fetchRow(), 
EOStoredProcedure
public void selectAttributes(NSArray attributes,
                             EOFetchSpecification fetchSpecification,
                             boolean isLocking,
                             EOEntity entity)
EOAdaptorChannelfetchSpecification and set the receiver's attributes 
 to fetch. The selected rows compose one or more result sets, each 
 row of which should be returned by subsequent fetchRow
 calls according to fetchSpecification's sort 
 orderings. If the yn flag is true, the 
 rows should be locked if possible so that no other user can modify 
 them. The lock specification in fetchSpecification
 should be ignored. Should throw a runtime exception if an error
 occurs. Some possible reasons for failure are: 
 
selectAttributes in class EOAdaptorChannelattributes - An array of the attributes to select.fetchSpecification - Describes the row(s) to select.isLocking - true if rows should be 
                           locked.entity - The entity corresponding to the row(s) to 
                           be selected.EOAdaptorChannel.fetchRow(), 
EOEntity, 
EOFetchSpecification, 
EOSortOrderingpublic void setAttributesToFetch(NSArray attributes)
EOAdaptorChannelattributes used to
 describe fetch data from a corresponding select. attribute is an array
 of the attributes to fetch. This method should be invoked after
 evaluateExpression but before the first call to fetchRow.
 This method should throw a runtime exception if invoked when there is no fetch in
 progress.
setAttributesToFetch in class EOAdaptorChannelattributes - An array of the attributes to fetch.EOAdaptorChannel.selectAttributes( NSArray attributes,
                   EOFetchSpecification fetchSpecification,
                   boolean flag, EOEntity entity), 
EOAdaptorChannel.evaluateExpression(EOSQLExpression expression), 
EOAdaptorChannel.fetchRow()
public int updateValuesInRowsDescribedByQualifier(NSDictionary row,
                                                  EOQualifier qualifier,
                                                  EOEntity entity)
EOAdaptorChannelqualifier with the values
 in row. row is a dictionary whose keys are
 attribute names and whose values are the new values for  those 
 attributes (the dictionary need only contain entries for the 
 attributes being changed). Should return the number of updated rows.
 Should throw a runtime exception if an error occurs. Some possible 
 reasons for failure are:
 
updateValuesInRowsDescribedByQualifier in class EOAdaptorChannelrow - The new values for row(s).qualifier - Describes row(s) to update.entity - The entity corresponding to the row(s) to update.
(NSDictionary row, EOQualifier qualifier, EOEntity entity), 
EOEntity, 
EOQualifier| 
 | Last updated Thu Oct 21 15:04:16 PDT 2004. | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||