0
votes

I have this Cassandra table:

CREATE TABLE xxx ( id timeuuid PRIMARY KEY);

and this class:

@Entity
@Table(name = "xxx", schema = "yyy")
   public class XXX {

  @Id
  @GeneratedValue
  public UUID id;
}

Upon persisting, I get:

Exception in thread "main" com.impetus.kundera.KunderaException: java.lang.IllegalArgumentException: GenerationType.AUTO Strategy not supported by this client :com.impetus.client.cassandra.pelops.PelopsClient at com.impetus.kundera.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:174) at Importer.save(StayImporter.java:80) at Importer.exec(StayImporter.java:92) at Importer.main(StayImporter.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) Caused by: java.lang.IllegalArgumentException: GenerationType.AUTO Strategy not supported by this client :com.impetus.client.cassandra.pelops.PelopsClient at com.impetus.kundera.persistence.IdGenerator.onAutoGenerator(IdGenerator.java:116) at com.impetus.kundera.persistence.IdGenerator.generateAndSetId(IdGenerator.java:71) at com.impetus.kundera.graph.ObjectGraphBuilder.getNode(ObjectGraphBuilder.java:111) at com.impetus.kundera.graph.ObjectGraphBuilder.getObjectGraph(ObjectGraphBuilder.java:75) at com.impetus.kundera.persistence.PersistenceDelegator.persist(PersistenceDelegator.java:135) at com.impetus.kundera.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:168) ... 8 more

This is my pom.xml:

<repositories>
    <repository>
        <id>sonatype-nexus</id>
        <name>Kundera Public Repository</name>
        <url>https://oss.sonatype.org/content/repositories/releases</url>
    </repository>
</repositories>
<dependency>
        <groupId>com.impetus.client</groupId>
        <artifactId>kundera-cassandra</artifactId>
        <version>2.9</version>
</dependency>
1

1 Answers

0
votes

From the logs:

GenerationType.AUTO Strategy not supported by this client com.impetus.client.cassandra.pelops.PelopsClient

I suggest you to use Thrift client. You can do this by changing kundera.client.lookup.class property in persistence.xml to the following:

<property name="kundera.client.lookup.class" value="com.impetus.client.cassandra.thrift.ThriftClientFactory" />

Also, I suggest you to use latest version of Kundera-Cassandra.