protected virtual Expression GetOutputValueReader(Expression expression, Type expectedType, ParameterExpression dataRecordParameter, ParameterExpression sessionParameter, TranslationContext context) { expectedType = expectedType ?? expression.Type; int valueIndex = RegisterOutputValue(expression, context); DbValueConverter conv = null; if (expression is ColumnExpression) { //With column everything is simple var colExpr = (ColumnExpression)expression; conv = colExpr.ColumnInfo.Converter; } else { //Otherwise get converter from type registry; // Why we need converters for non-column values. // Example: Count(*) function. In this case expectedType is always 'int', but some providers (MySql) return Int64. // In this case expression.Type is Int64 (it is SqlFunction expression), while expectedType is int32. We need a converter. // Note - even if expression.Type is the same as expectedType, we still might need a converter. // Example : 'Max(decimalCol)' in SQLite. SQLite stores decimals as doubles (we do), so SQL will return double; // we need an extra converter to cast to Decimal expected by c# code. We must go through TypeRegistry anyway, // to verify how type is supported. conv = _dbModel.Driver.TypeRegistry.GetDbValueConverter(expression.Type, expectedType); } var reader = ColumnReaderHelper.GetColumnValueReader(dataRecordParameter, valueIndex, expectedType, conv.ColumnToProperty); return(reader); }
/// <summary> /// 创建查询命令 /// </summary> /// <param name="query">参数化查询</param> /// <returns>查询命令</returns> public TCommand Parse(ParameterizedQuery query) { var regex = ParameterizedQuery.DbPartialPlaceholdRegex; var text = regex.Replace(query.TextTemplate, (match) => { if (match.Groups["index"].Success) { var index = int.Parse(match.Groups["index"].Value); return(GetLiteralValue(DbValueConverter.ConvertTo(query.ParameterValues[index], null))); } else if (match.Groups["name"].Success) { var name = match.Groups["name"].Value.Replace("##", "#"); return(GetDbName(name)); } else { throw new InvalidOperationException(); } }); return(CreateCommand(text.Replace("##", "#"))); }
private void GetSettingsValue(int queryTypeId, CacheObject cacheObjectType, out object cacheValue) { using (NpgsqlConnection con = PostgreSQLConn.CreateConnection(Parent.CurrentUser)) { using (NpgsqlCommand cmd = con.CreateCommand()) { cmd.CommandText = "SELECT * FROM \"QueryTypes\" WHERE id=:id"; cmd.Parameters.Add("id", queryTypeId); NpgsqlDataReader reader = PostgreSQLConn.ExecuteReader(cmd, Parent.CurrentUser); reader.Read(); int? qid = DbValueConverter.Convert <int>(reader["id"]); bool?imageRecognition = DbValueConverter.Convert <bool>(reader["image_recognition"]); bool?listeningComprehension = DbValueConverter.Convert <bool>(reader["listening_comprehension"]); bool?multipleChoice = DbValueConverter.Convert <bool>(reader["multiple_choice"]); bool?sentenceMode = DbValueConverter.Convert <bool>(reader["sentence"]); bool?wordMode = DbValueConverter.Convert <bool>(reader["word"]); //cache values DateTime expires = DateTime.Now.Add(Cache.DefaultSettingsValidationTime); Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsQueryTypesImageRecognition, queryTypeId, expires)] = imageRecognition; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsQueryTypesListeningComprehension, queryTypeId, expires)] = listeningComprehension; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsQueryTypesMultipleChoice, queryTypeId, expires)] = multipleChoice; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsQueryTypesSentence, queryTypeId, expires)] = sentenceMode; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsQueryTypesWord, queryTypeId, expires)] = wordMode; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsQueryTypesId, queryTypeId, expires)] = qid; //set output value switch (cacheObjectType) { case CacheObject.SettingsQueryTypesImageRecognition: cacheValue = imageRecognition; break; case CacheObject.SettingsQueryTypesListeningComprehension: cacheValue = listeningComprehension; break; case CacheObject.SettingsQueryTypesMultipleChoice: cacheValue = multipleChoice; break; case CacheObject.SettingsQueryTypesSentence: cacheValue = sentenceMode; break; case CacheObject.SettingsQueryTypesWord: cacheValue = wordMode; break; case CacheObject.SettingsQueryTypesId: cacheValue = qid; break; default: cacheValue = null; break; } } } }
private void GetSettingsValue(int synonymsGradingId, CacheObject cacheObjectType, out object cacheValue) { using (NpgsqlConnection con = PostgreSQLConn.CreateConnection(Parent.CurrentUser)) { using (NpgsqlCommand cmd = con.CreateCommand()) { cmd.CommandText = "SELECT * FROM \"SynonymGradings\" WHERE id=:id"; cmd.Parameters.Add("id", synonymsGradingId); NpgsqlDataReader reader = PostgreSQLConn.ExecuteReader(cmd, Parent.CurrentUser); reader.Read(); int? sid = DbValueConverter.Convert <int>(reader["id"]); bool?allKnown = DbValueConverter.Convert <bool>(reader["all_known"]); bool?halfKnown = DbValueConverter.Convert <bool>(reader["half_known"]); bool?oneKnown = DbValueConverter.Convert <bool>(reader["one_known"]); bool?firstKnown = DbValueConverter.Convert <bool>(reader["first_known"]); bool?prompt = DbValueConverter.Convert <bool>(reader["prompt"]); //cache values DateTime expires = DateTime.Now.Add(Cache.DefaultSettingsValidationTime); Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSynonymGradingsAllKnown, synonymsGradingId, expires)] = allKnown; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSynonymGradingsHalfKnown, synonymsGradingId, expires)] = halfKnown; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSynonymGradingsOneKnown, synonymsGradingId, expires)] = oneKnown; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSynonymGradingsFirstKnown, synonymsGradingId, expires)] = firstKnown; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSynonymGradingsPrompt, synonymsGradingId, expires)] = prompt; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSynonymGradingsId, synonymsGradingId, expires)] = sid; //set output value switch (cacheObjectType) { case CacheObject.SettingsSynonymGradingsAllKnown: cacheValue = allKnown; break; case CacheObject.SettingsSynonymGradingsHalfKnown: cacheValue = halfKnown; break; case CacheObject.SettingsSynonymGradingsOneKnown: cacheValue = oneKnown; break; case CacheObject.SettingsSynonymGradingsFirstKnown: cacheValue = firstKnown; break; case CacheObject.SettingsSynonymGradingsPrompt: cacheValue = prompt; break; case CacheObject.SettingsSynonymGradingsId: cacheValue = sid; break; default: cacheValue = null; break; } } } }
/// <summary> /// 创建查询命令 /// </summary> /// <param name="query">参数化查询</param> /// <returns>查询命令</returns> public TCommand Parse(ParameterizedQuery query) { var regex = ParameterizedQuery.ParameterPlaceholdRegex; var text = regex.Replace(query.TextTemplate, (match) => { var index = int.Parse(match.Groups["index"].Value); return(GetLiteralValue(DbValueConverter.ConvertTo(query.ParameterValues[index], null))); }); return(CreateCommand(text.Replace("##", "#"))); }
/// <summary> /// Gets the settings value. /// </summary> /// <param name="synonymsGradingId">The synonyms grading id.</param> /// <param name="cacheObjectType">Type of the cache object.</param> /// <param name="cacheValue">The cache value.</param> /// <remarks>Documented by Dev08, 2009-01-13</remarks> private void GetSettingsValue(int synonymsGradingId, CacheObject cacheObjectType, out object cacheValue) { using (SqlCeCommand cmd = MSSQLCEConn.CreateCommand(parent.CurrentUser)) { cmd.CommandText = "SELECT * FROM \"SynonymGradings\" WHERE id=@id"; cmd.Parameters.Add("@id", synonymsGradingId); SqlCeDataReader reader = MSSQLCEConn.ExecuteReader(cmd); reader.Read(); int? sid = DbValueConverter.Convert <int>(reader["id"]); bool?allKnown = DbValueConverter.Convert <bool>(reader["all_known"]); bool?halfKnown = DbValueConverter.Convert <bool>(reader["half_known"]); bool?oneKnown = DbValueConverter.Convert <bool>(reader["one_known"]); bool?firstKnown = DbValueConverter.Convert <bool>(reader["first_known"]); bool?prompt = DbValueConverter.Convert <bool>(reader["prompt"]); reader.Close(); //save all values to cache DateTime expires = DateTime.Now.Add(Cache.DefaultSettingsValidationTime); parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSynonymGradingsAllKnown, synonymsGradingId, expires)] = allKnown; parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSynonymGradingsHalfKnown, synonymsGradingId, expires)] = halfKnown; parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSynonymGradingsOneKnown, synonymsGradingId, expires)] = oneKnown; parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSynonymGradingsFirstKnown, synonymsGradingId, expires)] = firstKnown; parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSynonymGradingsPrompt, synonymsGradingId, expires)] = prompt; parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSynonymGradingsId, synonymsGradingId, expires)] = sid; //set output value (the call by reference parameter) switch (cacheObjectType) { case CacheObject.SettingsSynonymGradingsAllKnown: cacheValue = allKnown; break; case CacheObject.SettingsSynonymGradingsHalfKnown: cacheValue = halfKnown; break; case CacheObject.SettingsSynonymGradingsOneKnown: cacheValue = oneKnown; break; case CacheObject.SettingsSynonymGradingsFirstKnown: cacheValue = firstKnown; break; case CacheObject.SettingsSynonymGradingsPrompt: cacheValue = prompt; break; case CacheObject.SettingsSynonymGradingsId: cacheValue = sid; break; default: cacheValue = null; break; } } }
private void GetSettingsValue(int typeGradingsId, CacheObject cacheObjectType, out object cacheValue) { using (NpgsqlConnection con = PostgreSQLConn.CreateConnection(Parent.CurrentUser)) { using (NpgsqlCommand cmd = con.CreateCommand()) { cmd.CommandText = "SELECT * FROM \"TypeGradings\" WHERE id=:id"; cmd.Parameters.Add("id", typeGradingsId); NpgsqlDataReader reader = PostgreSQLConn.ExecuteReader(cmd, Parent.CurrentUser); reader.Read(); int? gid = DbValueConverter.Convert <int>(reader["id"]); bool?allCorrect = DbValueConverter.Convert <bool>(reader["all_correct"]); bool?halfCorrect = DbValueConverter.Convert <bool>(reader["half_correct"]); bool?noneCorrect = DbValueConverter.Convert <bool>(reader["none_correct"]); bool?prompt = DbValueConverter.Convert <bool>(reader["prompt"]); //cache values DateTime expires = DateTime.Now.Add(Cache.DefaultSettingsValidationTime); Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsTypeGradingsAllCorrect, typeGradingsId, expires)] = allCorrect; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsTypeGradingsHalfCorrect, typeGradingsId, expires)] = halfCorrect; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsTypeGradingsNoneCorrect, typeGradingsId, expires)] = noneCorrect; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsTypeGradingsPrompt, typeGradingsId, expires)] = prompt; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsTypeGradingsId, typeGradingsId, expires)] = gid; //set output value switch (cacheObjectType) { case CacheObject.SettingsTypeGradingsAllCorrect: cacheValue = allCorrect; break; case CacheObject.SettingsTypeGradingsHalfCorrect: cacheValue = halfCorrect; break; case CacheObject.SettingsTypeGradingsNoneCorrect: cacheValue = noneCorrect; break; case CacheObject.SettingsTypeGradingsPrompt: cacheValue = prompt; break; case CacheObject.SettingsTypeGradingsId: cacheValue = gid; break; default: cacheValue = null; break; } } } }
private void GetSettingsValue(int multipleChoiceId, CacheObject cacheObjectType, out object cacheValue) { using (NpgsqlConnection con = PostgreSQLConn.CreateConnection(Parent.CurrentUser)) { using (NpgsqlCommand cmd = con.CreateCommand()) { cmd.CommandText = "SELECT * FROM \"MultipleChoiceOptions\" WHERE id=:id"; cmd.Parameters.Add("id", multipleChoiceId); NpgsqlDataReader reader = PostgreSQLConn.ExecuteReader(cmd, Parent.CurrentUser); reader.Read(); int? mid = DbValueConverter.Convert <int>(reader["id"]); bool?allowMultipleCorrectAnswers = DbValueConverter.Convert <bool>(reader["allow_multiple_correct_answers"]); bool?allowRandomDistractors = DbValueConverter.Convert <bool>(reader["allow_random_distractors"]); int? maxCorrectAnswers = DbValueConverter.Convert <int>(reader["max_correct_answers"]); int? numberOfChoices = DbValueConverter.Convert <int>(reader["number_of_choices"]); //cache values DateTime expires = DateTime.Now.Add(Cache.DefaultSettingsValidationTime); Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsMultipleChoiceOptionsAllowMultipleCorrectAnswers, multipleChoiceId, expires)] = allowMultipleCorrectAnswers; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsMultipleChoiceOptionsAllowRandomDistractors, multipleChoiceId, expires)] = allowRandomDistractors; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsMultipleChoiceOptionsMaxCorrectAnswers, multipleChoiceId, expires)] = maxCorrectAnswers; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsMultipleChoiceOptionsNumberOfChoices, multipleChoiceId, expires)] = numberOfChoices; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsMultipleChoiceOptionsId, multipleChoiceId, expires)] = mid; //set output value switch (cacheObjectType) { case CacheObject.SettingsMultipleChoiceOptionsAllowMultipleCorrectAnswers: cacheValue = allowMultipleCorrectAnswers; break; case CacheObject.SettingsMultipleChoiceOptionsAllowRandomDistractors: cacheValue = allowRandomDistractors; break; case CacheObject.SettingsMultipleChoiceOptionsMaxCorrectAnswers: cacheValue = maxCorrectAnswers; break; case CacheObject.SettingsMultipleChoiceOptionsNumberOfChoices: cacheValue = numberOfChoices; break; case CacheObject.SettingsMultipleChoiceOptionsId: cacheValue = mid; break; default: cacheValue = null; break; } } } }
/// <summary> /// Gets the settings value. /// </summary> /// <param name="queryDirectionsId">The query directions id.</param> /// <param name="cacheObjectType">Type of the cache object.</param> /// <param name="cacheValue">The cache value.</param> /// <remarks>Documented by Dev08, 2009-01-13</remarks> private void GetSettingsValue(int queryDirectionsId, CacheObject cacheObjectType, out object cacheValue) { SqlCeCommand cmd = MSSQLCEConn.CreateCommand(Parent.CurrentUser); cmd.CommandText = "SELECT * FROM \"QueryDirections\" WHERE id=@id"; cmd.Parameters.Add("@id", queryDirectionsId); SqlCeDataReader reader = MSSQLCEConn.ExecuteReader(cmd); reader.Read(); int? did = DbValueConverter.Convert <int>(reader["id"]); bool?questionToAnswer = DbValueConverter.Convert <bool>(reader["question2answer"]); bool?answerToQuestion = DbValueConverter.Convert <bool>(reader["answer2question"]); bool?mixed = DbValueConverter.Convert <bool>(reader["mixed"]); reader.Close(); //cache values DateTime expires = DateTime.Now.Add(Cache.DefaultSettingsValidationTime); Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsQueryDirectionsQuestion2Answer, queryDirectionsId, expires)] = questionToAnswer; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsQueryDirectionsAnswer2Question, queryDirectionsId, expires)] = answerToQuestion; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsQueryDirectionsMixed, queryDirectionsId, expires)] = mixed; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsQueryDirectionsId, queryDirectionsId, expires)] = did; //set output value switch (cacheObjectType) { case CacheObject.SettingsQueryDirectionsQuestion2Answer: cacheValue = questionToAnswer; break; case CacheObject.SettingsQueryDirectionsAnswer2Question: cacheValue = answerToQuestion; break; case CacheObject.SettingsQueryDirectionsMixed: cacheValue = mixed; break; case CacheObject.SettingsQueryDirectionsId: cacheValue = did; break; default: cacheValue = null; break; } }
public void XmlFieldTest() { DbValueConverter.Register(new XDocumentValueConverter()); var document = new XDocument(new XDeclaration("1.0", "utf-8", "yes"), new XElement("Root", new XAttribute("test", "test-value"), new XElement("Item"), new XElement("Item"), new XElement("Item") )); Db.T($"INSERT INTO Test1 ( Name, XmlContent, [Index] ) VALUES ( {"XML content"}, {document}, {1} )").ExecuteNonQuery(); var document1 = Db.T($"SELECT TOP 1 XmlContent FROM Test1").ExecuteScalar <XDocument>(); Assert.AreEqual(document.ToString(SaveOptions.OmitDuplicateNamespaces), document1.ToString(SaveOptions.OmitDuplicateNamespaces)); Db.T($"UPDATE Test1 SET XmlContent = {null} ").ExecuteNonQuery(); Assert.IsNull(Db.T($"SELECT XmlContent FROM Test1 ").ExecuteScalar <XDocument>()); DbValueConverter.Unregister <XDocument>(); }
/// <summary> /// 创建查询命令 /// </summary> /// <param name="query">参数化查询</param> /// <returns>查询命令</returns> public TCommand Parse(ParameterizedQuery query) { var length = query.ParameterValues.Length; TParameter[] parameters = new TParameter[length]; string[] parameterPlaceholders = new string[length]; lock ( SyncRoot ) { var regex = ParameterizedQuery.ParameterPlaceholdRegex; var text = regex.Replace(query.TextTemplate, (match) => { var index = int.Parse(match.Groups["index"].Value); if (index >= length) { throw new IndexOutOfRangeException("分析参数化查询时遇到错误,参数索引超出边界"); } var placeholder = parameterPlaceholders[index]; if (placeholder == null) { placeholder = parameterPlaceholders[index] = GetParameterPlaceholder(DbValueConverter.ConvertTo(query.ParameterValues[index], null), index, out parameters[index]); } return(placeholder); }); return(CreateCommand(text.Replace("##", "#"), parameters.ToArray())); } }
private void GetSettingsValue(int snoozeOptionsId, CacheObject cacheObjectType, out object cacheValue) { using (NpgsqlConnection con = PostgreSQLConn.CreateConnection(Parent.CurrentUser)) { using (NpgsqlCommand cmd = con.CreateCommand()) { cmd.CommandText = "SELECT * FROM \"SnoozeOptions\" WHERE id=:id"; cmd.Parameters.Add("id", snoozeOptionsId); NpgsqlDataReader reader = PostgreSQLConn.ExecuteReader(cmd, Parent.CurrentUser); reader.Read(); int? sid = DbValueConverter.Convert <int>(reader["id"]); bool? cardsEnabled = DbValueConverter.Convert <bool>(reader["cards_enabled"]); bool? rightsEnabled = DbValueConverter.Convert <bool>(reader["rights_enabled"]); bool? timeEnabled = DbValueConverter.Convert <bool>(reader["time_enabled"]); int? snoozeCards = DbValueConverter.Convert <int>(reader["snooze_cards"]); int? snoozeHigh = DbValueConverter.Convert <int>(reader["snooze_high"]); int? snoozeLow = DbValueConverter.Convert <int>(reader["snooze_low"]); ESnoozeMode?snoozeMode = DbValueConverter.Convert <ESnoozeMode>(reader["snooze_mode"]); int? snoozeRights = DbValueConverter.Convert <int>(reader["snooze_rights"]); int? snoozeTime = DbValueConverter.Convert <int>(reader["snooze_time"]); //cache values DateTime expires = DateTime.Now.Add(Cache.DefaultSettingsValidationTime); Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSnoozeCardsEnabled, snoozeOptionsId, expires)] = cardsEnabled; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSnoozeRightsEnabled, snoozeOptionsId, expires)] = rightsEnabled; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSnoozeTimeEnabled, snoozeOptionsId, expires)] = timeEnabled; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSnoozeCards, snoozeOptionsId, expires)] = snoozeCards; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSnoozeHigh, snoozeOptionsId, expires)] = snoozeHigh; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSnoozeLow, snoozeOptionsId, expires)] = snoozeLow; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSnoozeMode, snoozeOptionsId, expires)] = snoozeMode; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSnoozeRights, snoozeOptionsId, expires)] = snoozeRights; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSnoozeTime, snoozeOptionsId, expires)] = snoozeTime; Parent.CurrentUser.Cache[ObjectLifetimeIdentifier.Create(CacheObject.SettingsSnoozeOptionsId, snoozeOptionsId, expires)] = sid; //set output value switch (cacheObjectType) { case CacheObject.SettingsSnoozeCardsEnabled: cacheValue = cardsEnabled; break; case CacheObject.SettingsSnoozeRightsEnabled: cacheValue = rightsEnabled; break; case CacheObject.SettingsSnoozeTimeEnabled: cacheValue = timeEnabled; break; case CacheObject.SettingsSnoozeCards: cacheValue = snoozeCards; break; case CacheObject.SettingsSnoozeHigh: cacheValue = snoozeHigh; break; case CacheObject.SettingsSnoozeLow: cacheValue = snoozeLow; break; case CacheObject.SettingsSnoozeMode: cacheValue = snoozeMode; break; case CacheObject.SettingsSnoozeRights: cacheValue = snoozeRights; break; case CacheObject.SettingsSnoozeTime: cacheValue = snoozeTime; break; case CacheObject.SettingsSnoozeOptionsId: cacheValue = sid; break; default: cacheValue = null; break; } } } }