Analyze the structure of the petshop. Files at different layers can be quickly generated by using the codesmith generation function. For the template file, see Appendix 1: codesmith template file in the petshop architecture.
An automatic template is generated to obtain all the basic operations and obtain an object based on the primary key. You can also insert, delete, and update data. These basic operations are implemented in the template through two sets of code: stored procedure and SQL statement. The generated class structure is as follows:
The code is described as follows: only the most representative DAL layer is provided here. For other layers, see the PETSHOP architecture.
Note:
1. default SQL statement: used to complete the use of SQL statements. For example, some statements are used to build custom query conditions.
2. Parameter constants and paras configuration build parameters are not described here.
3. The basic operations generated by the system by default support SQL statements and stored procedures. It is implemented through reload in the system.
Use the SQL statement addition method.
The Stored Procedure Method adds a Boolean flag variable, which can be called as needed.
4. Support for custom query Conditions
If you need to customize the query, we recommend that you build an SQL string. It can receive the constructed SQL string passed through the upper layer.
By default, the system supports conditional queries using SQL statements and stored procedures. For example:
It must be noted that the common GetLDJQ0sbyCondition method is actually an encapsulation of GetLDJQ0sbyQueryString,
Note: The blue mark is used to call the above method.