valchkou / cassandra-driver-mapping

JPA addon for DataStax Java Driver for Cassandra
57 stars 24 forks source link

Add Support for disabling Column deletion if required #54

Closed nitinpadalia closed 9 years ago

nitinpadalia commented 9 years ago

Hi,

I feel schemasync is a great feature but sometimes it may create disaster specially when some column is deleted from code and that gets synced to database. So I propose to have it as an option whether to delete columns or not.

I've identified some changes, shall I push it?

-Nitin

valchkou commented 9 years ago

Hi Nitin, that's make sense. What is suggested behavior ? do not sync that column at all ?

nitinpadalia commented 9 years ago

I believe we could have one more sync() API which will have switch whether to sync deleted columns or not if that switch is ON we do not sync deleted columns.

nitinpadalia commented 9 years ago

Yes I've done changes. How shall we proceed so that you could review and merge it to the master.

-Nitin

On Tue, Apr 14, 2015 at 11:49 PM, Eugene notifications@github.com wrote:

Hi Nitin, that's make sense. Did you make these changes already?

— Reply to this email directly or view it on GitHub https://github.com/valchkou/cassandra-driver-mapping/issues/54#issuecomment-93006429 .

valchkou commented 9 years ago

Nitin, this should be more flexible as may be potentially used by other developers too. I already have the flag mappingSession.setDoNotSync(true); which prevent from sync at all. It probably makes sense to extend this API with sync options. So you will be able to control which entities to sync and how.

I will make this change shortly

ranvijaychoudhary commented 9 years ago

Supporting sync option in generic way for each operations will be really good.

valchkou commented 9 years ago

this will be released on 4/22 (tomorrow)

nitinpadalia commented 9 years ago

:) Great... Thanks!

valchkou commented 9 years ago

released. Please upgrade to latest ver 2.1.5 explained here: https://github.com/valchkou/cassandra-driver-mapping#jump_sync