fixed indexing for sql entity mapping