Wt  3.7.1
Classes | Enumerations | Functions | Variables
Wt::Dbo Namespace Reference

Namespace for the Database Objects (Wt::Dbo). More...

Classes

class  AbstractQuery
 An abstract dynamic database query. More...
 
class  Call
 A database call. More...
 
class  collection
 An STL container for iterating query results. More...
 
class  Dbo
 A base class for database objects. More...
 
class  dbo_default_traits
 Default traits for a class mapped with Wt::Dbo. More...
 
class  dbo_traits
 Traits for a class mapped with Wt::Dbo. More...
 
class  DirectBinding
 
class  DynamicBinding
 
class  Exception
 Exception base class for Wt::Dbo. More...
 
class  FieldInfo
 Description of a field. More...
 
class  FixedSqlConnectionPool
 A connection pool of fixed size. More...
 
class  ForeignKeyConstraint
 Type that indicates one or more foreign key constraints. More...
 
class  JsonSerializer
 An action to serialize objects to JSON. More...
 
class  NoUniqueResultException
 Exception thrown when a query unexpectedly finds a non-unique result. More...
 
class  ObjectNotFoundException
 Exception thrown when trying to load a non-existing object. More...
 
class  ptr
 A smart pointer for a database object. More...
 
struct  ptr_tuple
 A utility class for defining a tuple of database objects. More...
 
class  Query
 A database query. More...
 
class  query_result_traits
 Traits class for result types. More...
 
class  QueryModel
 A Wt MVC Model to view/edit query results. More...
 
class  Session
 A database session. More...
 
class  sql_value_traits
 Traits class for value types. More...
 
class  SqlConnection
 Abstract base class for an SQL connection. More...
 
class  SqlConnectionPool
 Abstract base class for a SQL connection pool. More...
 
class  SqlStatement
 Abstract base class for a prepared SQL statement. More...
 
class  StaleObjectException
 Exception thrown when Wt::Dbo detects a concurrent modification More...
 
class  Transaction
 A database transaction. More...
 
class  weak_ptr
 A weak pointer for a database object. More...
 

Enumerations

enum  RelationType { ManyToOne, ManyToMany }
 Type of an SQL relation. More...
 
enum  FlushMode { Auto, Manual }
 Enumeration that indicates the flush mode. More...
 
enum  SqlDateTimeType { SqlDate, SqlDateTime, SqlTime }
 Enum that defines a date time type. More...
 
enum  LimitQuery {
  Limit, RowsFromTo, Rownum, OffsetFetch,
  NotSupported
}
 Enum that defines a limit query type. More...
 

Functions

ForeignKeyConstraint operator| (ForeignKeyConstraint lhs, ForeignKeyConstraint rhs)
 Combines two constraints.
 
template<class Action , typename V >
void id (Action &action, V &value, const std::string &name="id", int size=-1)
 Maps a natural primary key (id) field. More...
 
template<class Action , class C >
void id (Action &action, ptr< C > &value, const std::string &name, ForeignKeyConstraint constraints, int size=-1)
 Maps a natural primary key (id) field that is a foreign key. More...
 
template<class Action , typename V >
void field (Action &action, V &value, const std::string &name, int size=-1)
 Maps a database object field. More...
 
template<class Action , class C >
void belongsTo (Action &action, ptr< C > &value, const std::string &name=std::string())
 Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation. More...
 
template<class Action , class C >
void belongsTo (Action &action, ptr< C > &value, const std::string &name, ForeignKeyConstraint constraints)
 Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation. More...
 
template<class Action , class C >
void belongsTo (Action &action, ptr< C > &value, ForeignKeyConstraint constraints)
 Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation. More...
 
template<class Action , class C >
void hasOne (Action &action, weak_ptr< C > &value, const std::string &name=std::string())
 Maps the "One"-side of a OneToOne relation. More...
 
template<class Action , class C >
void hasMany (Action &action, collection< ptr< C > > &value, RelationType type, const std::string &name=std::string())
 Maps the "Many"-side of a ManyToOne or ManyToMany relation. More...
 
template<class Action , class C >
void hasMany (Action &action, collection< ptr< C > > &value, RelationType type, const std::string &name, const std::string &joinId, ForeignKeyConstraint constraints=(NotNull|OnDeleteCascade))
 Maps the "Many"-side of a ManyToMany relation. More...
 
template<typename C >
void jsonSerialize (const C &c, std::ostream &out)
 Serialize the given object to the given ostream. More...
 
template<typename C >
void jsonSerialize (const ptr< C > &c, std::ostream &out)
 Serialize the object pointed to by the given ptr to the given ostream. More...
 
template<typename C >
void jsonSerialize (const std::vector< ptr< C > > &v, std::ostream &out)
 Serialize a vector of ptrs to the given ostream. More...
 
template<typename C >
void jsonSerialize (const collection< C > &c, std::ostream &out)
 Serialize a collection of ptrs to the given ostream. More...
 

Variables

const ForeignKeyConstraint NotNull
 A constraint that prevents a null ptr. More...
 
const ForeignKeyConstraint OnUpdateCascade
 A constraint that cascades updates. More...
 
const ForeignKeyConstraint OnUpdateSetNull
 A constraint that cascades updates. More...
 
const ForeignKeyConstraint OnDeleteCascade
 A constraint that cascades deletes. More...
 
const ForeignKeyConstraint OnDeleteSetNull
 A constraint that cascades deletes. More...
 

Detailed Description

Namespace for the Database Objects (Wt::Dbo).

Enumeration Type Documentation

◆ FlushMode

Enumeration that indicates the flush mode.

See also
setFlushMode(), discardUnflushed()
Enumerator
Auto 

Dbo decides when to flush changes to a transaction.

Manual 

Changes are never automatically flushed.

◆ LimitQuery

Enum that defines a limit query type.

Oracle is using Rownum, Firebird is using RowsFromTo, and Microsoft SQL Server is using Top instead of limit and offset in SQL

Enumerator
Limit 

Use LIMIT and OFFSET.

RowsFromTo 

Use ROWS ? TO ? (for Firebird)

Rownum 

Use rownum (for Oracle)

OffsetFetch 

Use OFFSET (?) ROWS FETCH FIRST (?) ROWS ONLY (adding ORDER BY (SELECT NULL) for SQL Server)

NotSupported 

Not supported.

◆ SqlDateTimeType

Enum that defines a date time type.

Enumerator
SqlDate 

Date only.

SqlDateTime 

Date and time.

SqlTime 

Time duration.

Function Documentation

◆ jsonSerialize() [1/4]

template<typename C >
void Wt::Dbo::jsonSerialize ( const C &  c,
std::ostream &  out 
)

Serialize the given object to the given ostream.

See also
JsonSerializer::serialize()

◆ jsonSerialize() [2/4]

template<typename C >
void Wt::Dbo::jsonSerialize ( const ptr< C > &  c,
std::ostream &  out 
)

Serialize the object pointed to by the given ptr to the given ostream.

See also
JsonSerializer::serialize()

◆ jsonSerialize() [3/4]

template<typename C >
void Wt::Dbo::jsonSerialize ( const std::vector< ptr< C > > &  v,
std::ostream &  out 
)

Serialize a vector of ptrs to the given ostream.

See also
JsonSerializer::serialize()

◆ jsonSerialize() [4/4]

template<typename C >
void Wt::Dbo::jsonSerialize ( const collection< C > &  c,
std::ostream &  out 
)

Serialize a collection of ptrs to the given ostream.

See also
JsonSerializer::serialize()

Generated on Tue Dec 15 2020 for the C++ Web Toolkit (Wt) by doxygen 1.8.13