Repository URL to install this package:
|
Version:
0.3.1-2 ▾
|
#pragma once
#include <cpporm/util/macros.h>
CPPORM_BEGIN_NAMESPACE
// Forward declarations
class Entity;
class Attribute;
class PropertyMap;
class AttributeMap;
/*!
* \brief Abstract class to represent database constraints
*
* An constraint maps a C++ object to a database constraint. All constraints should derive from this
* class. It has a name, a set of properties and a set of attributes, all being static members of
* the derived class. It does not contain any internal state.
*/
class CPPORM_EXPORT Constraint
{
public:
/*!
* \brief Destructor
*/
virtual ~Constraint();
/*!
* \brief Get constraint name
* \return The constraint name
*/
virtual const std::string &GetName() const = 0;
/*!
* \brief Get constraint properties
* \return The constraint properties
*/
virtual const PropertyMap &GetProperties() const = 0;
/*!
* \brief Get constraint attributes
* \return The constraint attributes
*/
virtual const AttributeMap &GetAttributes() const = 0;
};
/*!
* \example cpporm/constraint.cpp
*
* This is an example of how to use the Constraint class.
*/
CPPORM_END_NAMESPACE