create table in Cassandra using Kundera

45 views
Skip to first unread message

mark.j...@capbpm.com

unread,
Nov 20, 2015, 5:35:19 PM11/20/15
to kundera-discuss
Hello

I know JPA/Hibernate will automatically create a table if you put the following in application.properties

spring.jpa.hibernate.ddl-auto=create

Is there anything I can add to the following Kundera persistence.xml to also get automatic creation of a table in Cassandra? Kundera persistence xml: <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> <persistence-unit name="cassandra_pu"> <provider>com.impetus.kundera.KunderaPersistence</provider> <properties> <property name="kundera.nodes" value="localhost"/> <property name="kundera.port" value="9160"/> <property name="kundera.keyspace" value="KunderaExamples"/> <property name="kundera.dialect" value="cassandra"/> <property name="kundera.client.lookup.class" value="com.impetus.client.cassandra.thrift.ThriftClientFactory" /> </properties> </persistence-unit> </persistence>

Chhavi Gangwal

unread,
Nov 20, 2015, 11:28:31 PM11/20/15
to kundera-discuss

Add the following property :

<property name="kundera.ddl.auto.prepare" value="create" />

Chhavi

mark.j...@capbpm.com

unread,
Nov 21, 2015, 5:08:09 PM11/21/15
to kundera-discuss
Chhavi

Thank you.  This works perfectly.
Reply all
Reply to author
Forward
0 new messages