QLH is the handler class to be used when passing through the query layer of a query object.
This technology allows you to process as needed before/after query operations.
We can achieve our goal by overriding the following methods. The working times and meanings of these methods are brief;
- OnQueryExecution Triggered when the query object is running.
- beforeInsert It is triggered before the save operation.
- afterInsert It is triggered after saving operation.
- afterDelete Triggered after deletion.
- beforeDelete Is triggered before deletion.
- beforeUpdate Triggered before the update operation.
- afterUpdate Triggered after the update operation.
- beforeRead The database is triggered before the read operation.
- afterRead Database is triggered after reading operation.
1 - First, we need to define "queryLogicHandlers" progeny. Please check the following steps for this.
- The Definitions> QueryLogichandlers file under the project is selected
- The identification screen opens.
- Right Click to open the identification screen.
2 - We make the necessary definitions from the "Query Logic Handler Definition" screen that opens;
- Name : Ordinary
- Query Logic Handler Package : Package name
- Query Logic Handler : A new handler class can be created or available.
- Query Object : Query object associated with Handler
- Main Table: Table identification field
- Description : Explanation
3 - After that;
We perform our operations by calling the necessary methods in the class that is created when we define.
Örnek
package com.LPT.customization;
import javax.swing.JOptionPane;
import com.lbs.data.factory.IBusinessLogicFactory;
import com.lbs.data.query.QueryActiveSchema;
import com.lbs.data.query.QueryBusinessObject;
import com.lbs.data.query.QueryCommand;
import com.lbs.data.query.QueryLogicHandler;
public class CQLArpCardBrowser extends QueryLogicHandler
{
@Override
public boolean onQueryExecution(IBusinessLogicFactory factory,
QueryActiveSchema querySchema, QueryCommand queryCommand,
QueryBusinessObject item, int point) {
item.getProperties().set("CustomFieldName", "QLHTest..");
System.out.println("onQueryExecution...");
return
super.onQueryExecution(factory, querySchema, queryCommand, item, point);
}
}
Copyright © 2018 Logo Yazılım