Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block flnj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CallingSampleRepository
SampleRepository sampleRepository;
public void useSampleRepository(...) {
...., ttl);
flnj / SampleRepository
Created Feb 25, 2016
Sample Repository
View SampleRepository
public interface SampleRepository extends MyRepository<Sample, String> {
View Configuration
@EnableCassandraRepositories( repositoryFactoryBeanClass = MyRepositoryFactoryBean.class)
View gist:76a291514f55d1ca3321
public class MyRepositoryFactoryBean<T extends Repository<S, ID>, S, ID extends Serializable> extends RepositoryFactoryBeanSupport<T, S, ID> {
private CassandraTemplate cassandraTemplate;
protected RepositoryFactorySupport createRepositoryFactory() {
return new MyRepositoryFactory(cassandraTemplate);
View MyRepositoryImpl
public class MyRepositoryImpl<lT, ID extends Serializable> extends SimpleCassandraRepository<T, ID> implements MyRepository<T, ID> {
public MyRepositoryImpl(CassandraEntityInformation<T, ID> metadata, CassandraTemplate template) {
super(metadata, template);
this.entityInformation = metadata;
this.template = template;
View MyRepository
public interface MyRepository<T, ID extends Serializable> extends TypedIdCassandraRepository<T, ID> {
<S extends T> S save(S s, int ttl);
View registerFilter
public CustomFilter customFilter(){
return new CustomFilter();
public FilterRegistrationBean customFilterRegistration(){
FilterRegistrationBean customFilterRegistration=new FilterRegistrationBean(metricsFilter(), dispatcherServletRegistration());
return customFilterRegistration;
View gist:76fae9d248a8ee7b69a9
public DispatcherServlet dispatcherServlet() {
return new DispatcherServlet();
public ServletRegistrationBean dispatchcherServletRegistration(){
ServletRegistrationBean registrationBean =new ServletRegistrationBean(dispatcherServlet(), "/rest/v1/*");
You can’t perform that action at this time.