cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Svihla ...@foundev.pro>
Subject Re: Cassandra Object Mapper - Dynamically pass keyspace value
Date Sun, 25 Oct 2015 12:58:23 GMT
You should probably ask the java driver user list
https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user
,

However I do have some suggestions (any follow up questions please ask on
the java driver list though):

   1. It's optional so you don't have to pass it (
   https://github.com/datastax/java-driver/blob/61a98e83cf35ae3e979d6073aeb40ba78eed11d5/driver-mapping/src/main/java/com/datastax/driver/mapping/annotations/UDT.java)
   and you can rely on the mapper knowing about the keyspace before you pass
   this (either via connect or a "USE command" on the session object (which is
   what I do in my project with the Table annotation).
   2. You can just rely on Java and delegate this to a static property
   which reads a configuration value from say a system property (which you can
   set in Maven using profiles for example).



On Tue, Oct 20, 2015 at 12:21 PM, Ashish Soni <asoni.learn@gmail.com> wrote:

> Hi All ,
>
> is there any way i can specify value of keyspace during compile time like
> using maven build
> hard coding keyspace name inside the java class is bit not comfortable as
> if there a change and there are 1000's of files it become a big maintenance
> issue
>
> @UDT (keyspace = "complex", name = "address")public class Address {
>     private String street;
>     private String city;
>     private int zipCode;
>
>


-- 

Thanks,
Ryan Svihla

Mime
View raw message