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.db.model; 017 018import com.jfinal.plugin.activerecord.Config; 019import io.jboot.db.dialect.JbootDialect; 020 021public class CPI { 022 023 public static boolean hasAnyJoinEffective(JbootModel dao) { 024 return dao.hasAnyJoinEffective(); 025 } 026 027 028 public static boolean hasColumn(JbootModel dao, String columnLabel) { 029 return dao._hasColumn(columnLabel); 030 } 031 032 033 public static JbootDialect getJbootDialect(JbootModel dao) { 034 return dao._getDialect(); 035 } 036 037 038 public static Config getModelConfig(JbootModel dao) { 039 return dao._getConfig(); 040 } 041 042 043 public static <M> M loadByCache(JbootModel dao, Object... idValues) { 044 return (M) dao.loadByCache(idValues); 045 } 046 047 048 public static void safeDeleteCache(JbootModel dao, Object... idValues) { 049 dao.safeDeleteCache(idValues); 050 } 051 052 053 public static Class<?> safeDeleteCache(JbootModel dao) { 054 return dao._getPrimaryType(); 055 } 056 057 058 public static String buildIdCacheName(JbootModel dao, String name) { 059 return dao.buildIdCacheName(name); 060 } 061 062 063 public static String buildIdCacheKey(JbootModel dao, Object... idValues) { 064 return dao.buildIdCacheKey(idValues); 065 } 066 067 068}