Mismatch in documentation: uniqueNumbersAPI vs. UniqueNumbersService

On this documentation page: Sequence Generation - CUBA Platform. Developer’s Manual “uniqueNumbersAPI” is referred to - however in the Studio, going to actually inject, the only thing matching “uniquenumbers” is actually “UniqueNumbersService.”

Is this a case where something was renamed and the documentation not updated?

Hi,

The documentation is correct and describes both UniqueNumbersAPI and UniqueNumbersService.

The main part of this mechanism is the UniqueNumbers bean with the UniqueNumbersAPI interface. The bean is available in the Middleware block.

i.e. UniqueNumbersAPI is available in the core module, e.g. in a service implementation.

The getNextNumber() method of the UniqueNumbersService service is used to get sequence values in client blocks.

UniqueNumbersService uses UniqueNumbersAPI under the hood:

@Service(UniqueNumbersService.NAME)
public class UniqueNumbersServiceBean implements UniqueNumbersService {

    @Inject
    protected UniqueNumbersAPI uniqueNumbers;

    @Override
    @Transactional
    public long getNextNumber(String domain) {
        return uniqueNumbers.getNextNumber(domain);
    }
}

Regards,
Gleb