Skip to content

Instantly share code, notes, and snippets.

@flnj
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flnj/886983336c6fbe374444 to your computer and use it in GitHub Desktop.
Save flnj/886983336c6fbe374444 to your computer and use it in GitHub Desktop.
@NoRepositoryBean
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;
}
@Override
public <S extends T> S save(S s, int ttl) {
WriteOptions writeOptions=new WriteOptions();
writeOptions.setTtl(ttl);
return template.insert(s, writeOptions);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment