我使用的是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;
}
答案 0 :(得分:1)
正如杰克所说,我看到了应用程序属性文件,我发现我忘了更改 spring.datasource.url 属性!!
对不起我的问题! 现在工作正常!