Aby,

Is this what you are looking for?

-Nimmi

        ===============================================================>  
Class spider.database.$Package_Description$


The WHERE Clause


SELECT, UPDATE, and DELETE queries allow (and often require) that you
specify
criteria. The criteria define the subset of the database records to be
retrieved
or affected. The criteria are specified in the WHERE clause of the query. A
common base class named CSpCriteriaSQLObject provides common functions for
constructing queries and defines constant values.


In order to support the 4GL functionality NetDynamics provides, the final
WHERE
clause (when automatically created) is constructed from 5 sub-elements:


� Static Join  - The joins you specify in the Studio for this data object
using
the Joins  tab of the data object editor

� Static Filter - The where  criteria you specify in the Studio for this
data
object using the Where  tab of the data object editor

� QBE Dynamic Criteria - The criteria automatically added by the doQBE()
method
(or manually added by you)

� DrillDown Dynamic Criteria - The criteria automatically added in some
cases by
the doAction() method (or manually added by you)

� Join Dynamic Criteria - All criteria automatically added by the doJoin()
and
methods like executeAllUpdatingDataObjects() (or manually added by you)


The first two parts (Static Join and Static Filter) are typically provided
by
the developer, and they tend to be fixed for all executions of this data
object
by all end users. In contrast, the three Dynamic Criteria  types tend to
change
from one end user to another, and they may even change during the same end
user's session. For example, if the end user searches for all customers
living
in England, the doQBE()  method would add a QBE Dynamic Criterion:


(Customers.Country = 'England')



If the results of the query contain more than the requested number of rows
in
the output HTML, the end user may return after an unknown time period and
press
the <Next> button. Naturally, he/she would expect to see the next page of
all
customers that live in England. Between these two web events, another end
user
might "intrude" and search for customers whose first name begins with "Jo".
In
short, the dynamic parts of the the WHERE clause are automatically saved by
each
criteria data object as normal session objects. This is the mechanism
NetDynamics uses so that it does not get confused in such cases.

There is a predefined hierarchy between the three parts of a dynamic
criteria:


� QBE

� Drill Down

� Join


Consequently, high level Java CP methods that need to clear one level
automatically clear all levels below it.


� doQBE() clears all dynamic criteria (QBE, Drill Down, and Join).

� doAction() may clear the Drill Down (and  Join) criteria.

� doJoin() clears the Join part only.


In some cases you may add dynamic criteria yourself, check the criteria
automatically added by the system, clear some parts, and so on. The database
package provides methods such as addDynamicCriterion(), getDynamicCriteria
and
clearDynamicCriteria()  to perform such tasks.


Warning: Changes that you make to the dynamic criteria affect only the
current
end user (since criteria are automatically stored as user session objects).
Changes made to the other two parts of the WHERE clause (Static Join and
Static
Filter) affect all end users.  They are member variables of data objects
shared
by all end users.

-----Original Message-----
From: Mathew, Aby [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 21, 1999 2:36 PM
To: 'Curt Springer';
[EMAIL PROTECTED]
Subject: Re: [ND] Why do I have to execute the dataobject before calling
i ts getValue()?


Curt,

I too spent a lot of my ND life thinking Dynamic Criteria are as trustworthy
as instance variables, until I was corrected recently. 

>From what I learned, even though dataObject.addDynamicCriterion() sounds
like adding something to the DataObject instance, ND goes and keeps the
stuff in a userSessionObject, so it stays for the same user for later use.
This functionality seems to be crucial for the built-in handling of Next,
Prev etc.

I had read a detailed note on this, but not able to locate it. It was fairly
recently, otherwise I would doubt myself.

Regards,

Aby

> -----Original Message-----
> From: Curt Springer [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, May 21, 1999 2:38 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: [ND] Why do I have to execute the dataobject before
> calling its getValue()?
> 
> see below
> 
> At 11:02 AM 5/21/99 -0800, [EMAIL PROTECTED] wrote:
> >Hi,
> >
> >If some one could clarify the following that will be great-
> >
> >My Case:
> >I have a DO that is not bound to the page, I am calling it on 
> >the onBeforeDisplay event of the page and adding dynamic 
> >criterion to it to personalize the contents of the page 
> >(actually a listbox on the page) for the user. Now I want to use
> >the same DO in onWebEvent of a button the page, regarding that I 
> >have following questions-
> >1. Why do I have to call execute() method of the DO before 
> >calling its getValue()?
> 
> execute() causes the SQL 'select' statement to be sent to the dbms and
> results to be retrieved back.  When the DO is bound to the page, the page
> calls execute() automatically.  When the DO is not bound, you have to do
> it
> yourself.
> 
> >2. Can I be sure that the DO's dynamic criteria is still the same
> >assuming multiple user sessions are active and provided I did 
> >not change the criteria any where else in the code? My understanding is
> that- instances DOs are not shared between sessions.
> 
> I must admit I took a long time to get this straight (pre-emptive
> statement).
> 
> Dynamic criteria in a DO are like member variables in a page object.  They
> hold for the life of a web event, i.e., from a page load or beginning of
> button/href method, until a page is sent back to the browser (including
> the
> situation where you set criteria on a DO in a button event, then load
> another page and execute the DO in that page's onBeforeLoad or
> onBeforeDisplay event).  And, at the outset of a web event, they must be
> assumed to reflect work done in a previous web event using the same
> object.
> 
> At the beginning of a web event, the DO might have criteria set by another
> page session.  So before you add any dynamic criteria for the current page
> session, you must execute clearDynamicCriteria on the DO.  Then you can
> add
> your current criteria.
> 
> Also, in case it was not clear above, in one web event, if you are in a
> button event of PageA, and you call CSpider.getDataObject("DO"), 
> and then you load PageB, and in its onBeforeLoadEvent, you call the same
> CSpider.getDataObject("DO"), you will get the same object.  
> 
> -- Curt Springer, Team ND
> 
> 
> >
> >Thanks in advance to all the noble souls who are gonna reply...
> >
> >Vishal
> >_________________________________________________________________________
> >
> >For help in using, subscribing, and unsubscribing to the discussion
> >forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
> >
> >For dire need help, email: [EMAIL PROTECTED]
> > 
> _________________________________________________________________________
> 
> For help in using, subscribing, and unsubscribing to the discussion
> forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
> 
> For dire need help, email: [EMAIL PROTECTED]
_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]
_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to