throw if invalid entities metadata array
added unit of work factory UT
added UT cases for dbal factory