Tag:Relation

  • Link multi stream join

    Time:2020-11-21

    Multi stream join The semantics of the real-time computed join and the traditional batch join are consistent, both of which are used to link the two tables. The difference is that the real-time calculation links two dynamic tables, and the result of the connection is also dynamically updated to ensure that the final result is […]

  • Five steps to help you get rid of redundant business code, understand AOP, in line with code design principles

    Time:2020-11-19

    Single responsibility, open close principle and dependency inversion are the principles of code design and optimization. Take a simple example User table sys_ User (storing user‘s basic information), 2. User’s extended information table tb_ user_ Extend (store user extension information, associate user ID) Hypothesis: a requirement needs basic information of the user, the interface is […]

  • SQL associated query

    Time:2020-11-17

    Extract the associated data from two or more tables There are several types of associated queries: Inner join: inner join, cross join (1) Form 1 Select field list From a table inner join b table On Association condition [where other screening criteria] Note: if do not write association conditions, there will be a phenomenon: Cartesian […]

  • Larave with query list limit

    Time:2020-11-14

    1. Demand Requirements, query article list, and comments under the article list. However, only two comments need to be found for each article (there may be hundreds of comments in an article). 2. Implementation Configure association model //———————The associated table configuration of article model is as follows———————————- public function comments(){ return $this->hasMany(‘Modules\Type\Entities\comments’, ‘article_id’, ‘id’) ->select([‘id’,’name’])->limit(2); […]

  • Mybatisplus pagination multi table associated query

    Time:2020-11-11

    BaseMapperThe default query methods provided are all single table. If multi table associated query is required, and paging is also supported, one solution is to write SQL yourself. Now I write my own SQL, which should not be the old method of writing XML like traditional mybatis, but by writing annotations in mapper class. What […]

  • [Oracle] – function: merge into

    Time:2020-11-4

    Preface We may encounter this kind of situation in the business: if the user does not exist in the database, it will be inserted; otherwise, it will be modified. According to our usual practice, we may query whether the user exists in the business layer first, and then update it if it exists. Let’s talk […]

  • Etcd: the brain of kubernetes cluster

    Time:2020-10-31

    Etcd is a key component of kubernetes because it stores the entire state of the cluster: its configuration, specifications, and state of the running workload. In this article, we’ll uncover the mystery of how etcd stores all this information. Introduction to etcd Etcd is defined as a distributed, reliable key value storage for the most […]

  • Mongodb Data Association

    Time:2020-10-28

    const mongoose = require(‘mongoose’); mongoose.connect(‘mongodb://localhost: 27017/mongo-relation’, { useNewUrlParser: true, useUnifiedTopology: true }, err => { if (err) { console.log (‘Database connection failed ‘); } console.log (‘Database connection succeeded ‘); }) const categorySchema = new mongoose.Schema({ name: { type: String } }, { toJSON: { virtuals: true } }); categorySchema.virtual(‘posts’, { //Local key localField: ‘_id’, //Associated […]

  • Understand mybatis gradually through the project

    Time:2020-10-23

    Related reading: 1、Understand mybatis < 1 > step by step through the project 2、Understand mybatis < 2 > step by step through the project All code and documents of this project are hosted in GitHub address:https://github.com/zhisheng17/mybatis Advanced knowledge of mybatis Schedule: analyze the order item data model Order item data model Data model analysis ideas: […]

  • Understand mybatis gradually through the project (4)

    Time:2020-10-22

    Related reading: 1、Understand mybatis < 1 > step by step through the project 2、Understand mybatis < 2 > step by step through the project 3、Understand mybatis < 3 > gradually through the project All code and documents of this project are hosted in GitHub address:https://github.com/zhisheng17/mybatis Delay loading What is lazy loading? Resultmap can realize high-level […]

  • SAP hybrid discount group, discount group, discount record and user group

    Time:2020-10-22

    Create a new customer discount group under the price Settings > discount > customer discount groups menu in backoffice. This is just a place holder to store the specific discount information created later Maintain a discount record in discount. The discount is 20% and the ID is jerrydishcount_ 20: There is also a way and […]

  • [Oracle] – subquery: the difference between associated subquery and non associated subquery

    Time:2020-10-11

    Associated subquery and non associated subquery 1. Associated subquery explain For each row of data in the outer query, the internal query will be queried again. <br/> characteristic 1. Subqueries cannot be run alone and are related to external queries 2. The outer query is executed first, and then the inner query <br/> Examples In […]