Skip to content
Advertisement

Tag: spring-data

Join many to many tables optionally

I have below tables User Intrest Hobby User_Intrest User_Hobby Now to find user ids who have both interests Eating and Sleeping I have written Output Same as above I also can find user ids with hobbies Smoking, Hiking, Browsing as below Output Now I want to mix these two optionally in a way that if only interests are passed then

How would I write SELECT TOP 25 sql query in Spring data repository

A quick question, because I am sure this is something silly. I have the following query which I can execute in NetBeans sql command window: My goal is to put put it in my ArcustRepository class: public interface ArcustRepository extends JpaRepository { However, that findBytop query doesn’t seem to work and when I start my service with tomcat7 returns this:

Advertisement