I have a proxied method in a MongoRepository extender class like this:
public interface InvitationRepository extends MongoRepository<Foo, String>
{
public Foo findByUserIdAndDestinationMail( String userId, String destinationMail );
}
When I try to find a Foo
instance in DB without any destinationMail
by calling:
Foo foo = invitationRepository.findByUserIdAndDestinationMail( userId, null );
MappingMongoConverter
throws a NullPointerException
.
¿Can I find instances with null values with any proxied method?
If I need to create the method in a custom implementation ¿how can I do this with mongoTemplate
? ¿Is there somthing like this?
mongoTemplate.findOne( new Query(
Criteria.where( "userId" ).is( userId ).and( "destinationMail" ).is(... )),
entityClass );
Thank you very much.