Replacing data in column

I have some data in a column that can either be a 1 or 2, and is stored as an int. How can I replace this with a string?


EDIT: Just to clarify, I don’t want to change it in the database, only on display level.

Fixed with a generated column. Still struggling to understand when I need to inject and entity vs when to use entity.getXYZ().


import com.haulmont.cuba.gui.components.*;
import com.haulmont.cuba.gui.xml.layout.ComponentsFactory;
import com.haulmont.cuba.core.entity.Entity;

import javax.inject.Inject;
import java.util.List;
import java.util.Map;

public class CheckResultsBrowse extends AbstractLookup {
    private Table<CheckResults> checkResultsesTable;

    private ComponentsFactory componentsFactory;

    public void init(Map<String, Object> params) {

        checkResultsesTable.addGeneratedColumn("Check Result", entity ->  {

                Label field = componentsFactory.createComponent(Label.class);
                if (entity.getResult() == 1) {
                } else {

                return field;