Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The implementation in the readme is wrong. #25

Open
codeninja opened this issue Mar 9, 2022 · 3 comments
Open

The implementation in the readme is wrong. #25

codeninja opened this issue Mar 9, 2022 · 3 comments

Comments

@codeninja
Copy link

codeninja commented Mar 9, 2022

Or at least, I was having problems with it.

I could not use the extended repository without invoking getCustomRepository instead of the standard getRepository as stated in the readme.

@Entity()
export class Address implements PolymorphicChildInterface {
....
}

@EntityRepository(Address)
export class AddressRepository extends AbstractPolymorphicRepository<Address> {}
import { Address, AddressRepository } from '../';
let addressRepository: AbstractPolymorphicRepository<Address>;

addressRepository = await TestConnection.connection.getCustomRepository(AddressRepository);
@bashleigh
Copy link
Owner

Ahh sorry, I use this heavily with nestjs so my implementation might be a lot different to yours!

@nizarfadlan
Copy link

Can you give a complete example?

@nizarfadlan
Copy link

@codeninja @bashleigh

Can you give a complete example?

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

No branches or pull requests

3 participants