Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mmaravich/b430daf319c79aa7fb82d60a5b53b239 to your computer and use it in GitHub Desktop.
Save mmaravich/b430daf319c79aa7fb82d60a5b53b239 to your computer and use it in GitHub Desktop.
package com.example.demo;
import java.io.Serializable;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.repository.support.MongoRepositoryFactoryBean;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.core.support.RepositoryFactorySupport;
import org.springframework.data.repository.query.QueryLookupStrategy.Key;
public class InheritanceAwareMongoRepositoryFactoryBean<T extends Repository<S, ID>, S, ID extends Serializable> extends
MongoRepositoryFactoryBean<T, S, ID> {
public InheritanceAwareMongoRepositoryFactoryBean(Class<? extends T> repositoryInterface) {
super(repositoryInterface);
}
@Override
protected RepositoryFactorySupport getFactoryInstance(MongoOperations operations) {
return new InheritanceAwareMongoRepositoryFactory(operations);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment