Skip to content
This repository has been 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

Open
akashbiz opened this issue Jan 4, 2019 · 0 comments

Comments

@akashbiz
Copy link

akashbiz commented Jan 4, 2019

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant