Question: Let's say I have an entity `Products` that has an int `number` field:

```
@Entity
@Table(name = "products")
public class Product {
    @Id
    @GeneratedValue(generator = "inc")
    @GenericGenerator(name = "inc", strategy = "increment")
    private int id;
    private int number;

    public int getId() {
        return id;
    }

    void setId(int id) {
        this.id = id;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }
}

```

And there is a repository extending `JpaRepository`:

```
@Repository
interface SqlProductRepository extends JpaRepository<Product, Integer> {
    Optional<List<Product>> findProductsByNumberIs0(); //compile error
}

```

Here is the error I get when I start the app:

```
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlProductRepository' defined in com.example.demo.adapter.SqlProductRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract java.util.Optional com.example.demo.product.ProductRepository.findProductsByNumberIs0()! Reason: Failed to create query for method public abstract java.util.Optional com.example.demo.product.ProductRepository.findProductsByNumberIs0()! No property numberIs0 found for type Product!; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.Optional com.example.demo.product.ProductRepository.findProductsByNumberIs0()! No property numberIs0 found for type Product!

```

What can I do to get a list of products that has `number` field equal to 0 ?

Answer: 
This is not supported by query derivation, so you have to put in a little more work. The simplest variant is to provide a JPQL query in an annotation.

```java
@Repository
interface SqlProductRepository extends JpaRepository<Product, Integer> {
    @Query("select p from Product p where number = 0")
    List<Product> someMethodName();
}

```

I removed the `Optional` wrapper since `List` already has a perfect representation of nothing: The empty list.
Try a slight variation on your method name and signature. You should be able to define your repository like this:

```java
@Repository
interface SqlProductRepository extends JpaRepository<Product, Integer> {
    List<Product> findProductsByNumber(int number);
}

```

And then if you want those products where `number == 0`, then you can call your repository's method, passing in `0` as the argument:

```java
List<Product> products = sqlProductRepository.findProductsByNumber(0);

```

This also allows you the flexibility to call `findProductsByNumber()` with any arbitrary number for any other use case.

EDIT: the repository's method should return a `List`, but if no products matching your criteria are found, you will just end up with an empty list.