Skip to content
This repository was archived by the owner on Aug 22, 2020. It is now read-only.
This repository was archived by the owner on Aug 22, 2020. It is now read-only.

Is there any way to clear entire data in specific entity and clearing data from multiple entities #20

@akashbiz

Description

@akashbiz

I am trying to clear data from database table(entity). I tried using repository as well as entityManager for this but was unable to achieve this.
Using Repository:

let repository = connection.getRepository(<entityName>);
repository.remove(<entityName>);

Error: Given object does not have a primary column, cannot transform it to database entity.

Using Entity Manager:

let manager = connection.createEntityManager();
manager.remove(<entityName>);

Error: RepositoryNotFoundError: No repository for "Function" was found. Looks like this entity is not registered in current "dbConnectionName" connection?

Any help?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions