覆盖spring-data-cassandra SchemaAction

时间:2014-12-02 19:50:15

标签: spring-data-cassandra

如何重写AbstractCassandraConfiguration以使用我自己的函数来创建架构。我希望能够使用我在运行时选择的cql脚本来设置Cassandra实例。

我在CassandraSessionFactoryBean.performSchemaAction()创建AbstractCassandraConfiguration.session()时尝试覆盖java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given 。这会导致cqllib失败并显示

{{1}}

这似乎与cqlib如何创建代理有关:Superclass has no null constructors but no arguments were given

1 个答案:

答案 0 :(得分:1)

您可以在getStartupScripts()中覆盖AbstractCassandraConfiguration。在那里,你可以做任何你想做的事。它由CassandraCqlClusterFactoryBean的{​​{1}}方法(在executeSpecsAndScripts中调用)使用。