---
title: SAIF.Framework.Preferences database tables
summary: Database tables used by this library with relationships and usage context.
status: draft
owner: <owner>
last_reviewed: 2026-07-23
library: SAIF.Framework.Preferences
reference_type: package
---

# SAIF.Framework.Preferences database tables

This page catalogs the single database table accessed by `SAIF.Framework.Preferences`.

## Table catalog

| Table | Database | Schema/Link | CRUD | Purpose | Primary business object |
| --- | --- | --- | --- | --- | --- |
| [USER_PREFERENCE](#user_preference) | Oracle | `[unqualified]**` | C/R/U/D | Stores one row per saved application/page/user preference blob | `PreferenceData` |

## USER_PREFERENCE

| Field | Value |
| --- | --- |
| **Database** | Oracle |
| **Schema/Link** | `[unqualified]**` — no `OWNER.` prefix appears in any of the library's SQL statements, and no `Web.config`/`App.config` file exists in this library to confirm the connecting Oracle schema owner. |
| **Purpose** | Stores one row per saved user preference — a JSON-encoded key/value blob scoped by application name, user ID, and optional page name. |
| **Access pattern** | Direct inline SQL (no stored procedures, no `IBusinessCriteria` business-object pattern). |
| **CRUD operations** | Create, Read, Update, Delete — all four are performed by `PreferenceData`. |
| **Key columns used** | `USER_ID`, `APP_NAME`, `PAGE_NAME`, `PREFERENCE_TEXT`, `UPDATE_DATE`, `UPDATE_USER`, `USER_PREFERENCE_SEQ_NUM` |
| **Sequence** | `USER_PREFERENCE_SEQ` |
| **Related tables** | None — no joins or foreign-key relationships were found in any of the library's 7 SQL statements. |
| **Business objects** | `PreferenceData`, `Preference` |

### Operations referencing this table
- [Retrieve single preference blob](operations-processes.md#retrieve-single-preference-blob)
- [Retrieve all preferences for a user](operations-processes.md#retrieve-all-preferences-for-a-user)
- [Save (upsert/delete) preference](operations-processes.md#save-upsertdelete-preference)
- [Insert preference row](operations-processes.md#insert-preference-row)
- [Update preference row](operations-processes.md#update-preference-row)
- [Delete preference row](operations-processes.md#delete-preference-row)
- [Check preference existence](operations-processes.md#check-preference-existence)

### Business rules referencing this table
- [BR-001: User IDs are normalized to lower case](business-rules.md#br-001-user-ids-are-normalized-to-lower-case)
- [BR-002: Empty preference text triggers deletion](business-rules.md#br-002-empty-preference-text-triggers-deletion)
- [BR-003: Preference identity is scoped by app, user, and optional page](business-rules.md#br-003-preference-identity-is-scoped-by-app-user-and-optional-page)
- [BR-004: Update is skipped when stored value is unchanged](business-rules.md#br-004-update-is-skipped-when-stored-value-is-unchanged)
- [BR-005: Preference text is trimmed before storage](business-rules.md#br-005-preference-text-is-trimmed-before-storage)
- [BR-006: Preference item payload is JSON-encoded key/value data](business-rules.md#br-006-preference-item-payload-is-json-encoded-keyvalue-data)

### SQL referencing this table
- [SQL-001: Insert preference — sequence key generation](sql/SQL-001-insert-preference-sequence.md)
- [SQL-002: Retrieve single preference blob](sql/SQL-002-get-preferences.md)
- [SQL-003: Retrieve all preferences for a user](sql/SQL-003-get-preferences-for-user.md)
- [SQL-004: Insert preference row](sql/SQL-004-insert-preference.md)
- [SQL-005: Update preference row](sql/SQL-005-update-preference.md)
- [SQL-006: Delete preference row](sql/SQL-006-delete-preference.md)
- [SQL-007: Check preference existence](sql/SQL-007-does-pref-exist.md)

## Table relationship diagram

No cross-table relationships were identified in this library's SQL. `USER_PREFERENCE` is the only table referenced across all 7 cataloged SQL statements, with no `JOIN` clauses in any statement.

> **Note:** Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Operations and processes](operations-processes.md)
- [Business rules](business-rules.md)
- [SQL catalog](sql/index.md)
- [API reference](api/index.md)

## Sources
- SAIF.Framework.Preferences\PreferenceData.cs
