adapter: added 1:1 support and fixed code-as-id handling