Это постоянное значение, поэтому я не хочу передавать это значение как метод аргументы.
пожалуйста, предложите, какой метод будет для этого.
пример:
У меня есть объект EmailRef
Код: Выделить всё
public class EmailRef {
/* other vareialbe */
@Column(name="is_active") /* this is the field which value is 0 and 1 in DB*/
private Integer active;
/* setter getter method */
}
Код: Выделить всё
public interface EmailRefRepositry extends JpaRepository {
@Query("select * from email_reference where is_active=1") /* this is the query I want to convert into method*/
List findByActive(); /*I want to write method like that which will fetch all data form table where active field value is 1*/
}
Спасибо
Судханшу
Подробнее здесь: https://stackoverflow.com/questions/452 ... eld-to-fet