Skip to content

Commit

Permalink
improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Yingjian Wu committed Jun 6, 2024
1 parent 787f394 commit a113d76
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,35 @@
*/
public final class ParentChildRelMetadataConstants {
/**
* Key specified in DefinitionMetadata that indicate the parent table name.
* During create, top level key specified in DefinitionMetadata that indicate the parent table name.
*/
public static final String PARENTNAME = "root_table_name";
/**
* During create, the key specified in DefinitionMetadata that indicates the parent table uuid.
* During create, top level key specified in DefinitionMetadata that indicates the parent table uuid.
*/
public static final String PARENTUUID = "root_table_uuid";
/**
* During create, the key specified in DefinitionMetadata that indicates the child table uuid.
* During create, top level key specified in DefinitionMetadata that indicates the child table uuid.
*/
public static final String CHILDUUID = "child_table_uuid";

/**
* During create, the key specified in DefinitionMetadata that indicates relationType.
* During create, top level key specified in DefinitionMetadata that indicates relationType.
*/
public static final String RELATIONTYPE = "relationType";

/**
* During get, the key specified in DefinitionMetadata that indicates the parent child infos.
* During get, top level key specified in DefinitionMetadata that indicates the parent child infos.
*/
public static final String PARENTCHILDRELINFO = "parentChildRelationInfo";

/**
* During get, the key specified in DefinitionMetadata[PARENTCHILDRELINFO] that indicates parent infos.
* During get, the nested key specified in DefinitionMetadata[PARENTCHILDRELINFO] that indicates parent infos.
*/
public static final String PARENTINFOS = "parentInfos";

/**
* During get, the key specified in DefinitionMetadata[PARENTCHILDRELINFO] that indicates child infos.
* During get, the nested key specified in DefinitionMetadata[PARENTCHILDRELINFO] that indicates child infos.
*/
public static final String CHILDINFOS = "childInfos";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public interface ParentChildRelMetadataService {
* Establishes a parent-child relationship with a specified relation type.
* Currently, exceptions are thrown in the following cases:
* 1. Attempting to create a child table as the parent of another child table.
* 2. A child table having more than one parent.
* 2. Attempting to create a parent table on top of a parent table
* 3. A child table having more than one parent.
*
* @param parentName the name of the parent entity
* @param parentUUID the uuid of the parent
Expand Down Expand Up @@ -51,12 +52,13 @@ void deleteParentChildRelation(

/**
* Renames `oldName` to `newName` in the parentChildRelationship store.
* If the uuid is specified, we will only rename that table with the specified uuid
* If the uuid is not specified, we will rename that table
* This involves two steps:
* 1. Rename all records where the child is `oldName` to `newName`
* and if the uuid is present also include it in the sql search string.
* 2. Rename all records where the parent is `oldName` to `newName`
* and if the uuid is present also include it in the sql search string.
* For now, since a child cannot be a parent of another entity, only one of these actions will need to be performed.
*
* @param oldName the current name to be renamed
* @param newName the new name to rename to
Expand All @@ -70,12 +72,8 @@ void rename(

/**
* Removes the entity from the parentChildRelationship store.
* An exception is thrown if an attempt is made to drop a parent table that still has existing child tables.
* Note that only dropping a child table will result in the physical deletion of records.
* When all children of a parent table are dropped, no records remain.
* Consequently, at then time when dropping the parent table, there should not have any database records
* with a parent reference to the dropping parent table.
*
* If the uuid is specified, we will only drop that table with the specified uuid
* If the uuid is not specified, we will drop that table
* @param name the name of the entity to drop
* @param uuid the uuid of the entity
*/
Expand All @@ -86,7 +84,8 @@ void drop(

/**
* get the set of parent for the input name.
*
* If the uuid is specified, we will only getParents for that table and the specified uuid
* If the uuid is not specified, we will getParents for that table
* @param name name
* @param uuid the uuid of the entity
* @return parentInfo
Expand All @@ -98,7 +97,8 @@ Set<ParentInfo> getParents(

/**
* get the set of children for the input name.
*
* If the uuid is specified, we will only getChildren for that table and the specified uuid
* If the uuid is not specified, we will getChildren for that table
* @param name name
* @param uuid the uuid of the entity
* @return a set of ChildInfo
Expand Down

0 comments on commit a113d76

Please sign in to comment.