You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following error classes were also removed: `CustomRepositoryDoesNotHaveEntityError`, `CustomRepositoryCannotInheritRepositoryError`, `CustomRepositoryNotFoundError`.
308
308
309
+
### `@RelationCount` decorator and `loadRelationCountAndMap`
310
+
311
+
The `@RelationCount` decorator and `SelectQueryBuilder.loadRelationCountAndMap()` method have been removed. Use `@VirtualColumn` or a sub-query in your query builder instead:
312
+
313
+
```typescript
314
+
// Before
315
+
@RelationCount((post:Post) =>post.categories)
316
+
categoryCount: number
317
+
318
+
// After — use @VirtualColumn with a sub-query
319
+
// Replace the junction table name and column names to match your schema
320
+
@VirtualColumn({
321
+
query: (alias) =>
322
+
`SELECT COUNT(*) FROM post_categories_category WHERE postId = ${alias}.id`,
0 commit comments