fix: support custom repositories with EntitySchema/defineEntity
#235
+100
−8
EntitySchema/defineEntity
#235