我正在使用 Spring Boot、JPA 和 Postgres,并且我有一个具有多个模式的数据库。我使用 JPA 实现了一个 Web 服务,我收到了这个错误:
ohengine.jdbc.spi.SqlExceptionHelper:错误:未实现跨数据库引用:“kaloudia_db_v2.enumeration.unit”
你知道有什么方法可以克服这个错误吗?
我的课是
@Entity
@Table(name = "unit", schema = "enumeration", catalog = kaloudia_db_v2")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Unit.findAll", query = "SELECT u FROM Unit u"),
@NamedQuery(name = "Unit.findById", query = "SELECT u FROM Unit u WHERE u.id = :id"),
@NamedQuery(name = "Unit.findByNameEn", query = "SELECT u FROM Unit u WHERE u.nameEn = :nameEn"),
@NamedQuery(name = "Unit.findByNameEl", query = "SELECT u FROM Unit u WHERE u.nameEl = :nameEl")})
public class Unit implements Serializable {
private static final long serialVersionUID = 1L;
@Id
JPA函数的调用是:
public Object getAllUnits() {
List<Unit> units = unitRepository.findAll();
return units;
}