gorm series - Update

Catalog Gorm update operation Update all fields Update modified fields Update selected fields No Hooks updates Batch update Update with SQL expression Modify values in Hooks Other update options Gorm update operation Update all fields Save() updates all fields of the object by default, even if you don't have an assignment. package main im ...

Added by deft on Mon, 27 Apr 2020 18:54:52 +0300

MyBatis L2 cache implementation details and precautions

Introduction to L2 cache In the first level cache mentioned above, the largest sharing range is within a SqlSession. If multiple sqlsessions need to share cache, they need to use the second level cache. After the second level cache is enabled, the cachenexecutor will be used to decorate the Executor. Before entering the query process of the fir ...

Added by sabien on Mon, 27 Apr 2020 12:20:29 +0300

java jdbc ResultSet results are assigned to Java objects through java reflection

In the case of unconformity framework, when using jdbc to read data from the database, we have to get and set one by one, which is not only tedious but also not concise. So we write a tool class using java reflection mechanism, so it is not so troublesome to use jdbc to get data from the database. Because in many cases there is more than one p ...

Added by jdpatrick on Fri, 24 Apr 2020 19:05:46 +0300

Security mode of MYSQL: introduction to SQL safe updates

What is safe mode In mysql, if the where condition is not added to update and delete, all data will be modified. It's not only the developers who are new to MySQL that will encounter this problem, but also the engineers who have some experience will inevitably forget to write where conditions. In order to avoid all data modification and deleti ...

Added by tyler on Thu, 23 Apr 2020 17:03:38 +0300

oracle Operations and Maintenance Personal Common Check Statements

1. Find the most ordered SQL SQL> SELECT HASH_VALUE, SQL_TEXT, SORTS, EXECUTIONS FROM V$SQLAREA ORDER BY SORTS DESC; 2. Find the SQL with the most reads and writes on the disk SQL> SELECT * FROM (SELECT sql_text,disk_reads "total disk" , executions "total exec",disk_reads/executions "disk/exec" FROM v$sql WHERE executions>0 and is_o ...

Added by millesm on Tue, 21 Apr 2020 20:37:12 +0300

[interesting case] Python command line implementation - check the national 7-day weather

Why climb the weather? 1. You can practice. 2. After using the itchat library to realize the function of automatic reply, integrate the function of weather check, and realize the function of wechat self-service weather check! First of all, it's a similar pattern. Let's see if we can grab a general API directly on the official website (XHR). The ...

Added by expertis on Tue, 21 Apr 2020 10:55:26 +0300

Introduction to SLS Machine Learning: Time Series Complement and Version Comparison

This time, we introduce two useful functions: time series complement function and abnormal contrast function. 1. Time Series Complement Point Function Indicator description in the chart above Log Event Event T0: The earliest event a log generates Log Event Event T1: The latest event the log generates Actual point data: There is definite data ...

Added by puritania on Mon, 20 Apr 2020 06:44:07 +0300

EFCore Extended Select Method (Customize Query Statements to Entities)

EFCore Extended Select Method (Customize Query Statements to Entities) Often when working with databases, queries return fields that are inconsistent with what we define as entities, so it is cumbersome to create a large number of models for UI or interface layers and to manually correspond to the fields.This article addresses these repeti ...

Added by welsh_sponger on Fri, 17 Apr 2020 20:51:39 +0300

Oracle common function usage

1.decode function SELECT ID,NAME,DECODE(LEVER,1,'professor',2,'associate professor',3,'tutor','lecturer') POSITION, (SELECT CLASSNUM FROM CLASS T WHERE T.NUM = S.NUM) NUM FROM TEACHER S WHERE T.LEVER IN (1,2,3); The usage logic of the decode function in the previous SQL is as follows: IF(LEVER==1) THEN RETURN 'professor'(Translati ...

Added by msimoes on Thu, 16 Apr 2020 18:34:45 +0300

Overview of redis for NoSQL + Deployment

1. Relational and non-relational databasesRelational DatabaseA relational database is a structured database, built on a relational model and generally oriented to recordsHe works with data in databases using mathematical concepts and methods such as set algebraRelational models refer to two-dimensional table models, so a relational database is ...

Added by adiwood on Fri, 10 Apr 2020 04:16:00 +0300