DB connection and entity mapping