Wt  4.10.4
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
Wt::Dbo::dbo_default_traits Class Reference

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

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

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 charsurrogateIdField ()
 Returns the database field name for the surrogate primary key.
 
static const charversionField ()
 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

◆ IdType

Type of the primary key.

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

Member Function Documentation

◆ invalidId()

static IdType Wt::Dbo::dbo_default_traits::invalidId ( )
static

Returns the sentinel value for a null id.

The default implementation returns -1.

◆ surrogateIdField()

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".

◆ versionField()

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.