SourcePro® 2024.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 RWDBIdentityConstraint &idC) | |
RWDBIdentityConstraint (const RWDBValue &startWith, const RWDBValue &incrementBy, const RWDBValue &maxValue, const RWDBValue &minValue, bool cycle) | |
bool | cycle () const |
RWDBIdentityConstraint & | cycle (bool cycle) |
RWDBValue | incrementBy () const |
RWDBIdentityConstraint & | incrementBy (const RWDBValue &incrementBy) |
bool | isValid () const |
RWDBValue | maxValue () const |
RWDBIdentityConstraint & | maxValue (const RWDBValue &max) |
RWDBValue | minValue () const |
RWDBIdentityConstraint & | minValue (const RWDBValue &min) |
RWDBIdentityConstraint & | operator= (const RWDBIdentityConstraint &idC) |
RWDBValue | startWith () const |
RWDBIdentityConstraint & | startWith (const RWDBValue &startWith) |
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.
bool RWDBIdentityConstraint::cycle | ( | ) | const |
Returns true
if the CYCLE attribute is set.
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.
RWDBValue RWDBIdentityConstraint::incrementBy | ( | ) | const |
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.
bool RWDBIdentityConstraint::isValid | ( | ) | const |
Returns true
if self is an identity column (or any properties for defining identity columns are set).
RWDBValue RWDBIdentityConstraint::maxValue | ( | ) | const |
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::minValue | ( | ) | 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.
RWDBIdentityConstraint & RWDBIdentityConstraint::operator= | ( | const RWDBIdentityConstraint & | idC | ) |
Assignment operator. Self copies the implementation of idC.
RWDBValue RWDBIdentityConstraint::startWith | ( | ) | const |
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 © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |