Spring boot jpa + cassandra + mysql

I want to use both cassandra and MySQL in my project (some objects will be saved in cassandra, some others will be saved in MySQL. My problem is how to set it up.

My configuration is currently

@SpringBootApplication
@EnableCassandraRepositories(basePackages = { "com.example.cassandra.repository" })
@PropertySource(value = { "classpath:cassandra.properties" })
@EnableJpaRepositories(basePackages = { "com.example.mysql.repository" })
@EntityScan(basePackages = "com.example.mysql.model")
@EnableTransactionManagement
public class Application extends AbstractCqlTemplateConfiguration {}

      

But I cannot @Autowired the repository from the MySQL dialect, nor can I @Autowired SessionFactory. Please help me set them up.

+3


source to share


1 answer


Could you please show more error log. But I think you should split them into two different sub-projects. This can make your code cleaner and more convenient.



0


source







All Articles