Added @BeforeInsert and @BeforeUpdate annotation.