Topic: How to find an object by spring data nested property? got this error.
How to find an object by spring data nested property? I got this error.
"Invalid derived query! No property parentId found for type Car!" Any work around? Here is the code
public interface CarRepository extends MongoRepository{
Car findByParentId(Long parentId); // ERROR:
}
class Car{
private Offer offer;
//getter setter
}
class Offer{
private Long parentId;
//getter,setter
}
Author: SANJAY
VAMSI
How would Car find By ParentId (Long parentId); // ERROR: possibly work? A Car has no field 'parentID'.
SANJAY
yes. I know. but What's the solution to this ? How to solve this when you want to find by a nested property like above.