001/**
002 * Copyright (c) 2015-2022, Michael Yang 杨福海 (fuhai999@gmail.com).
003 * <p>
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 * <p>
008 * http://www.apache.org/licenses/LICENSE-2.0
009 * <p>
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package io.jboot.service;
017
018import com.jfinal.plugin.activerecord.Page;
019import io.jboot.db.model.JbootModel;
020import io.jboot.utils.ObjectFunc;
021
022import java.util.List;
023
024/**
025 * JbootService 需要 Join 功能的话,需要实现 JbootServiceJoiner 接口
026 */
027public interface JbootServiceJoiner {
028
029
030    public <M extends JbootModel> Page<M> join(Page<M> page, String columnName);
031
032    public <M extends JbootModel> Page<M> join(Page<M> page, String columnName, String[] attrs);
033
034    public <M extends JbootModel> Page<M> join(Page<M> page, String columnName, String joinName);
035
036    public <M extends JbootModel> Page<M> join(Page<M> page, String columnName, String joinName, String[] attrs);
037
038
039    public <M extends JbootModel> List<M> join(List<M> models, String columnName);
040
041    public <M extends JbootModel> List<M> join(List<M> models, String columnName, String[] attrs);
042
043    public <M extends JbootModel> List<M> join(List<M> models, String columnName, String joinName);
044
045    public <M extends JbootModel> List<M> join(List<M> models, String columnName, String joinName, String[] attrs);
046
047
048    public <M extends JbootModel> M join(M model, String columnName);
049
050    public <M extends JbootModel> M join(M model, String columnName, String[] attrs);
051
052    public <M extends JbootModel> M join(M model, String columnName, String joinName);
053
054    public <M extends JbootModel> M join(M model, String columnName, String joinName, String[] attrs);
055
056
057    public <M extends JbootModel> Page<M> joinMany(Page<M> page, String targetColumnName);
058
059    public <M extends JbootModel> Page<M> joinMany(Page<M> page, String targetColumnName, String[] attrs);
060
061    public <M extends JbootModel> Page<M> joinMany(Page<M> page, String targetColumnName, String joinName);
062
063    public <M extends JbootModel> Page<M> joinMany(Page<M> page, String targetColumnName, String joinName, String[] attrs);
064
065
066    public <M extends JbootModel> List<M> joinMany(List<M> models, String targetColumnName);
067
068    public <M extends JbootModel> List<M> joinMany(List<M> models, String targetColumnName, String[] attrs);
069
070    public <M extends JbootModel> List<M> joinMany(List<M> models, String targetColumnName, String joinName);
071
072    public <M extends JbootModel> List<M> joinMany(List<M> models, String targetColumnName, String joinName, String[] attrs);
073
074
075    public <M extends JbootModel> M joinMany(M model, String targetColumnName);
076
077    public <M extends JbootModel> M joinMany(M model, String targetColumnName, String[] attrs);
078
079    public <M extends JbootModel> M joinMany(M model, String targetColumnName, String joinName);
080
081    public <M extends JbootModel> M joinMany(M model, String targetColumnName, String joinName, String[] attrs);
082
083
084    public <M extends JbootModel> Page<M> joinMany(Page<M> page, ObjectFunc<M> modelValueGetter, String targetColumnName);
085
086    public <M extends JbootModel> Page<M> joinMany(Page<M> page, ObjectFunc<M> modelValueGetter, String targetColumnName, String[] attrs);
087
088    public <M extends JbootModel> Page<M> joinMany(Page<M> page, ObjectFunc<M> modelValueGetter, String targetColumnName, String joinName);
089
090    public <M extends JbootModel> Page<M> joinMany(Page<M> page, ObjectFunc<M> modelValueGetter, String targetColumnName, String joinName, String[] attrs);
091
092
093    public <M extends JbootModel> List<M> joinMany(List<M> models, ObjectFunc<M> modelValueGetter, String targetColumnName);
094
095    public <M extends JbootModel> List<M> joinMany(List<M> models, ObjectFunc<M> modelValueGetter, String targetColumnName, String[] attrs);
096
097    public <M extends JbootModel> List<M> joinMany(List<M> models, ObjectFunc<M> modelValueGetter, String targetColumnName, String joinName);
098
099    public <M extends JbootModel> List<M> joinMany(List<M> models, ObjectFunc<M> modelValueGetter, String targetColumnName, String joinName, String[] attrs);
100
101
102    public <M extends JbootModel> M joinMany(M model, ObjectFunc<M> modelValueGetter, String targetColumnName);
103
104    public <M extends JbootModel> M joinMany(M model, ObjectFunc<M> modelValueGetter, String targetColumnName, String[] attrs);
105
106    public <M extends JbootModel> M joinMany(M model, ObjectFunc<M> modelValueGetter, String targetColumnName, String joinName);
107
108    public <M extends JbootModel> M joinMany(M model, ObjectFunc<M> modelValueGetter, String targetColumnName, String joinName, String[] attrs);
109
110
111    public <M extends JbootModel> Page<M> joinManyByTable(Page<M> page, String tableName, String columnName, String targetColumnName);
112
113    public <M extends JbootModel> Page<M> joinManyByTable(Page<M> page, String tableName, String columnName, String targetColumnName, String[] attrs);
114
115    public <M extends JbootModel> Page<M> joinManyByTable(Page<M> page, String tableName, String columnName, String targetColumnName, String joinName);
116
117    public <M extends JbootModel> Page<M> joinManyByTable(Page<M> page, String tableName, String columnName, String targetColumnName, String joinName, String[] attrs);
118
119
120    public <M extends JbootModel> List<M> joinManyByTable(List<M> models, String tableName, String columnName, String targetColumnName);
121
122    public <M extends JbootModel> List<M> joinManyByTable(List<M> models, String tableName, String columnName, String targetColumnName, String[] attrs);
123
124    public <M extends JbootModel> List<M> joinManyByTable(List<M> models, String tableName, String columnName, String targetColumnName, String joinName);
125
126    public <M extends JbootModel> List<M> joinManyByTable(List<M> models, String tableName, String columnName, String targetColumnName, String joinName, String[] attrs);
127
128
129    public <M extends JbootModel> M joinManyByTable(M model, String tableName, String columnName, String targetColumnName);
130
131    public <M extends JbootModel> M joinManyByTable(M model, String tableName, String columnName, String targetColumnName, String[] attrs);
132
133    public <M extends JbootModel> M joinManyByTable(M model, String tableName, String columnName, String targetColumnName, String joinName);
134
135    public <M extends JbootModel> M joinManyByTable(M model, String tableName, String columnName, String targetColumnName, String joinName, String[] attrs);
136
137
138    public <M extends JbootModel> Page<M> joinManyByTable(Page<M> page, ObjectFunc<M> modelValueGetter, String tableName, String columnName, String targetColumnName);
139
140    public <M extends JbootModel> Page<M> joinManyByTable(Page<M> page, ObjectFunc<M> modelValueGetter, String tableName, String columnName, String targetColumnName, String[] attrs);
141
142    public <M extends JbootModel> Page<M> joinManyByTable(Page<M> page, ObjectFunc<M> modelValueGetter, String tableName, String columnName, String targetColumnName, String joinName);
143
144    public <M extends JbootModel> Page<M> joinManyByTable(Page<M> page, ObjectFunc<M> modelValueGetter, String tableName, String columnName, String targetColumnName, String joinName, String[] attrs);
145
146
147    public <M extends JbootModel> List<M> joinManyByTable(List<M> models, ObjectFunc<M> modelValueGetter, String tableName, String columnName, String targetColumnName);
148
149    public <M extends JbootModel> List<M> joinManyByTable(List<M> models, ObjectFunc<M> modelValueGetter, String tableName, String columnName, String targetColumnName, String[] attrs);
150
151    public <M extends JbootModel> List<M> joinManyByTable(List<M> models, ObjectFunc<M> modelValueGetter, String tableName, String columnName, String targetColumnName, String joinName);
152
153    public <M extends JbootModel> List<M> joinManyByTable(List<M> models, ObjectFunc<M> modelValueGetter, String tableName, String columnName, String targetColumnName, String joinName, String[] attrs);
154
155
156    public <M extends JbootModel> M joinManyByTable(M model, ObjectFunc<M> modelValueGetter, String tableName, String columnName, String targetColumnName);
157
158    public <M extends JbootModel> M joinManyByTable(M model, ObjectFunc<M> modelValueGetter, String tableName, String columnName, String targetColumnName, String[] attrs);
159
160    public <M extends JbootModel> M joinManyByTable(M model, ObjectFunc<M> modelValueGetter, String tableName, String columnName, String targetColumnName, String joinName);
161
162    public <M extends JbootModel> M joinManyByTable(M model, ObjectFunc<M> modelValueGetter, String tableName, String columnName, String targetColumnName, String joinName, String[] attrs);
163
164
165}