miemie 6 лет назад
Родитель
Сommit
3073209025

+ 31 - 3
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/service/additional/AbstractChainWrapper.java

@@ -1,3 +1,18 @@
+/*
+ * Copyright (c) 2011-2016, hubin (jobob@qq.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
 package com.baomidou.mybatisplus.extension.service.additional;
 
 import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
@@ -16,6 +31,10 @@ import java.util.function.BiPredicate;
 import java.util.function.Function;
 
 /**
+ * 所有包装类都继承此抽象类,此抽象类代理了大部分生成 where 条件的方法
+ * <li> 泛型: Children ,表示子类 </li>
+ * <li> 泛型: Param ,表示子类所包装的具体 Wrapper 类型 </li>
+ *
  * @author miemie
  * @since 2018-12-19
  */
@@ -24,9 +43,18 @@ public abstract class AbstractChainWrapper<T, R, Children extends AbstractChainW
     extends Wrapper<T> implements Compare<Children, R>, Func<Children, R>, Join<Children>, Nested<Param, Children>,
     ChainWrapper<T> {
     protected final Children typedThis = (Children) this;
-    protected BaseMapper<T> baseMapper;
+    /**
+     * 子类所包装的具体 Wrapper 类型
+     */
     protected Param wrapperChildren;
-
+    private BaseMapper<T> baseMapper;
+
+    /**
+     * 必须的构造函数
+     * 子类必须给 wrapperChildren 赋值
+     *
+     * @param baseMapper BaseMapper
+     */
     public AbstractChainWrapper(BaseMapper<T> baseMapper) {
         this.baseMapper = baseMapper;
     }
@@ -41,7 +69,7 @@ public abstract class AbstractChainWrapper<T, R, Children extends AbstractChainW
         return (Wrapper<T>) wrapperChildren;
     }
 
-    protected AbstractWrapper getAbstractWrapper() {
+    private AbstractWrapper getAbstractWrapper() {
         return (AbstractWrapper) wrapperChildren;
     }
 

+ 17 - 0
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/service/additional/query/ChainQuery.java

@@ -1,3 +1,18 @@
+/*
+ * Copyright (c) 2011-2016, hubin (jobob@qq.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
 package com.baomidou.mybatisplus.extension.service.additional.query;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -6,6 +21,8 @@ import com.baomidou.mybatisplus.extension.service.additional.ChainWrapper;
 import java.util.List;
 
 /**
+ * 具有查询方法的定义
+ *
  * @author miemie
  * @since 2018-12-19
  */

+ 15 - 0
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/service/additional/query/impl/LambdaQueryChainWrapper.java

@@ -1,3 +1,18 @@
+/*
+ * Copyright (c) 2011-2016, hubin (jobob@qq.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
 package com.baomidou.mybatisplus.extension.service.additional.query.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

+ 15 - 0
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/service/additional/query/impl/QueryChainWrapper.java

@@ -1,3 +1,18 @@
+/*
+ * Copyright (c) 2011-2016, hubin (jobob@qq.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
 package com.baomidou.mybatisplus.extension.service.additional.query.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.Query;

+ 17 - 0
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/service/additional/update/ChainUpdate.java

@@ -1,8 +1,25 @@
+/*
+ * Copyright (c) 2011-2016, hubin (jobob@qq.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
 package com.baomidou.mybatisplus.extension.service.additional.update;
 
 import com.baomidou.mybatisplus.extension.service.additional.ChainWrapper;
 
 /**
+ * 具有更新方法的定义
+ *
  * @author miemie
  * @since 2018-12-19
  */

+ 15 - 0
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/service/additional/update/impl/LambdaUpdateChainWrapper.java

@@ -1,3 +1,18 @@
+/*
+ * Copyright (c) 2011-2016, hubin (jobob@qq.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
 package com.baomidou.mybatisplus.extension.service.additional.update.impl;
 
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;

+ 15 - 0
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/service/additional/update/impl/UpdateChainWrapper.java

@@ -1,3 +1,18 @@
+/*
+ * Copyright (c) 2011-2016, hubin (jobob@qq.com).
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
 package com.baomidou.mybatisplus.extension.service.additional.update.impl;
 
 import com.baomidou.mybatisplus.core.conditions.update.Update;