Previous: Testing entities, Up: Entities


2.4.1.3 Getting and setting entity data
— Function: int fdm_get_entity_num_attributes (fdm_t fdm, ferret_string_t ename)

Return the number of attributes ename has.

— Function: int fdm_get_entity_type (fdm_t fdm, ferret_string_t ename)

Return the type of entity ename.

Legal values are:

FDM_ENTITY_TYPE_NULL
The entity has not a defined type. This should always be considered as an inconsistency on the data model.
FDM_ENTITY_TYPE_STRONG
The entity is a strong entity (see the user's guide for more details about strong entities).
FDM_ENTITY_TYPE_WEAK
The entity is a weak entity with existence constraint (see the user's guide for more details about weak entities).
FDM_ENTITY_TYPE_WEAKE
The entity is a weak entity with existence constraint and ID-dependant (see the user's guide for more details about weak by ID entities).
— Function: ferret_status_t fdm_set_entity_type (fdm_t fdm, ferret_string_t ename, int etype)

Set the type of ename. See the documentation for fdm_get_entity_type for information about legal types.

— Function: ferret_status_t fdm_change_entity_name (fdm_t fdm, ferret_string_t ename, ferret_string_t nename)

Rename the ename entity to nename.

— Function: ferret_string_t fdm_get_entity_attribute_name (fdm_t fdm, ferret_string_t ename, int index)

Return the name of the index-th attribute of the ename entity. Note that the attribute list is indexed by 0.

— Function: ferret_status_t fdm_set_entity_attribute_name (fdm_t fdm, ferret_string_t ename, ferret_string_t aname, ferret_string_t naname)

Rename the attribute aname to naname on entity ename.

— Function: ferret_status_t fdm_add_entity_attribute_group (fdm_t fdm, ferret_string_t ename, ferret_string_t gname)

Add a new attribute group (see the user's guide for more information about attribute groups) name gname to the ename entity.

If there is already an attribute group named gname, then the function return FERRET_ERROR.

— Function: ferret_status_t fdm_remove_entity_attribute_group (fdm_t fdm, ferret_string_t ename, ferret_string_t gname)

Remove the gname attribute group from the ename entity.

— Function: ferret_status_t fdm_add_entity_attribute (fdm_t fdm, ferret_string_t ename, ferret_string_t aname)

Add a new aname attribute to the ename entity.

If there is already an attribute named aname, then FERRET_ERROR is returned.

— Function: ferret_status_t fdm_add_entity_attribute_to_group (fdm_t fdm, ferret_string_t ename, ferret_string_t aname, ferret_string_t gname)

Add the attribute aname to the gname attribute group in the ename entity.

— Function: ferret_status_t fdm_remove_entity_attribute_from_group (fdm_t fdm, ferret_string_t ename, ferret_string_t aname, ferret_string_t gname)

Remove the attribute aname from the gname attribute group in the ename entity.

— Function: ferret_status_t fdm_remove_entity_attribute (fdm_t fdm, ferret_string_t ename, ferret_string_t aname)

Remove the aname attribute from the ename entity.

If the attribute do not exist on the entity, then FERRET_ERROR is returned.

— Function: ferret_string_t fdm_get_entity_short_descr (fdm_t fdm, ferret_string_t ename)

Return the short description of the ename entity.

— Function: ferret_status_t fdm_set_entity_short_descr (fdm_t fdm, ferret_string_t ename, ferret_string_t descr)

Set descr as the new short description for the ename entity.

— Function: ferret_string_t fdm_get_entity_full_descr (fdm_t fdm, ferret_string_t ename)

Return the full description of the ename entity.

— Function: ferret_status_t fdm_set_entity_full_descr (fdm_t fdm, ferret_string_t ename, ferret_string_t descr)

Set descr as the new full description for the ename entity.

— Function: time_t fdm_get_entity_creation_ts (fdm_t fdm, ferret_string_t ename)

Return the creation time-stamp for the ename entity.

— Function: time_t fdm_get_entity_last_modified_ts (fdm_t fdm, ferret_string_t ename)

Return the last modified time-stamp for the ename entity.

— Function: ferret_string_list_t fdm_get_entity_attribute_list (fdm_t fdm, ferret_string_t ename)

Return a ferret string list with all the ordered attribute names.

— Function: int fdm_get_attribute_relative_order (fdm_t fdm, ferret_string_t ename, ferret_string_t aname1, ferret_string_t aname2)

With respecto to the ename entity, this function return: