This is my 22nd activity to participate in the August Challenge

Chapter 129 search keyword – WebMethod

Specifies whether the class query is a Web method. Applies only to classes defined as Web services or Web clients.

usage

To specify that the query is a Web method, use the following syntax:

Query name(formal_spec) As classname [ WebMethod ] {    //implementation }
Copy the code

Otherwise, ignore the keyword or place Not before it.

details

This keyword specifies whether the class query is a Web method and can be invoked over the SOAP protocol.

The default

If you omit this keyword, the query cannot be invoked as a Web method.

The generated class

When you add this keyword to the class query and compile the class, the class compiler generates two additional classes:

  • Package.OriginalClass.QueryName
  • Package.OriginalClass.QueryName.DS

Package.OriginalClass is the class that contains the Web methods, and QueryName is the name of the class query.

For example, suppose you start with the class robjDemo.queryws. And then add a class query named MyQuery to it. When you add the WebMethod keyword to the class query and compile it, the class compiler generates the following additional classes:

  • ROBJDemo.QueryWS.MyQuery
  • ROBJDemo.QueryWS.MyQuery.DS

Do not modify or directly use these generated classes; They are for internal use only.

The relationship between the WSDL

For web services, this keyword also affects the generated WSDL, which now contains additional elements needed to represent the Web method.

Chapter 130 trigger keyword – CodeMode

Specifies how to implement this trigger.

usage

To specify how triggers are implemented, use the following syntax:

Trigger name [ Event = sqlevent, CodeMode = codemode ]  {    //implementation }
Copy the code

Codemode is one of the following:

  • code– This trigger is implemented as a line of code (default).
  • objectgenerator– This trigger is a trigger generator.

Note: This keyword (generator) has an older value and is present only for compatibility reasons. Newer applications should use ObjectGenerator.

details

This keyword specifies how a given trigger is implemented.

By default, trigger code consists of one or more lines of code that are executed when a trigger is fired.

However, if CodeMode is objectGenerator, the trigger is actually a trigger generator. A trigger generator is a program called by a class compiler that generates the actual implementation of a given trigger. In this case, the trigger code is responsible for the generated code. The logic is similar to a method generator;

The default

The default value is code. That is, triggers are not trigger generators by default.

Chapter 131 trigger keyword – Event

Specifies the SQL event that will fire this trigger. Required(no default).

usage

To specify the SQL event that will trigger, use the following syntax:

Trigger name [ Event = sqlevent, Time = AFTER ] {    //implementation }
Copy the code

Sqlevent is one of the following values:

  • DELETESQL DELETEThis trigger is fired during an operation.
  • INSERTSQL INSERTThis trigger is fired during an operation.
  • UPDATE– inSQL UPDATEThis trigger is fired during an operation.
  • INSERT/UPDATE– This trigger is inSQL INSERTOperation orSQL UPDATETriggered during operation.
  • INSERT/DELETE— This trigger is inSQL INSERTOperation orSQL DELETETriggered during operation.
  • UPDATE/DELETE— This trigger is inSQL UPDATEOperation orSQL DELETETriggered during operation.
  • INSERT/UPDATE/DELETE— This trigger is inSQL INSERTOperation,SQL UPDATEOperation orSQL DELETETriggered during operation.

details

This keyword specifies the SQL event that will fire the trigger.

The default

There is no default value. When defining a trigger, you must specify a value for this keyword.

Chapter 132 trigger keywords – Final

Specifies whether this trigger is final(cannot be overridden ina subclass).

usage

To specify a trigger as final, use the following syntax:

Trigger name [ Event = sqlevent, Final ] {    //implementation }
Copy the code

Otherwise, ignore the keyword or place Not before it.

details

Class members marked final cannot be overridden in subclasses.

The default

If this keyword is omitted, the trigger is not final.