Added validations support for Doctrine 2 ORM

Validation occurs in preFlush event and only entities scheduled
for inserts or updates are checked.