Generate code for EntityAPI