use long for entity ids
fix an error in the integration test