import { AbstractNamingStrategy } from './AbstractNamingStrategy.js';
/**
 * This strategy keeps original entity/property names for table/column.
 */
export class EntityCaseNamingStrategy extends AbstractNamingStrategy {
  classToTableName(entityName, tableName) {
    return tableName ?? entityName;
  }
  joinColumnName(propertyName) {
    return propertyName;
  }
  joinKeyColumnName(entityName, referencedColumnName, composite, tableName) {
    entityName = this.classToTableName(entityName, tableName);
    const name = entityName.substring(0, 1).toLowerCase() + entityName.substring(1);
    if (composite && referencedColumnName) {
      return name + '_' + referencedColumnName;
    }
    return name;
  }
  joinTableName(sourceEntity, targetEntity, propertyName, tableName) {
    return this.classToTableName(sourceEntity, tableName) + '_' + this.propertyToColumnName(propertyName);
  }
  propertyToColumnName(propertyName) {
    return propertyName;
  }
  referenceColumnName() {
    return 'id';
  }
}
