public string GetUpdateSql <T>(string updateFields)
        {
            var table = PostgreCache.GetTableEntity <T>();

            CommonUtil.CheckTableKey(table);
            if (string.IsNullOrEmpty(updateFields))
            {
                return(table.UpdateSql);
            }
            return(CommonUtil.CreateUpdateSql(table, updateFields, "\"", "\""));
        }
Beispiel #2
0
        public string GetByIdsSql <T>(string returnFields)
        {
            var table = SqliteCache.GetTableEntity <T>();

            CommonUtil.CheckTableKey(table);
            if (string.IsNullOrEmpty(returnFields))
            {
                return(table.GetByIdsSql);
            }
            else
            {
                return(string.Format("SELECT {0} FROM [{1}] WHERE [{2}] IN @ids", returnFields, table.TableName, table.KeyName));
            }
        }
        public string GetByIdsSql <T>(string returnFields)
        {
            var table = PostgreCache.GetTableEntity <T>();

            CommonUtil.CheckTableKey(table);
            if (string.IsNullOrEmpty(returnFields))
            {
                return(table.GetByIdsSql);
            }
            else
            {
                return(string.Format("SELECT {0} FROM \"{1}\" WHERE \"{2}\"=ANY(@ids)", returnFields, table.TableName, table.KeyName));
            }
        }
Beispiel #4
0
        public string GetByIdSql <T>(string returnFields)
        {
            var table = MySqlCache.GetTableEntity <T>();

            CommonUtil.CheckTableKey(table);
            if (string.IsNullOrEmpty(returnFields))
            {
                return(table.GetByIdSql);
            }
            else
            {
                return(string.Format("SELECT {0} FROM `{1}` WHERE `{2}`=@id", returnFields, table.TableName, table.KeyName));
            }
        }