3
votes

The actual use case i'm working on has many classes that should be persisted (basically different sensor types). Currently i have to create the table per hand for every sensor type. Isn't there a mechanism of the driver that could auto create the respective tables if they are not existent (like seen in e.g. Hibernate)?

This would allow me to deploy the app on other systems without need for recreating the tables again. Furthermore this is quite handy for quick prototyping ;)

2

2 Answers

1
votes

Not at the moment, but this is a planned feature (JAVA-569).

2
votes

I created a partial solution to the problem - a table / udt create-query creation facility. It can be found here: https://gist.github.com/eintopf/3ae360110846cb80a227

Unfourtunately the type mapping is NOT complete at the moment, since the respective type mapper class in the object mapper package of datastax is private.

The program just builds all CREATE queries and one use them like he wants (copy paste into cqlsh or use it directly on the cassandra session via Java).