Skip to content

massRename ​

Command: massRename
Category: Mass Operations
Status: Production Ready

Description ​

Rename fields in bulk based on a CDS schema file. This command processes CAP CDS models and creates projection entities with renamed elements, supporting naming conventions like camelCase, snake_case, and case transformations across entire CDS schemas.

Use Cases ​

  • Naming Convention Alignment: Convert field names to match project standards (camelCase, snake_case, etc.)
  • Entity Prefixing: Add prefixes to all entities for namespace organization
  • Case Normalization: Standardize case conventions across legacy or external schemas
  • Field Aliasing: Create projection views with renamed fields for compatibility
  • Schema Evolution: Generate new entity definitions with improved naming

Supported Case Formats ​

FormatExampleUse Case
camelfirstName, lastNameJavaScript, Node.js, CAP conventions
snakefirst_name, last_nameDatabase conventions, Python
lowerfirstname, lastnameLowercase normalization
upperFIRSTNAME, LASTNAMELegacy systems, all-caps conventions

Syntax ​

bash
hana-cli massRename [options]

Aliases ​

  • mr
  • massrename
  • massRN
  • massrn

Command Diagram ​

Parameters ​

ParameterAliasTypeDefaultRequiredDescription
schemasstring-YesPath to CDS schema file (e.g., db/schema.cds)
namespacenstring-NoFilter entities by namespace (optional scoping)
prefixpstring-NoPrefix to add to renamed entities
casecstring-YesCase format for fields (camel, snake, lower, upper)

For a complete list of parameters and options, use:

bash
hana-cli massRename --help

Examples ​

Convert Fields to camelCase with Prefix ​

bash
hana-cli massRename --schema db/schema.cds --prefix app_ --case camelCase

Convert to snake_case Without Prefix ​

bash
hana-cli massRename --schema db/domain.cds --case snake

Filter by Namespace and Apply Case ​

bash
hana-cli massRename --schema db/schema.cds --namespace com.example.types --case camel --prefix api_

Lowercase Normalization ​

bash
hana-cli massRename -s db/schema.cds -c lower

See Also ​