Migratiion from Cuba 7.2 to JMIX 1.5 problem

I want to migrate a small program from from Cuba 7.2 to JMIX 1.5
Unfortunately at least 2 problem on Data Model side was exists.

  1. Cannot resolve symbol ‘DdlGeneration’
    This problem can fix by manual replace the import command
    From
    import com.haulmont.cuba.core.global.DdlGeneration;
    To
    import io.jmix.data.DdlGeneration;

  2. Cannot resolve symbol ‘BaseStringIdEntity’
    I don’t known how to fix it.

圖片

Hello @kenneth2mail,

1 - Yes, you can replace DdlGeneration manually. Just replace com.haulmont.cuba.core.global.DdlGenerationio.jmix.data.DdlGeneration

2 - You don’t need to use the BaseStringIdEntity class in Jmix. You only need to add @JmixEntity that’s enough for the platform. And make sure your id field in your class is of type string.

  @Column(name = "ID", nullable = false)
  @Id
  private String id;

Migration docs - Migration from CUBA Platform :: Jmix Documentation

Regards,
Nikita

1 Like

Thanks for your help, the Data Model seem fine.
But when I use datamanager to load this entity, I got the following error.

error: no suitable method found for load(Class<E02IssType>)

    public E02IssType getTypID(String typid) {
        return dataManager.load(E02IssType.class)
                .query("e.typid = :typid")
                .parameter("typid", typid)
                .one();
    }

Below please find my Data Model Code

import io.jmix.core.metamodel.annotation.InstanceName;
import io.jmix.core.metamodel.annotation.JmixEntity;
import io.jmix.data.DdlGeneration;

import javax.persistence.*;
import java.util.Date;

@DdlGeneration(value = DdlGeneration.DbScriptGenerationMode.DISABLED)
@JmixEntity
@Table(name = "E02_ISS_TYPE")
@Entity(name = "iccms_E02IssType")
public class E02IssType {
    @Column(name = "TYPID", nullable = false, length = 3)
    @Id
    private String typid;

    @Column(name = "CREATE_TS")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTs;

    @Column(name = "CREATED_BY", length = 50)
    private String createdBy;

    @InstanceName
    @Column(name = "NAME", length = 40)
    private String name;

    @Column(name = "UPDATE_TS")
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTs;

    @Column(name = "UPDATED_BY", length = 50)
    private String updatedBy;

    @Column(name = "VERSION", nullable = false)
    private Integer version;

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

    public Date getUpdateTs() {
        return updateTs;
    }

    public void setUpdateTs(Date updateTs) {
        this.updateTs = updateTs;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Date getCreateTs() {
        return createTs;
    }

    public void setCreateTs(Date createTs) {
        this.createTs = createTs;
    }

    public String getTypid() {
        return typid;
    }

    public void setTypid(String typid) {
        this.typid = typid;
    }
}

I kenneth2mail.
I have the same issue, after project migration all the dataManager.load istructions give this error.
Have you solved this problem?