MySQL 9.1.0
Source Code Documentation
dd::Entity_object_impl Class Reference

#include <entity_object_impl.h>

Inheritance diagram for dd::Entity_object_impl:
[legend]

Public Member Functions

 Entity_object_impl ()
 
Object_id id () const override
 The unique dictionary object id. More...
 
void set_id (Object_id id)
 
bool is_persistent () const override
 Is dictionary object persistent in dictionary tables ? More...
 
const String_typename () const override
 
void set_name (const String_type &name) override
 
Object_keycreate_primary_key () const override
 
bool has_new_primary_key () const override
 Indicates that object is guaranteed to have primary key value which doesn't exist in database (e.g. More...
 
Entity_object_implimpl () override
 
const Entity_object_implimpl () const override
 
- Public Member Functions inherited from dd::Weak_object
virtual void debug_print (String_type &outb) const =0
 
 Weak_object ()=default
 
 Weak_object (const Weak_object &)=default
 
virtual ~Weak_object ()=default
 
- Public Member Functions inherited from dd::Weak_object_impl_< use_pfs >
 Weak_object_impl_ ()=default
 
 ~Weak_object_impl_ () override=default
 
void * operator new (size_t size, const std::nothrow_t &nt) noexcept
 
void operator delete (void *ptr, const std::nothrow_t &nt) noexcept
 
void * operator new (size_t size) noexcept
 
void operator delete (void *ptr) noexcept
 
virtual const Object_tableobject_table () const =0
 
virtual bool validate () const =0
 
virtual bool store (Open_dictionary_tables_ctx *otx)
 Store the DD object into DD table. More...
 
bool drop (Open_dictionary_tables_ctx *otx) const
 Drop the DD object from DD table. More...
 
virtual bool restore_attributes (const Raw_record &r)=0
 
virtual bool store_attributes (Raw_record *r)=0
 
virtual bool restore_children (Open_dictionary_tables_ctx *)
 
virtual bool store_children (Open_dictionary_tables_ctx *)
 
virtual bool drop_children (Open_dictionary_tables_ctx *) const
 

Protected Member Functions

void set_primary_key_value (const Raw_new_record &r) override
 
void fix_has_new_primary_key () override
 
void restore_id (const Raw_record &r, int field_idx)
 
void restore_name (const Raw_record &r, int field_idx)
 
bool store_id (Raw_record *r, int field_idx)
 
bool store_name (Raw_record *r, int field_idx)
 
bool store_name (Raw_record *r, int field_idx, bool is_null)
 
void serialize (Sdi_wcontext *wctx, Sdi_writer *w) const
 
bool deserialize (Sdi_rcontext *rctx, const RJ_Value &val)
 
 Entity_object_impl (const Entity_object_impl &src)
 
- Protected Member Functions inherited from dd::Weak_object_impl_< use_pfs >
bool check_parent_consistency (Entity_object_impl *parent, Object_id parent_id) const
 

Private Attributes

Object_id m_id
 
String_type m_name
 
bool m_has_new_primary_key
 Indicates that object is guaranteed to have ID which doesn't exist in database because it will be or just was generated using auto-increment. More...
 

Constructor & Destructor Documentation

◆ Entity_object_impl() [1/2]

dd::Entity_object_impl::Entity_object_impl ( )
inline

◆ Entity_object_impl() [2/2]

dd::Entity_object_impl::Entity_object_impl ( const Entity_object_impl src)
inlineprotected

Member Function Documentation

◆ create_primary_key()

Object_key * dd::Entity_object_impl::create_primary_key ( ) const
overridevirtual

◆ deserialize()

bool dd::Entity_object_impl::deserialize ( Sdi_rcontext rctx,
const RJ_Value val 
)
protected

◆ fix_has_new_primary_key()

void dd::Entity_object_impl::fix_has_new_primary_key ( )
inlineoverrideprotectedvirtual

Reimplemented from dd::Weak_object_impl_< use_pfs >.

◆ has_new_primary_key()

bool dd::Entity_object_impl::has_new_primary_key ( ) const
inlineoverridevirtual

Indicates that object is guaranteed to have primary key value which doesn't exist in database (e.g.

because it only will be generated using auto-increment at store() time). So it is ok for store() method to skip lookup of existing object with the same primary key and simply try to insert new object into the table.

Implements dd::Weak_object_impl_< use_pfs >.

Reimplemented in dd::Index_stat_impl, and dd::Table_stat_impl.

◆ id()

◆ impl() [1/2]

◆ impl() [2/2]

◆ is_persistent()

◆ name()

◆ restore_id()

void dd::Entity_object_impl::restore_id ( const Raw_record r,
int  field_idx 
)
protected

◆ restore_name()

void dd::Entity_object_impl::restore_name ( const Raw_record r,
int  field_idx 
)
protected

◆ serialize()

void dd::Entity_object_impl::serialize ( Sdi_wcontext wctx,
Sdi_writer w 
) const
protected

◆ set_id()

void dd::Entity_object_impl::set_id ( Object_id  id)
inline

◆ set_name()

◆ set_primary_key_value()

void dd::Entity_object_impl::set_primary_key_value ( const Raw_new_record r)
overrideprotectedvirtual

Reimplemented from dd::Weak_object_impl_< use_pfs >.

◆ store_id()

bool dd::Entity_object_impl::store_id ( Raw_record r,
int  field_idx 
)
protected

◆ store_name() [1/2]

bool dd::Entity_object_impl::store_name ( Raw_record r,
int  field_idx 
)
protected

◆ store_name() [2/2]

bool dd::Entity_object_impl::store_name ( Raw_record r,
int  field_idx,
bool  is_null 
)
protected

Member Data Documentation

◆ m_has_new_primary_key

bool dd::Entity_object_impl::m_has_new_primary_key
private

Indicates that object is guaranteed to have ID which doesn't exist in database because it will be or just was generated using auto-increment.

Main difference of this member from result of m_id == INVALID_OBJECT_ID check is that we delay resetting of this flag until end of store() method while m_id is updated right after object was inserted into the table. This is necessary to let entity's children figure out that their parent has new ID which was not used before (and hence their primary keys based on this ID will be new too) while still giving access to the exact value of new ID.

◆ m_id

Object_id dd::Entity_object_impl::m_id
private

◆ m_name

String_type dd::Entity_object_impl::m_name
private

The documentation for this class was generated from the following files: