Entity.code is not unique, code + type is unique