Added validations support for Doctrine 2 ORM

Validations occur in preFlush event and only entities scheduled
for inserts or updates are checked.