Saving annotated pojo to cassandra

1,811 views
Skip to first unread message

Arpan Mukhopadhyay

unread,
Mar 23, 2014, 9:31:24 PM3/23/14
to spring-dat...@googlegroups.com
Hi guys

I've been trying to save a annotated pojo to cassandra using spring-data-cassandra. But unable to find any method to to save the object in the CqlTemplate . Then I changed my configuration as follows (previous ly I was following the configuration showed in github - https://github.com/spring-projects/spring-data-cassandra  )- 

@Configuration
@EnableCassandraRepositories
public class CassandraConfiguration extends AbstractCassandraConfiguration {

private static final Logger logger = LoggerFactory.getLogger(CassandraConfiguration.class);
private static final String KEY_SPACE_NAME = "mykeyspace";
private static final String CONNECTION_POINTS = "127.0.0.1";
private static final int PORT = 9042;
private static final int MAX_POOL_CONNECTION = 50;
/* (non-Javadoc)
* @see org.springframework.data.cassandra.config.java.AbstractCassandraConfiguration#getKeyspaceName()
*/
@Override
protected String getKeyspaceName() {
return KEY_SPACE_NAME;
}
@Bean
    public CassandraOperations template() throws Exception {
logger.info("Creating cassandra template and returning it");
        return new CassandraTemplate(session().getObject(),new MappingCassandraConverter(new BasicCassandraMappingContext()));
    }
@Override
protected PoolingOptions getPoolingOptions() {
PoolingOptions options = new PoolingOptions();
options.setMaxConnectionsPerHost(HostDistance.LOCAL, MAX_POOL_CONNECTION);
return options;
}
@Override
protected String getContactPoints() {
return CONNECTION_POINTS;
}
@Override
protected int getPort() {
return PORT;
}

}

Now when I tried to use the <T> List<T> insert(List<T> entity) or <T>T insert(T entity) of CassandraOperations with my annotated pojo  it gives me a no such method exception . Can anyone help me 'bout this ?

Thanks
Arpan

Colin McQueen

unread,
Mar 26, 2014, 10:14:46 AM3/26/14
to spring-dat...@googlegroups.com
What about trying to use the CassandraTemplate? In my project, I am using CassandraRepository and they use the CassandraTemplate and that allows you to save an entity.

arpan...@gmail.com

unread,
Mar 28, 2014, 12:43:14 AM3/28/14
to Colin McQueen, spring-dat...@googlegroups.com
Hi all,

just to know, does this spring-cassandra plugin works with cassandra 2.0.6 ? As my earlier error got fixed after I upgraded the spring-data to latest snapshot , but I got an error related to K_SET.


Thanks
Arpan





--
You received this message because you are subscribed to a topic in the Google Groups "Spring Data Cassandra" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/spring-data-cassandra/k2kkod-ZOkI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to spring-data-cass...@googlegroups.com.
To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.
To view this discussion on the web visit https://groups.google.com/d/msgid/spring-data-cassandra/6aea93ee-08c8-4782-8495-d1536314e074%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

David Webb (Prowave)

unread,
Mar 28, 2014, 8:30:29 AM3/28/14
to arpan...@gmail.com, spring-dat...@googlegroups.com
Cassandra 1.2 currently supported as noted in the readme. 

Sent from my iPhone
You received this message because you are subscribed to the Google Groups "Spring Data Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cass...@googlegroups.com.

To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.

arpan...@gmail.com

unread,
Mar 29, 2014, 2:58:07 AM3/29/14
to David Webb (Prowave), spring-dat...@googlegroups.com
Hi all,

I have successfully created a sample spring-data-cassandra application which I am gonna share here(it only has a save operation for now). My only concern is now how to automatically create the table corresponding to the pojo in runtime (ie the table is not present initially but will be created when a bean is initialized or something like that).

Cheers
Arpan
cassandra-tryout.zip
users.cql

Matthew Adams

unread,
Apr 2, 2014, 5:24:41 PM4/2/14
to spring-dat...@googlegroups.com
Hi Arpan,

I haven't looked at your example app yet, but as for your comment regarding table creation, know that spring-data-cassandra XML config has a couple of different options.

1. The <session> element supports a <startup-cql> element in which you can place arbitrary CQL, which will be executed upon connection to the cluster.  You could put create table statements there.
2. The <session> element includes a schema-action attribute, whose default value is NONE, but that supports all of the values currently defined in enum SchemaAction:  CREATE (attempts to create new tables, bombs if they exist), RECREATE (drops tables if they exist then recreates), & RECREATE_DROP_UNUSED (drops all tables in the keyspace and creates/recreates those needed).  Future options will include VALIDATE (make sure the existing keyspace can without modification persist your entities, fails otherwise), UPDATE (alters tables as necessary or creates them) & possibly others.

The same support exists in spring-data-cassandra's Java config.  See AbstractCassandraConfiguration's getSchemaAction() & getStartupScripts().

HTH,
Matthew
To unsubscribe from this group and all its topics, send an email to spring-data-cassandra+unsub...@googlegroups.com.

To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.

--
You received this message because you are subscribed to the Google Groups "Spring Data Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cassandra+unsub...@googlegroups.com.

Arpan Mukhopadhyay

unread,
May 15, 2014, 12:27:55 PM5/15/14
to spring-dat...@googlegroups.com

  Hi Matthew,
I have been trying your suggestion of creating table on cassandra on the fly with the following settings, but it didn't work

/**
 *
 */


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.cassandra.config.SchemaAction;
import org.springframework.data.cassandra.config.java.AbstractCassandraConfiguration;
import org.springframework.data.cassandra.convert.MappingCassandraConverter;
import org.springframework.data.cassandra.core.CassandraOperations;
import org.springframework.data.cassandra.core.CassandraTemplate;
import org.springframework.data.cassandra.mapping.BasicCassandraMappingContext;
import org.springframework.data.cassandra.repository.config.EnableCassandraRepositories;

import com.datastax.driver.core.HostDistance;
import com.datastax.driver.core.PoolingOptions;
import com.datastax.driver.core.Session;
import com.datastax.driver.core.policies.LoadBalancingPolicy;

/**
 * @author arpan
 *
 */

@Configuration
@EnableCassandraRepositories
public class CassandraConfiguration extends AbstractCassandraConfiguration {

    private static final Logger logger = LoggerFactory.getLogger(CassandraConfiguration.class);

    private static final String DEFAULT_KEY_SPACE_NAME = "mykeyspace";
    private static final String DEFALUT_CONNECTION_POINTS = "127.0.0.1";
    private static final int DEFAULT_PORT = 9042;

    private static final int DEFAULT_MAX_POOL_CONNECTION = 50;

    @Override
    protected String getKeyspaceName() {
        return DEFAULT_KEY_SPACE_NAME;
    }

    @Bean(name = "template")

    public CassandraOperations template() throws Exception {
        logger.info("Creating cassandra template and returning it");
        Session session = session().getObject();
       
        return new CassandraTemplate(session, new MappingCassandraConverter(new BasicCassandraMappingContext()));

    }

    @Override
    protected PoolingOptions getPoolingOptions() {
        PoolingOptions options = new PoolingOptions();
        options.setMaxConnectionsPerHost(HostDistance.LOCAL, DEFAULT_MAX_POOL_CONNECTION);
        return options;
    }

    @Override
    protected int getPort() {

        return DEFAULT_PORT;
    }

    @Override
    protected LoadBalancingPolicy getLoadBalancingPolicy() {

        return super.getLoadBalancingPolicy();
    }

    @Override
    protected String getContactPoints() {

        return DEFALUT_CONNECTION_POINTS;
    }

 
    @Override  
    public SchemaAction getSchemaAction() {
        // TODO configure for first run
        return SchemaAction.RECREATE_DROP_UNUSED;
    }
}

Am I missing something ?

Arpan

Matthew Adams

unread,
May 15, 2014, 12:44:01 PM5/15/14
to spring-dat...@googlegroups.com
Arpan, I need more info than "it didn't work".  The code you're including looks like you're not missing anything.  What's the error?

Arpan Mukhopadhyay

unread,
May 15, 2014, 1:14:58 PM5/15/14
to spring-dat...@googlegroups.com

 Thanks for your quick reply
 The problem now I am facing the following error

Exception in thread "main" com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured columnfamily subscriber
    at com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:35)
    at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:256)
    at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:172)
    at com.datastax.driver.core.SessionManager.execute(SessionManager.java:91)
    at org.springframework.cassandra.core.CqlTemplate$12.doInSession(CqlTemplate.java:518)
    at org.springframework.cassandra.core.CqlTemplate$12.doInSession(CqlTemplate.java:509)
    at org.springframework.cassandra.core.CqlTemplate.doExecute(CqlTemplate.java:486)
    at org.springframework.cassandra.core.CqlTemplate.doExecute(CqlTemplate.java:509)
    at org.springframework.cassandra.core.CqlTemplate.execute(CqlTemplate.java:1187)
    at org.springframework.data.cassandra.core.CassandraTemplate.insert(CassandraTemplate.java:531)
    at org.springframework.data.cassandra.core.CassandraTemplate.insert(CassandraTemplate.java:211)
    at org.springframework.data.cassandra.core.CassandraTemplate.insert(CassandraTemplate.java:206)
    at com.tel.protocol.run.AppRun.main(AppRun.java:45)
Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured columnfamily subscriber
    at com.datastax.driver.core.Responses$Error.asException(Responses.java:96)
    at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:108)
    at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:228)
    at com.datastax.driver.core.RequestHandler.onSet(RequestHandler.java:354)
    at com.datastax.driver.core.Connection$Dispatcher.messageReceived(Connection.java:571)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
    at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
    at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
    at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
    at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
    at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
    at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
    at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)




 below is my Subscriber.java


/**
 * @author arpan
 *
 */
//for caching the object
//@Cacheable(key="subscriberCache")

@Table(value = "subscriber")
public class Subscriber {

    @PrimaryKey(value = "id")
    @Column(value = "id")
    private String id;
    @Column(value = "chargingid")
    private String chargingId;
    @Column(value = "username")
    private String username;
    @Column(value = "password")
    private String password;

    /**
     *
     */
    public Subscriber() {
        // TODO Auto-generated constructor stub
    }

    /**
     * @return the id
     */
    public String getId() {
        return id;
    }

    /**
     * @param id
     *            the id to set
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * @return the chargingId
     */
    public String getChargingId() {
        return chargingId;
    }

    /**
     * @param chargingId
     *            the chargingId to set
     */
    public void setChargingId(String chargingId) {
        this.chargingId = chargingId;
    }

    /**
     * @return the username
     */
    public String getUsername() {
        return username;
    }

    /**
     * @param username
     *            the username to set
     */
    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @param password
     *            the password to set
     */
    public void setPassword(String password) {
        this.password = password;
    }

}

 The table does not exist (only the keyspace exists).

Thanks
Arpan

Matthew Adams

unread,
May 15, 2014, 1:29:27 PM5/15/14
to Arpan Mukhopadhyay, spring-dat...@googlegroups.com
Ok.  Crank up your logging level for org.springframework.data to DEBUG and start sifting through the messages to see what it says during context initialization.  You can reply with the log if you want.


To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cass...@googlegroups.com.

To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.

For more options, visit https://groups.google.com/d/optout.

David Webb (Prowave)

unread,
May 15, 2014, 1:39:12 PM5/15/14
to Arpan Mukhopadhyay, spring-dat...@googlegroups.com

Try removing the @Column annotation from the PK.

 


    @PrimaryKey(value = "id")
    @Column(value = "id")
    private String id;

 

To unsubscribe from this group and all its topics, send an email to spring-data-cass...@googlegroups.com.


To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.

 

--

You received this message because you are subscribed to the Google Groups "Spring Data Cassandra" group.

To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cass...@googlegroups.com.

 

--

You received this message because you are subscribed to the Google Groups "Spring Data Cassandra" group.

To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cass...@googlegroups.com.


To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.

arpan...@gmail.com

unread,
May 15, 2014, 1:47:50 PM5/15/14
to David Webb (Prowave), spring-dat...@googlegroups.com
Sorry David,

could not understand the reason. Anyway didn't work that too. (I forgot to mention I am using cassandra 2.0.7 and spring data cassandra 1.0.0.SNAPSHOT. Is that a problem? If yes then start up script also could not have been worked but it did.)

Thanks
Arpan

Matthew Adams

unread,
May 15, 2014, 1:53:25 PM5/15/14
to arpan...@gmail.com, David Webb (Prowave), spring-dat...@googlegroups.com
"1.0.0.SNAPSHOT" is not a valid version.  I might suggest you use "1.0.0.RC1", the most recent release candidate.

Also, more of the log is needed to see what's happening during context initialization time.  That's when C* schema generation is going to happen.



For more options, visit https://groups.google.com/d/optout.



--

David Webb (Prowave)

unread,
May 15, 2014, 1:54:00 PM5/15/14
to arpan...@gmail.com, David Webb (Prowave), spring-dat...@googlegroups.com

The @Column annotation is not needed since specifying the field as @PrimaryKey already designates is as a column.

 

Additionally, @Column is really only required if you need to change the column name mapping b/c the POJO field name is not the column name.

 

Example of a noop, b/c the column name is “id” and the field name is “id”

    @Column(value = "id")
    private String id;

 

Proper use example would be:

 

@Column(value=”id”)

private String uniqueId;

 

Regarding version of SDC*…Yes, that is a problem. You should be using 1.0.0.RC1

 

Thanks,

Dave

arpan...@gmail.com

unread,
May 15, 2014, 2:17:38 PM5/15/14
to David Webb (Prowave), spring-dat...@googlegroups.com
Here is the complete log and the project for your reference

Thanks
Arpan
cassandra-tryout.zip

Matthew Adams

unread,
May 15, 2014, 2:29:22 PM5/15/14
to arpan...@gmail.com, David Webb (Prowave), spring-dat...@googlegroups.com
Try removing the method called "template()" in your class CassandraConfiguration.  AbstractCassandraConfiguration already defines a method called cassandraTemplate().

It looks like your method prevents CassandraSessionFactoryBean's afterPropertiesSet() method from getting invoked, which is where the performSchemaAction() method gets invoked.



For more options, visit https://groups.google.com/d/optout.



--

Arpan Mukhopadhyay

unread,
May 15, 2014, 8:46:04 PM5/15/14
to spring-dat...@googlegroups.com, arpan...@gmail.com, David Webb (Prowave)

 How do I supposed to get the bean from application context ?

ApplicationContext ctx = new AnnotationConfigApplicationContext("conf");
CassandraTemplate cassandraTemplate = (CassandraTemplate) ctx.getBean(?);
Subscriber subscriber = new Subscriber();
.
.
.
cassandraTemplate.insert(subscriber);


Moreover AbstractCassandraConfiguration has the following method

@Bean
    public CassandraAdminOperations cassandraTemplate() throws Exception {
        return new CassandraAdminTemplate(session().getObject(), cassandraConverter());
    }

 which returns a CassandraAdminTemplate but not CassandraTemplate

To unsubscribe from this group and all its topics, send an email to spring-data-cassandra+unsub...@googlegroups.com.


To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.

 

--

You received this message because you are subscribed to the Google Groups "Spring Data Cassandra" group.

To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cassandra+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Spring Data Cassandra" group.

To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cassandra+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Spring Data Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cassandra+unsub...@googlegroups.com.

To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.

Matthew Adams

unread,
May 16, 2014, 12:09:14 AM5/16/14
to Arpan Mukhopadhyay, spring-dat...@googlegroups.com, David Webb (Prowave)
See below.


On Thursday, May 15, 2014, Arpan Mukhopadhyay <arpan...@gmail.com> wrote:

 How do I supposed to get the bean from application context ?

ApplicationContext ctx = new AnnotationConfigApplicationContext("conf");
CassandraTemplate cassandraTemplate = (CassandraTemplate) ctx.getBean(?);

You can get it by type (see getBeansOfType(Class)), but it's prolly better to @Autowire/@Inject it into the component that needs it.
 
Subscriber subscriber = new Subscriber();
.
.
.
cassandraTemplate.insert(subscriber);


Moreover AbstractCassandraConfiguration has the following method

@Bean
    public CassandraAdminOperations cassandraTemplate() throws Exception {
        return new CassandraAdminTemplate(session().getObject(), cassandraConverter());
    }

 which returns a CassandraAdminTemplate but not CassandraTemplate

CassandraAdminTemplate extends CassandraTemplate.  They are type compatible.
 


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spring Data Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cassandra+unsub...@googlegroups.com.
To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.

 
 

--
You received this message because you are subscribed to the Google Groups "Spring Data Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cass...@googlegroups.com.

To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.
To view this discussion on the web visit https://groups.google.com/d/msgid/spring-data-cassandra/5ca1e1a5-c848-45ee-965a-b98faec60078%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Sent from little elves with newly redesigned, sleeker, simpler looks.

Arpan Mukhopadhyay

unread,
May 16, 2014, 1:19:27 PM5/16/14
to spring-dat...@googlegroups.com, Arpan Mukhopadhyay, David Webb (Prowave)

Hi Matthew
I have modified the code according to your suggestion but still not good. "unconfigured columnfamily subscriber" is showing up. Attaching the full code  and  log here. I have a doubt now about the way java configuration has been done. Do you have any alternate idea about the configuration ? Please share if any. I have been stuck for a long time in this. Can you suggest any guide or kind of docs to follow to get some idea (spring reference doc is yet to be completed in some part I guess)?
 
Thanks
Arpan
To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cassandra+unsubscri...@googlegroups.com.

To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.

--
You received this message because you are subscribed to the Google Groups "Spring Data Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cassandra+unsub...@googlegroups.com.
To post to this group, send email to spring-data-cassandra@googlegroups.com.
cassandra-tryout.zip

Matthew Adams

unread,
May 16, 2014, 2:03:59 PM5/16/14
to Arpan Mukhopadhyay, spring-dat...@googlegroups.com, David Webb (Prowave)
The reason there is no column family is because afterPropertiesSet() is not getting invoked on CassandraSessionFactoryBean.  If that gets called, as it should as part of the Spring bean lifecycle, then, with its schemaAction property set to RECREATE_DROP_UNUSED, it **will** generate the schema.

You need to compare your configuration with those used in the SDC integration tests that use Java config.  See

I'm sorry that I don't have more time to look at your project right now.

-matthew


To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cass...@googlegroups.com.

To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.

For more options, visit https://groups.google.com/d/optout.



--

Arpan Mukhopadhyay

unread,
May 17, 2014, 9:14:28 AM5/17/14
to spring-dat...@googlegroups.com, Arpan Mukhopadhyay, David Webb (Prowave)

Thanks Matthew

I figured it out and it's working now

-Arpan
See below.


--
Sent from little elves with newly redesigned, sleeker, simpler looks.

--
You received this message because you are subscribed to the Google Groups "Spring Data Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cassandra+unsub...@googlegroups.com.
To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.



--

Matthew Adams

unread,
May 19, 2014, 4:20:34 PM5/19/14
to Arpan Mukhopadhyay, spring-dat...@googlegroups.com, David Webb (Prowave)
That's great to hear.  Can you share your fix?  What was the problem?


To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cass...@googlegroups.com.

To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.

For more options, visit https://groups.google.com/d/optout.

Arpan Mukhopadhyay

unread,
May 20, 2014, 12:59:33 AM5/20/14
to spring-dat...@googlegroups.com, Arpan Mukhopadhyay, David Webb (Prowave)
Yeah sure.  I found the following method in AbstractCassandraConfiguration 

protected String getMappingBasePackage() {
return getClass().getPackage().getName();
}
which only search for the mapping classes inside the package where your configuration resides. All I had to was override the method to map the correct package.

My error was nothing to do with afterPropertiesSet() ;) though it was present

- Arpan

--
You received this message because you are subscribed to the Google Groups "Spring Data Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cassandra+unsub...@googlegroups.com.
To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.



--
Matthew Adams
Reply all
Reply to author
Forward
0 new messages