It seems UniqueNumbersService was removed in Jmix, with no mention in the migration docs.
Any advice on how to replace its functionality? We have a lot of uses of it.
It seems UniqueNumbersService was removed in Jmix, with no mention in the migration docs.
Any advice on how to replace its functionality? We have a lot of uses of it.
Use UniqueNumbersAPI in migrated projects or io.jmix.data.Sequences in new Jmix projects.
Regards,
Konstantin
I’ll check that out. Consider adding this to the migration docs? 
Not sure. UniqueNumbersAPI is a well known CUBA interface, and now in Jmix it has a Javadoc saying what to use instead. We cannot explain all possible use cases and replacements anyway.
But UniqueNumbersService simply doesn’t exist in Jmix and prevents compile obviously… And there’s no pointer as to what to replace it with.
We cannot explain all possible use cases and replacements anyway.
That’s true. Still, this migration is not very smooth. I shudder to think what people with larger, finished apps, will go through.
Use
UniqueNumbersAPIin migrated projects orio.jmix.data.Sequencesin new Jmix projects.
Also, most of my uses are in entity classes where in CUBA, injection wasn’t possible and AppBeans.get() was used. This seems to be gone in Jmix, so… advice on how to get access to UniqueNumbersAPI in an entity class?
how to get access to
UniqueNumbersAPIin an entity class?
You can create your own AppBeans class in your project, see this topic: Is there any alternatives to AppBeans
Is UniqueNumbersAPI avaliable in version 2 JMIX?
Thank you Mario
Hi,
Also was necessary to found a solution for this when I start to rewrite code to switch from Cuba to Jmix.
Look at my code (method onPreSave)
package com.genebank.genedatabank.view.pasaport;
import com.flowingcode.vaadin.addons.googlemaps.GoogleMap;
import com.flowingcode.vaadin.addons.googlemaps.GoogleMapMarker;
import com.flowingcode.vaadin.addons.googlemaps.LatLon;
import com.flowingcode.vaadin.addons.googlemaps.Markers;
import com.genebank.genedatabank.entity.Pasaport;
import com.genebank.genedatabank.entity.SysFile;
import com.genebank.genedatabank.view.main.MainView;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.vaadin.flow.component.ClickEvent;
import com.vaadin.flow.component.details.Details;
import com.vaadin.flow.component.grid.ItemClickEvent;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.server.StreamResource;
This file has been truncated. show original
In my code I used two separated sequences numbers for two Institution.
I used solution from Documentation, link posted by Mario.