SourcePro® 2022.1 |
SourcePro® API Reference Guide |
Represents an identity constraint of a column within a table or schema. More...
#include <rw/db/identity.h>
Public Member Functions | |
RWDBIdentityConstraint (bool valid=false) | |
RWDBIdentityConstraint (const RWDBValue &startWith, const RWDBValue &incrementBy, const RWDBValue &maxValue, const RWDBValue &minValue, bool cycle) | |
RWDBIdentityConstraint (const RWDBIdentityConstraint &idC) | |
RWDBIdentityConstraint & | cycle (bool cycle) |
bool | cycle () const |
RWDBIdentityConstraint & | incrementBy (const RWDBValue &incrementBy) |
RWDBValue | incrementBy () const |
bool | isValid () const |
RWDBIdentityConstraint & | maxValue (const RWDBValue &max) |
RWDBValue | maxValue () const |
RWDBIdentityConstraint & | minValue (const RWDBValue &min) |
RWDBValue | minValue () const |
RWDBIdentityConstraint & | operator= (const RWDBIdentityConstraint &idC) |
RWDBIdentityConstraint & | startWith (const RWDBValue &startWith) |
RWDBValue | startWith () const |
An RWDBIdentityConstraint is used to represent an identity column in a database. It is used with RWDBColumn to define an identity column when building up an RWDBSchema in preparation for an RWDBDatabase::createTable() call.
An RWDBIdentityConstraint is also used with RWDBColumn instances in an RWDBSchema. An RWDBSchema is a collection of RWDBColumn objects used to describe a database table. If a column of the database table is an identity column, it is represented by an RWDBIdentityConstraint. The attributes of an identity column are available via the accessor methods in RWDBIdentityConstraint.
The identity column attributes supported by database vendors varies. If an attribute is not defined for the identity column, or not available, the returned RWDBValue will be NULL
and of NoType.
RWDBIdentityConstraint::RWDBIdentityConstraint | ( | bool | valid = false | ) |
Default constructor. No attributes are set. The created identity constraint is not valid unless true
is passed to the constructor.
RWDBIdentityConstraint::RWDBIdentityConstraint | ( | const RWDBValue & | startWith, |
const RWDBValue & | incrementBy, | ||
const RWDBValue & | maxValue, | ||
const RWDBValue & | minValue, | ||
bool | cycle | ||
) |
Constructs a new RWDBIdentityConstraint with the supplied parameters:
RWDBIdentityConstraint::RWDBIdentityConstraint | ( | const RWDBIdentityConstraint & | idC | ) |
Copy constructor. The created constraint is a deep copy of idC.
RWDBIdentityConstraint& RWDBIdentityConstraint::cycle | ( | bool | cycle | ) |
Sets the CYCLE value to cycle. When creating a table, if cycle() is true
, the CYCLE
clause is used during table creation. If not supported by the database vendor, it is silently ignored.
bool RWDBIdentityConstraint::cycle | ( | ) | const |
Returns true
if the CYCLE attribute is set.
RWDBIdentityConstraint& RWDBIdentityConstraint::incrementBy | ( | const RWDBValue & | incrementBy | ) |
Sets the INCREMENT BY value to incrementBy. When creating a table, if incrementBy() is set, then the INCREMENT BY incrementBy
clause is used during table creation. If not supported by the database vendor, it is silently ignored.
RWDBValue RWDBIdentityConstraint::incrementBy | ( | ) | const |
bool RWDBIdentityConstraint::isValid | ( | ) | const |
Returns true
if self is an identity column (or any properties for defining identity columns are set).
RWDBIdentityConstraint& RWDBIdentityConstraint::maxValue | ( | const RWDBValue & | max | ) |
Sets the MAXVALUE value to max. When creating a table, if maxValue() is set, the MAXVALUE max
clause is used during table creation. If not supported by the database vendor, it is silently ignored.
RWDBValue RWDBIdentityConstraint::maxValue | ( | ) | const |
RWDBIdentityConstraint& RWDBIdentityConstraint::minValue | ( | const RWDBValue & | min | ) |
Sets the MINVALUE to min. When creating a table, if minValue() is set, the MINVALUE min
clause is used during table creation. If not supported by the database vendor, it is silently ignored.
RWDBValue RWDBIdentityConstraint::minValue | ( | ) | const |
RWDBIdentityConstraint& RWDBIdentityConstraint::operator= | ( | const RWDBIdentityConstraint & | idC | ) |
Assignment operator. Self copies the implementation of idC.
RWDBIdentityConstraint& RWDBIdentityConstraint::startWith | ( | const RWDBValue & | startWith | ) |
Sets the START WITH value to startWith. When creating a table, if startWith() is set, the START WITH startWith
clause is used during table creation. If not supported by the database vendor, it is silently ignored.
Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |