import { Utils } from '@mikro-orm/core';
import { getMetadataFromDecorator } from '../utils.js';
/** Marks a class as a MikroORM entity (legacy TypeScript decorator). */
export function Entity(options = {}) {
  return function (target) {
    const meta = getMetadataFromDecorator(target);
    Utils.mergeConfig(meta, options);
    meta.class = target;
    if (!options.abstract || meta.discriminatorColumn) {
      meta.name = target.name;
    }
  };
}
