Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cassandra update existing entity - adding index issue #589

Closed
jossef opened this issue May 7, 2014 · 2 comments
Closed

Cassandra update existing entity - adding index issue #589

jossef opened this issue May 7, 2014 · 2 comments
Labels
Milestone

Comments

@jossef
Copy link

jossef commented May 7, 2014

Hey,

I'm using the latest release (2.11) with Cassandra
I have this line in my persistence.xml taken from wiki:

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

This is my existing entity:

@Entity
@Table(name = "alerts")
@IndexCollection(columns = { @Index(name = "alertState"))
public class Alert
    ...

I modified it by adding a new field to be indexed:

@Entity
@Table(name = "alerts")
@IndexCollection(columns = { @Index(name = "alertState"), @Index(name = "date") })
public class Alert
    ...

Afterwards, i executed my code again and noticed that the change iv'e made has not been detected by the update component and my new index was not created.

@kkmishra
Copy link
Contributor

kkmishra commented May 7, 2014

Hi,

Confirming its an issue with thrift base schema generation, however it should work with cql3.
To use cql3 pass property map while creating EntityManagerFactory like :

 Map<String, String> propertyMap = new HashMap<String, String>();   
 propertyMap.put(CassandraConstants.CQL_VERSION, CassandraConstants.CQL_VERSION_3_0);

 EntityManagerFactory emf = Persistence.createEntityManagerFactory("pu-name", propertyMap);

a fix will be added in current trunk branch.

Thanks
Kuldeep

@chhavigangwal
Copy link
Collaborator

Fixed with Kundera-2.12. Please verify.

Chhavi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants