Wt: Wt::Dbo::dbo_default_traits Class Reference

Wt 3.3.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Types | Static Public Member Functions
Wt::Dbo::dbo_default_traits Class Reference
Database Objects (Wt::Dbo)

Default traits for a class mapped with Wt::Dbo. More...

`#include <Wt/Dbo/Dbo>`

Inheritance diagram for Wt::Dbo::dbo_default_traits:
[legend]

List of all members.

## Public Types
typedef long long | IdType
| Type of the primary key.
## Static Public Member Functions
static IdType | invalidId ()
| Returns the sentinel value for a `null` id.
static const char * | surrogateIdField ()
| Returns the database field name for the surrogate primary key.
static const char * | versionField ()
| Configures the optimistic concurrency version field.

## Detailed Description

Default traits for a class mapped with Wt::Dbo.

This class provides the default traits. It is convenient (and future proof) to inherit these default traits when customizing the traits for one particular class.

## Member Typedef Documentation

typedef long long Wt::Dbo::dbo_default_traits::IdType

Type of the primary key.

The default corresponds to a surrogate key, which is `long long`.

Reimplemented in Wt::Dbo::dbo_traits< C >, Wt::Dbo::dbo_traits< AuthToken< AuthInfoType > >, Wt::Dbo::dbo_traits< UserType >, Wt::Dbo::dbo_traits< DboType >, Wt::Dbo::dbo_traits< AuthInfo< UserType > >, Wt::Dbo::dbo_traits< AuthIdentity< AuthInfoType > >, and Wt::Dbo::dbo_traits< AuthInfoType >.

## Member Function Documentation

static IdType Wt::Dbo::dbo_default_traits::invalidId | ( |  | ) | `[static]`

Returns the sentinel value for a `null` id.

The default implementation returns -1.

Reimplemented in Wt::Dbo::dbo_traits< C >, Wt::Dbo::dbo_traits< AuthToken< AuthInfoType > >, Wt::Dbo::dbo_traits< UserType >, Wt::Dbo::dbo_traits< DboType >, Wt::Dbo::dbo_traits< AuthInfo< UserType > >, Wt::Dbo::dbo_traits< AuthIdentity< AuthInfoType > >, and Wt::Dbo::dbo_traits< AuthInfoType >.

static const char* Wt::Dbo::dbo_default_traits::surrogateIdField | ( |  | ) | `[static]`

Returns the database field name for the surrogate primary key.

The default surrogate id database field name is `"id"`.

Reimplemented in Wt::Dbo::dbo_traits< C >, Wt::Dbo::dbo_traits< AuthToken< AuthInfoType > >, Wt::Dbo::dbo_traits< UserType >, Wt::Dbo::dbo_traits< DboType >, Wt::Dbo::dbo_traits< AuthInfo< UserType > >, Wt::Dbo::dbo_traits< AuthIdentity< AuthInfoType > >, and Wt::Dbo::dbo_traits< AuthInfoType >.

static const char* Wt::Dbo::dbo_default_traits::versionField | ( |  | ) | `[static]`

Configures the optimistic concurrency version field.

By default, optimistic concurrency locking is enabled using a `"version"` field.

Reimplemented in Wt::Dbo::dbo_traits< C >, Wt::Dbo::dbo_traits< AuthToken< AuthInfoType > >, Wt::Dbo::dbo_traits< UserType >, Wt::Dbo::dbo_traits< DboType >, Wt::Dbo::dbo_traits< AuthInfo< UserType > >, Wt::Dbo::dbo_traits< AuthIdentity< AuthInfoType > >, and Wt::Dbo::dbo_traits< AuthInfoType >.

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator