fix issue 517

Line 252: missing 'id' results in query data lost while adding rows

Line 285~293: field type 'collection', 'one', 'many' are specific for ODM, add them to avoid Exception of converting PersistentCollection to string while rendering template