Closed mayankqait closed 6 years ago
Hi @mayankqait,
Using Polyglot persistence you can persist parts of relational entities in different databases. For example, if you have User
and Address
entities having one to many relationship. You want to save User
in Cassandra and Address
in Mysql; you can do it with polyglot persistence.
Now for saving the same entity in both the databases, you need to create 2 persistence-unit in your persistence.xml
and need to create two EntityManagerFactory
instances using each persistence-unit. Now create entityManager
and save entity objects.
Thank you for updating on this.
When i am trying this Schema is generated for both the databases(mysql and cassandra) but data is only persisted into one database()mysql. Is it possible to persist data in boththe databases.
CassandraEmpTask.zip