Entities, Attributes, Data Types, and Identifiers

Key Takeaways

  • An OutSystems entity maps one-to-one to a physical database table, auto-created on publish via TrueChange — you never write DDL.
  • Entity attribute types are limited to Text, Integer, Decimal, Boolean, and Date Time; there is no separate Date-only type.
  • Auto-generated identifiers are always Long Integer with platform-managed uniqueness; self-defined identifiers can be Text, Integer, or Decimal.
  • OutSystems entities do not store SQL NULL — missing values are represented by type defaults (NullDate, empty string, 0, False).
  • The identifier attribute is auto-indexed; foreign key reference attributes are NOT auto-indexed and require manual index creation.
Last updated: July 2026

Quick Answer: In OutSystems O11, an entity is a physical database table auto-created in the platform's relational store. Each entity has attributes (columns) with specific data types, one identifier attribute acting as the primary key, and optional default values and indexes. The platform manages schema migrations automatically on publish through TrueChange, so you never write DDL or run ALTER TABLE scripts manually.

Entity as Database Table

An OutSystems entity maps one-to-one to a physical table in the underlying relational database (SQL Server or Oracle). When you define an entity in Service Studio's data model canvas and publish the module, OutSystems generates the table with matching column names and types. The entity name becomes the table name, prefixed with OSUSR_ in the physical schema, though you never interact with that physical name directly in your logic.

Unlike a code-first ORM where you write classes and migrations separately, OutSystems merges the model and the migration: editing the entity in Service Studio and publishing IS the migration. The platform's TrueChange engine tracks every structural change and applies it during 1-Click Publish. You never write a CREATE TABLE or ALTER TABLE statement — the platform handles all DDL generation internally and applies it atomically per publish.

Attribute Data Types

OutSystems supports a deliberately constrained set of data types for entity attributes, simpler than raw SQL to keep the model portable across SQL Server and Oracle backends. The exam tests exact type names and their behavior on the platform.

Data TypePhysical StorageTypical UseKey Behavior
TextVariable (nvarchar / VARCHAR2)Names, descriptions, emailsLength is a property you set; default max 2000 chars unless you raise it
Integer4 bytes (INT)Counts, sequence numbers, flagsWhole numbers only; maps to INT
Decimal8 bytes (DECIMAL)Money, measurements, ratingsPrecision and scale are properties; avoid for whole counts
Boolean1 byte / bitTrue/False flagsStored as 0/1 internally
Date Time8 bytes (DATETIME)Timestamps, audit datesAlways stores both date and time; no separate Date-only type

A frequent exam trap: there is no separate Date (date-only) type for entity attributes — the type is always Date Time. If you need a date-only field, you store a Date Time and use NullTime() or truncation logic to ignore the time portion. Another trap: Long Integer does not exist as an entity attribute type. It exists only as a variable and identifier type in logic and for auto-generated identifiers. Entity integer attributes are plain Integer, and you should use Decimal when you need fractional precision.

Identifier Type Safety

Every entity must have exactly one attribute marked as the identifier (primary key). OutSystems auto-generates the identifier unless you explicitly create a self-managed one. The auto-generated identifier is always of type Long Integer and the platform populates it automatically on Create — you never assign it in your logic.

If you bring your own natural key, such as a ProductCode Text attribute marked as identifier, you become responsible for uniqueness and assignment. The exam tests this distinction: auto-generated identifiers are Long Integer, managed by the platform with guaranteed uniqueness; self-defined identifiers can be Text, Integer, or Decimal but shift uniqueness responsibility entirely to the developer. You cannot have a composite (multi-attribute) primary key in OutSystems — if a natural key is composite, you must add a surrogate Long Integer identifier and enforce the composite uniqueness with a dedicated index.

Default value behavior differs by type and is a common exam point. Text defaults to "" (empty string, not null). Integer and Decimal default to 0. Boolean defaults to False. Date Time defaults to NullDate(), which renders as #1900-01-01# and is the platform's null sentinel for dates. Critically, OutSystems avoids SQL NULL for entity attributes — a missing value is represented by the type's default, not a database null. To detect an unset field, you compare against NullDate(), NullIdentifier(), or empty string — never against SQL null.

Database Indexes

You can add indexes to an entity to speed up filtering and joins. The identifier attribute is always indexed automatically by the platform. For other attributes, you create an index in the entity's Indexes section in Service Studio, selecting one or more attributes. Composite indexes are ordered by the attribute sequence you choose, so a composite index on (LastName, FirstName) accelerates queries filtering on LastName but not queries filtering only on FirstName. OutSystems does not auto-index foreign key reference attributes — if you frequently filter or join on a reference attribute, you must add an index on it manually.

Schema Migration

When you change an entity — add an attribute, change a type, rename, or delete — and publish the module, OutSystems applies the change automatically through TrueChange. Adding a new attribute with a default value is non-destructive and fills existing rows with that default. Removing an attribute permanently drops the column and its data; there is no soft-delete or undo. Changing an attribute type triggers an in-place conversion when the types are compatible (e.g., Integer to Decimal) and fails with a publish-time error when incompatible (e.g., Text to Boolean). The platform never asks you to write a migration script. If a publish fails due to data incompatibility, you must resolve the data in the existing environment or keep the old type and add a new attribute.

Test Your Knowledge

In OutSystems O11, what data type is an auto-generated entity identifier?

A
B
C
D
Test Your Knowledge

What is the default value of a Date Time attribute on an OutSystems entity when no value is assigned?

A
B
C
D
Test Your Knowledge

Which statement about database indexes on OutSystems entities is correct?

A
B
C
D