Skip to main content
Version: Next

EntityCaseNamingStrategy

This strategy keeps original entity/property names for table/column.

Hierarchy

Index

Constructors

constructor

Methods

aliasName

  • aliasName(entityName: string, index: number): string
  • Returns alias name for given entity. The alias needs to be unique across the query, which is by default ensured via appended index parameter. It is optional to use it as long as you ensure it will be unique.


    Parameters

    • entityName: string
    • index: number

    Returns string

classToMigrationName

  • classToMigrationName(timestamp: string, customMigrationName?: string): string
  • Return a migration name. This name should allow ordering.


    Parameters

    • timestamp: string
    • optionalcustomMigrationName: string

    Returns string

classToTableName

  • classToTableName(entityName: string): string
  • Return a table name for an entity class


    Parameters

    • entityName: string

    Returns string

columnNameToProperty

  • columnNameToProperty(columnName: string): string
  • Return a property for a column name (used in EntityGenerator).


    Parameters

    • columnName: string

    Returns string

getClassName

  • getClassName(file: string, separator?: string): string
  • Return a name of the class based on its file name


    Parameters

    • file: string
    • separator: string = '-'

    Returns string

getEntityName

  • getEntityName(tableName: string, schemaName?: string): string
  • Return a name of the entity class based on database table name (used in EntityGenerator). Default implementation ignores the schema name.


    Parameters

    • tableName: string
    • optionalschemaName: string

    Returns string

indexName

  • indexName(tableName: string, columns: string[], type: primary | index | unique | foreign | sequence | check): string
  • Returns key/constraint name for given type. Some drivers might not support all the types (e.g. mysql and sqlite enforce the PK name).


    Parameters

    • tableName: string
    • columns: string[]
    • type: primary | index | unique | foreign | sequence | check

    Returns string

joinColumnName

  • joinColumnName(propertyName: string): string
  • Return a join column name for a property


    Parameters

    • propertyName: string

    Returns string

joinKeyColumnName

  • joinKeyColumnName(entityName: string, referencedColumnName?: string, composite?: boolean): string
  • Return the foreign key column name for the given parameters


    Parameters

    • entityName: string
    • optionalreferencedColumnName: string
    • composite: boolean = false

    Returns string

joinTableName

  • joinTableName(sourceEntity: string, targetEntity: string, propertyName: string): string
  • Return a join table name


    Parameters

    • sourceEntity: string
    • targetEntity: string
    • propertyName: string

    Returns string

propertyToColumnName

  • propertyToColumnName(propertyName: string): string
  • Return a column name for a property


    Parameters

    • propertyName: string

    Returns string

referenceColumnName

  • referenceColumnName(): string
  • Return the default reference column name


    Returns string