Impetus / kundera

A JPA 2.1 compliant Polyglot Object-Datastore Mapping Library for NoSQL Datastores.Please subscribe to:
http://groups.google.com/group/kundera-discuss/subscribe
Apache License 2.0
903 stars 233 forks source link

native query not working with cassandra 3.0.9 and DSClientFactory #1008

Closed bedinsky closed 6 years ago

bedinsky commented 6 years ago

I'm not able to execute native query using cassandra 3.0.9 (centos7) and DSClientFactory Query result is empty.

        String useNativeSql = "SELECT * FROM system_schema.keyspaces ";
        Query q = em.createNativeQuery(useNativeSql);  
        List result = q.getResultList();

I'm not using thrift client because schema is not generated correctly

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
    https://raw.github.com/impetus-opensource/Kundera/Kundera-2.0.4/kundera-core/src/test/resources/META-INF/persistence_2_0.xsd"
    version="2.0">

    <persistence-unit name="cassandra_pu">
        <provider>com.impetus.kundera.KunderaPersistence</provider>

        <class>it.thisone.iotter.persistence.model.TRole</class>
        <class>it.thisone.iotter.persistence.model.TUser</class>

        <exclude-unlisted-classes>true</exclude-unlisted-classes>
        <properties>
            <property name="kundera.nodes" value="172.168.1.131" />

            <property name="kundera.port" value="9042" />

            <property name="kundera.keyspace" value="kunderaexamples" />
            <property name="kundera.dialect" value="cassandra" />
            <property name="kundera.ddl.auto.prepare" value="create" />

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

        </properties>
    </persistence-unit>

</persistence>

pom.xml

<dependencies>
        <dependency>
            <groupId>com.impetus.kundera.client</groupId>
            <artifactId>kundera-cassandra</artifactId>
            <version>3.12</version>
        </dependency>
        <dependency>
            <groupId>com.impetus.kundera.client</groupId>
            <artifactId>kundera-cassandra-ds-driver</artifactId>
            <version>3.12</version>
        </dependency>
        <dependency>
            <groupId>com.datastax.cassandra</groupId>
            <artifactId>cassandra-driver-core</artifactId>
            <version>3.3.0</version>
        </dependency>
        <dependency>
            <groupId>com.datastax.cassandra</groupId>
            <artifactId>cassandra-driver-mapping</artifactId>
            <version>3.3.0</version>
        </dependency>
        <dependency>
            <groupId>com.datastax.cassandra</groupId>
            <artifactId>cassandra-driver-extras</artifactId>
            <version>3.3.0</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>5.2.4.Final</version>
        </dependency>
</dependencies>