I’m a beginner with Cuba/Java, bare with me.
I have an entity that pulls data from a table, the columns in this table contain IDs that reference another table to get the values.
Example:
checkID column in table B references the checkName column in table A with the same ID
This is my current entity code:
package uk.co.test.reportal.entity;
import javax.persistence.*;
import com.haulmont.cuba.core.global.*;
import java.util.Date;
import com.haulmont.cuba.core.entity.BaseIntIdentityIdEntity;
@DesignSupport("{'imported':true}")
@Table(name = "CheckResults")
@Entity(name = "reportal3$CheckResults")
public class CheckResults extends BaseIntIdentityIdEntity {
private static final long serialVersionUID = 6993637252092407129L;
@Column(name = "CheckID")
protected Integer checkID;
@Column(name = "ClientID")
protected Integer clientID;
@Column(name = "Result")
protected Integer result;
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "\"Timestamp\"")
protected Date timestamp;
public void setCheckID(Integer checkID) {
this.checkID = checkID;
}
public Integer getCheckID() { return checkID; }
public void setClientID(Integer clientID) {
this.clientID = clientID;
}
public Integer getClientID() {
return clientID;
}
public void setResult(Integer result) {
this.result = result;
}
public Integer getResult() {
return result;
}
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
public Date getTimestamp() {
return timestamp;
}
}
This works as is because it lists the table data as expected. However I need to do a query in order to convert the ID to the name. Where would I put this?