@Override
    @SuppressWarnings("unchecked")
    protected <T> Schema<T> writeMessageIdTo(Output output, int fieldNumber,
            Message<T> message) throws IOException
    {
        final BaseHS<T> wrapper = (BaseHS<T>) pojoMapping.get(message.getClass());

        if (wrapper == null)
            throw new UnknownTypeException("pojo: " + message.getClass());

        output.writeUInt32(fieldNumber, wrapper.id, false);

        // TODO allow the wrapper to return an override schema?
        return message.cachedSchema();
    }
Register a {@link Delegate} and assign an id.
<p>
Delegate ids start at 1.
protostuff-runtime-registry/src/main/java/io/protostuff/runtime/ExplicitIdStrategy.java