diff --git a/src/main/java/org/gcube/portal/databook/server/CassandraClusterConnection.java b/src/main/java/org/gcube/portal/databook/server/CassandraClusterConnection.java index 663c933..b44b0f0 100644 --- a/src/main/java/org/gcube/portal/databook/server/CassandraClusterConnection.java +++ b/src/main/java/org/gcube/portal/databook/server/CassandraClusterConnection.java @@ -254,7 +254,7 @@ public class CassandraClusterConnection { /** * define Attachments CF with FeedId as secondary index */ - ColumnFamilyDefinition cfDefAttachments = getStaticCFDef(DBCassandraAstyanaxImpl.ATTACHMENTS, "Feedid"); + ColumnFamilyDefinition cfDefAttachments = getStaticCFDef(DBCassandraAstyanaxImpl.ATTACHMENTS, "feedId"); //get dynamic column families, act as auxiliary indexes diff --git a/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java b/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java index 95603b9..a77b452 100644 --- a/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java +++ b/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java @@ -2167,7 +2167,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore { } List toReturn = new ArrayList(); - PreparedIndexExpression clause = cf_Attachments.newIndexClause().whereColumn("Feedid").equals().value(feedId); + PreparedIndexExpression clause = cf_Attachments.newIndexClause().whereColumn("feedId").equals().value(feedId); OperationResult> result; try { result = conn.getKeyspace().prepareQuery(cf_Attachments) diff --git a/src/main/java/org/gcube/portal/databook/server/DatabookCassandraTest.java b/src/main/java/org/gcube/portal/databook/server/DatabookCassandraTest.java index 5ef1f80..33df1eb 100644 --- a/src/main/java/org/gcube/portal/databook/server/DatabookCassandraTest.java +++ b/src/main/java/org/gcube/portal/databook/server/DatabookCassandraTest.java @@ -1,4 +1,6 @@ package org.gcube.portal.databook.server; +import java.util.UUID; + import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -297,32 +299,32 @@ public class DatabookCassandraTest { // } - // /** - // * use exclusively to add a new (Static) CF to a keyspace with a secondary index - // */ - // @Test - // public void addAttachmentStaticColumnFamilies() { - // ColumnFamily CF_ATTACHMENTS = ColumnFamily.newColumnFamily(DBCassandraAstyanaxImpl.ATTACHMENTS, StringSerializer.get(), StringSerializer.get()); - // - // try { - // String colNameToIndex = "feedId"; - // new CassandraClusterConnection(false).getKeyspace().createColumnFamily(CF_ATTACHMENTS, ImmutableMap.builder() - // .put("column_metadata", ImmutableMap.builder() - // .put(colNameToIndex, ImmutableMap.builder() - // .put("validation_class", "UTF8Type") - // .put("index_name", "FeedIndex_"+UUID.randomUUID().toString().substring(0,5)) - // .put("index_type", "KEYS") - // .build()) - // .build()) - // .build()); - // - // - // } catch (ConnectionException e) { - // e.printStackTrace(); - // } - // System.out.println("addStaticColumnFamily END"); - // } - +// /** +// * use exclusively to add a new (Static) CF to a keyspace with a secondary index +// */ +// @Test +// public void addAttachmentStaticColumnFamilies() { +// ColumnFamily CF_ATTACHMENTS = ColumnFamily.newColumnFamily(DBCassandraAstyanaxImpl.ATTACHMENTS, StringSerializer.get(), StringSerializer.get()); +// +// try { +// String colNameToIndex = "feedId"; +// new CassandraClusterConnection(false).getKeyspace().createColumnFamily(CF_ATTACHMENTS, ImmutableMap.builder() +// .put("column_metadata", ImmutableMap.builder() +// .put(colNameToIndex, ImmutableMap.builder() +// .put("validation_class", "UTF8Type") +// .put("index_name", "FeedIndex_"+UUID.randomUUID().toString().substring(0,5)) +// .put("index_type", "KEYS") +// .build()) +// .build()) +// .build()); +// +// +// } catch (ConnectionException e) { +// e.printStackTrace(); +// } +// System.out.println("addStaticColumnFamily END"); +// } +// // /** // * use exclusively to add a new (Dynamic) CF to a keyspace