I have the following problem.
My entity:
@Entity
@Table(schema = "esquema",name="tabela")
public class Exemplo{
@Id
private Integer exemploid;
@ManyToOne
@JoinColumn(name = "attid")
private Atributo att;
...
}
My Query:
public interface ExemploRepository extends JpaRepository<Exemplo, Integer>{
@Query("select et from esquema.tabela et where et.attid = ?1")
List<Exemplo> findTop500ByAttid(Integer attid);
...
}
I get the following error:
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: schema.table is not mapped
It seems to me that it is not recognizing the schema (I use schemas in Postgres), what would be the error in my mapping?