2

I'm trying to make a custom query but the table name is not mapped. Thi is the code, can you help me please?

@Query("FROM sbootuserss WHERE age > 17")

This is the error:

org.hibernate.hql.internal.ast.QuerySyntaxException: sbootuserss is not mapped

Azathoth
  • 21
  • 2
  • Does this answer your question? [org.hibernate.hql.internal.ast.QuerySyntaxException: table is not mapped](https://stackoverflow.com/questions/23018836/org-hibernate-hql-internal-ast-querysyntaxexception-table-is-not-mapped) – Patch Jul 22 '20 at 14:10

1 Answers1

1

Do you also have a model with the appropriate annotation in your application?

 @Table(name = "sbootuserss")
 public class Sbootuserss implements Serializable {

   @Id
   @GeneratedValue(strategy = GenerationType.AUTO)
   private Long id;

   // another fields ... 
 }

And the query:

 @Query("FROM Sbootuserss WHERE age > 17")
Twistleton
  • 2,735
  • 5
  • 26
  • 37