I generated my data model against postgresql using multi-db support. After which I got this run time error.
Caused by: javax.persistence.PersistenceException: io.jmix.eclipselink.impl.mapping.EntityNotEnhancedException: Entity class User is missing some of enhancing interfaces:PersistenceObject,PersistenceWeaved,PersistenceWeavedFetchGroups
package tools.dataintegration.metl.admin.entity;
import io.jmix.core.entity.annotation.JmixGeneratedValue;
import io.jmix.core.entity.annotation.SystemLevel;
import io.jmix.core.metamodel.annotation.DependsOnProperties;
import io.jmix.core.metamodel.annotation.InstanceName;
import io.jmix.core.metamodel.annotation.JmixEntity;
import io.jmix.security.authentication.JmixUserDetails;
import org.springframework.security.core.GrantedAuthority;
import javax.persistence.*;
import javax.validation.constraints.Email;
import java.util.Collection;
import java.util.Collections;
import java.util.UUID;
@JmixEntity
@Entity(name = “metladm_User”)
@Table(name = “METLADM_USER”, indexes = {
@Index(name = “IDX_METLADM_USER_ON_USERNAME”, columnList = “USERNAME”, unique = true)
})
public class User implements JmixUserDetails {
@Id
@Column(name = "ID")
@JmixGeneratedValue
private UUID id;
@Version
@Column(name = "VERSION", nullable = false)
private Integer version;
@Column(name = "USERNAME", nullable = false)
protected String username;
@SystemLevel
@Column(name = "PASSWORD")
protected String password;
@Column(name = "FIRST_NAME")
protected String firstName;
@Column(name = "LAST_NAME")
protected String lastName;
@Email
@Column(name = "EMAIL")
protected String email;
@Column(name = "ENABLED")
protected Boolean enabled = true;
@Transient
protected Collection<? extends GrantedAuthority> authorities;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public String getPassword() {
return password;
}
@Override
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Boolean getEnabled() {
return enabled;
}
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
public void setPassword(String password) {
this.password = password;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return authorities != null ? authorities : Collections.emptyList();
}
@Override
public void setAuthorities(Collection<? extends GrantedAuthority> authorities) {
this.authorities = authorities;
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return enabled;
}
@InstanceName
@DependsOnProperties({"firstName", "lastName", "username"})
public String getDisplayName() {
return String.format("%s %s [%s]", (firstName != null ? firstName : ""),
(lastName != null ? lastName : ""), username).trim();
}
}