Hello, I am having problems with the Entity Inspector. I have created an entity named ESCUELA with two fields: rbd and name. Both are required. When I go to entity inspector for escuela, these two fields are shown, as expected but when I press save I get an error. It’s in Spanish but it means “warning , cannot be null” .
Any ideas?
@JmixEntity
@Table(name = “ESCUELA”)
@Entity
public class Escuela {
@JmixGeneratedValue
@Column(name = “ID”, nullable = false)
@Id
private UUID id;
@Column(name = "VERSION", nullable = false)
@Version
private Integer version;
@CreatedBy
@Column(name = "CREATED_BY")
private String createdBy;
@CreatedDate
@Column(name = "CREATED_DATE")
private OffsetDateTime createdDate;
@LastModifiedBy
@Column(name = "LAST_MODIFIED_BY")
private String lastModifiedBy;
@LastModifiedDate
@Column(name = "LAST_MODIFIED_DATE")
private OffsetDateTime lastModifiedDate;
@DeletedBy
@Column(name = "DELETED_BY")
private String deletedBy;
@DeletedDate
@Column(name = "DELETED_DATE")
private OffsetDateTime deletedDate;
@Column(name = "RBD", nullable = false, length = 7)
@NotNull
private String rbd;
@InstanceName
@Column(name = "NOMBRE", nullable = false)
@NotNull
private String nombre;
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getRbd() {
return rbd;
}
public void setRbd(String rbd) {
this.rbd = rbd;
}
public OffsetDateTime getDeletedDate() {
return deletedDate;
}
public void setDeletedDate(OffsetDateTime deletedDate) {
this.deletedDate = deletedDate;
}
public String getDeletedBy() {
return deletedBy;
}
public void setDeletedBy(String deletedBy) {
this.deletedBy = deletedBy;
}
public OffsetDateTime getLastModifiedDate() {
return lastModifiedDate;
}
public void setLastModifiedDate(OffsetDateTime lastModifiedDate) {
this.lastModifiedDate = lastModifiedDate;
}
public String getLastModifiedBy() {
return lastModifiedBy;
}
public void setLastModifiedBy(String lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
}
public OffsetDateTime getCreatedDate() {
return createdDate;
}
public void setCreatedDate(OffsetDateTime createdDate) {
this.createdDate = createdDate;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
update: So I re created the entity only with id, rbd and name and same error from Entity Inspector:
@JmixEntity
@Table(name = “ESCUELA”)
@Entity
public class Escuela {
@JmixGeneratedValue
@Column(name = “ID”, nullable = false)
@Id
private UUID id;
@Column(name = "RBD", nullable = false, length = 7)
@NotNull
private String rbd;
@InstanceName
@Column(name = "NOMBRE", nullable = false)
@NotNull
private String nombre;
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getRbd() {
return rbd;
}
public void setRbd(String rbd) {
this.rbd = rbd;
}
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
}
EDIT 2: When I disable MANDATORY for both fields it works and no more errors. In both scenarios I made sure data was entered in both fields so I am still wondering why this happens.