MySQL  8.0.20
Source Code Documentation
dd::Entity_object_impl Class Reference

#include <entity_object_impl.h>

Inheritance diagram for dd::Entity_object_impl:
dd::Entity_object dd::Weak_object_impl dd::Weak_object dd::Weak_object dd::Abstract_table_impl dd::Charset_impl dd::Check_constraint_impl dd::Collation_impl dd::Column_impl dd::Column_statistics_impl dd::Event_impl dd::Foreign_key_impl dd::Index_impl dd::Index_stat_impl dd::Parameter_impl dd::Partition_impl dd::Resource_group_impl dd::Routine_impl dd::Schema_impl dd::Spatial_reference_system_impl dd::Table_stat_impl dd::Tablespace_impl dd::Trigger_impl

Public Member Functions

 Entity_object_impl ()
 
virtual Object_id id () const override
 The unique dictionary object id. More...
 
void set_id (Object_id id)
 
virtual bool is_persistent () const override
 Is dictionary object persistent in dictionary tables ? More...
 
virtual const String_typename () const override
 
virtual void set_name (const String_type &name) override
 
virtual Object_keycreate_primary_key () const override
 
virtual 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...
 
virtual Entity_object_implimpl () override
 
virtual 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 ()
 
 Weak_object (const Weak_object &)=default
 
virtual ~Weak_object ()
 
- Public Member Functions inherited from dd::Weak_object_impl
 Weak_object_impl ()
 
virtual ~Weak_object_impl ()
 
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

virtual void set_primary_key_value (const Raw_new_record &r) override
 
virtual 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
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

Implements dd::Weak_object_impl.

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

◆ deserialize()

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

◆ fix_has_new_primary_key()

virtual void dd::Entity_object_impl::fix_has_new_primary_key ( )
inlineoverrideprotectedvirtual

Reimplemented from dd::Weak_object_impl.

◆ has_new_primary_key()

virtual 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.

Reimplemented in dd::Table_stat_impl, and dd::Index_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.

◆ 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: