I am implementing A Cache in DAO layer using Spring Cache by using annotation @Cacheable. This is my following Code .

```
    @Override
@Cacheable(value="saleSegmentCache3")
public List<SaleSegment> findBySuborder(String pincode,long subcatID) {
    // TODO Auto-generated method stub
    System.out.println("String is printing");
    return ssRepo.findSaleSegmentsByPincodeAndSubcategoryIdAndSegmentType(pincode,subcatID, SaleSegmentType.SUBCAT_PINCODE);
}

```

Over here i am able to retreive the data , but i am not being able to put the data into Cache. I am using one more example : 

```
    @Override
@Cacheable(value="saleSegmentCache3" ,key="#soData")
public String findBySuborderTemp(String soData) {
    // TODO Auto-generated method stub
    System.out.println("String XYZZZZZZZ");
    return "MyString";

}

```

Here i am able to Cache the String Perfectly and able to store the data in the cache .
I think Something is wrong with the syntax that i have used