connect BaseEntity and create a count for user id