Problem with query custom using spring boot

Viewed 24

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

1 Answers

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")
Related