Fix entity class,  insertInto method return bad last id when a afterInsert method execute a query