[jira] [Commented] (IGNITE-5298) .NET: DML update via LINQ

2018-03-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-5298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16389260#comment-16389260
 ] 

ASF GitHub Bot commented on IGNITE-5298:


Github user asfgit closed the pull request at:

https://github.com/apache/ignite/pull/3599


> .NET: DML update via LINQ
> -
>
> Key: IGNITE-5298
> URL: https://issues.apache.org/jira/browse/IGNITE-5298
> Project: Ignite
>  Issue Type: New Feature
>  Components: platforms
>Affects Versions: 2.1
>Reporter: Pavel Tupitsyn
>Assignee: Pavel Tupitsyn
>Priority: Major
>  Labels: .NET, LINQ, important
> Fix For: 2.5
>
>
> Bulk update with LINQ:
> {code}
> var persons = ignite.GetCache("persons").AsCacheQueryable();
> int affectedRows = persons.Where(x => x.Key > 10).UpdateAll(x => 
> x.Value.OrgId = 7);
> {code}
> See bulk delete with {{RemoveAll}}, IGNITE-4904.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-5298) .NET: DML update via LINQ

2018-03-07 Thread Pavel Tupitsyn (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-5298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16389257#comment-16389257
 ] 

Pavel Tupitsyn commented on IGNITE-5298:


Merged to master: {{ed76af245e7947b0e701907bde76849971a6a75c}}.

Thanks again [~GuruStron]!

> .NET: DML update via LINQ
> -
>
> Key: IGNITE-5298
> URL: https://issues.apache.org/jira/browse/IGNITE-5298
> Project: Ignite
>  Issue Type: New Feature
>  Components: platforms
>Affects Versions: 2.1
>Reporter: Pavel Tupitsyn
>Assignee: Pavel Tupitsyn
>Priority: Major
>  Labels: .NET, LINQ, important
> Fix For: 2.5
>
>
> Bulk update with LINQ:
> {code}
> var persons = ignite.GetCache("persons").AsCacheQueryable();
> int affectedRows = persons.Where(x => x.Key > 10).UpdateAll(x => 
> x.Value.OrgId = 7);
> {code}
> See bulk delete with {{RemoveAll}}, IGNITE-4904.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-5298) .NET: DML update via LINQ

2018-03-06 Thread Sergey Stronchinskiy (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-5298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16388506#comment-16388506
 ] 

Sergey Stronchinskiy commented on IGNITE-5298:
--

Hi, [~ptupitsyn]

Thank you for feedback. Everything should be fixed, please check.

> .NET: DML update via LINQ
> -
>
> Key: IGNITE-5298
> URL: https://issues.apache.org/jira/browse/IGNITE-5298
> Project: Ignite
>  Issue Type: New Feature
>  Components: platforms
>Affects Versions: 2.1
>Reporter: Pavel Tupitsyn
>Assignee: Pavel Tupitsyn
>Priority: Major
>  Labels: .NET, LINQ, important
>
> Bulk update with LINQ:
> {code}
> var persons = ignite.GetCache("persons").AsCacheQueryable();
> int affectedRows = persons.Where(x => x.Key > 10).UpdateAll(x => 
> x.Value.OrgId = 7);
> {code}
> See bulk delete with {{RemoveAll}}, IGNITE-4904.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-5298) .NET: DML update via LINQ

2018-03-06 Thread Pavel Tupitsyn (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-5298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16387909#comment-16387909
 ] 

Pavel Tupitsyn commented on IGNITE-5298:


[~GuruStron] looks good to me in general, awesome changes!
* Please split the test into multiple, it is too huge
* Make sure all class members have XMLDoc comments
* Why rename {{parenCount}}  to {{parentCount}} in {{CacheQueryModelVisitor}}?

> .NET: DML update via LINQ
> -
>
> Key: IGNITE-5298
> URL: https://issues.apache.org/jira/browse/IGNITE-5298
> Project: Ignite
>  Issue Type: New Feature
>  Components: platforms
>Affects Versions: 2.1
>Reporter: Pavel Tupitsyn
>Assignee: Pavel Tupitsyn
>Priority: Major
>  Labels: .NET, LINQ, important
>
> Bulk update with LINQ:
> {code}
> var persons = ignite.GetCache("persons").AsCacheQueryable();
> int affectedRows = persons.Where(x => x.Key > 10).UpdateAll(x => 
> x.Value.OrgId = 7);
> {code}
> See bulk delete with {{RemoveAll}}, IGNITE-4904.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-5298) .NET: DML update via LINQ

2018-03-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-5298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16385364#comment-16385364
 ] 

ASF GitHub Bot commented on IGNITE-5298:


GitHub user gurustron opened a pull request:

https://github.com/apache/ignite/pull/3599

IGNITE-5298 .NET: DML update via LINQ



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/gurustron/ignite feature/IGNITE-5298

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/ignite/pull/3599.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #3599


commit 35471479c5de161ab9aaf22ba55d4be807bdba0c
Author: gurustron 
Date:   2017-07-31T12:14:15Z

define API and interface

commit 303c89ff203b41b1beb85945363cf3aa49fa59f0
Author: gurustron 
Date:   2017-08-15T15:33:55Z

implementation started

commit 0747bfec5d81a17fb71e03c5f57b5b31d5d00b4a
Author: gurustron 
Date:   2017-08-15T15:43:04Z

Merge branch 'master'

commit 270e5cff52d7142964190ee84799beb93546bc8a
Author: gurustron 
Date:   2018-02-23T21:50:37Z

Merge branch 'master' into feature/IGNITE-5298

commit 46a7f00648e19a5480c850a8d69fbb6b8c51d316
Author: gurustron 
Date:   2018-02-26T20:58:19Z

remove impl for now

commit c551c80db3a5074cbfc00209f3c6b3dfae98e121
Author: gurustron 
Date:   2018-02-27T00:39:54Z

implementation experiments

commit fee3870c1e40edcd41deb06f780d26f98c204ac1
Author: gurustron 
Date:   2018-02-27T22:13:38Z

UpdateDescription set up

commit 45eceb26d6c594e952169f2307702a89891f5b2e
Author: gurustron 
Date:   2018-02-28T21:39:48Z

continue implementation(fix rewrite, generate sql). small refactoring

commit 8270c3ace564d20a097d951e821c2ed6df9dd8e6
Author: gurustron 
Date:   2018-03-01T06:38:14Z

change to be implementable

commit 42dc08e1fa6b39947b7f15b1afda3fc96899344c
Author: gurustron 
Date:   2018-03-01T20:08:55Z

play a little bit more, queryreference works

commit 2bceb7602078b6facfef78f013aebd3c88911b3e
Author: gurustron 
Date:   2018-03-01T22:16:11Z

base implementation

commit 28a6c111b534131a00a55b5e9ff8153d1601ac9e
Author: gurustron 
Date:   2018-03-01T22:20:41Z

typo fix

commit a01870ecbfc2f91f281b5c89bf5ad5ee65eda703
Author: gurustron 
Date:   2018-03-01T22:55:20Z

some clean up

commit b15c10932a1ae7fbfce7835f42faab130aab0956
Author: gurustron 
Date:   2018-03-01T23:00:54Z

some unit test

commit bee592d87c82e938f9693cd2d121850099375a44
Author: gurustron 
Date:   2018-03-02T00:53:51Z

Some more unit tests

commit 737b56ddb648a5fd0aab5f8cab685a6db6cf3604
Author: gurustron 
Date:   2018-03-02T01:15:27Z

simple condition

commit a1ae8d71639527aa4c81f6c924f0bde6a0ee8781
Author: gurustron 
Date:   2018-03-02T01:20:48Z

Test: conditional with limit

commit 5ffed8dc5b1543fda535ffb4d2c72328dc2d8197
Author: gurustron 
Date:   2018-03-02T01:21:41Z

Comment

commit 617f5f24fe1802fd45976c8c0d541bc3386689fe
Author: gurustron 
Date:   2018-03-02T02:10:42Z

small cleanup

commit 7172ba8c2ce5e3791520a4ae159b617530f87859
Author: gurustron 
Date:   2018-03-04T18:53:03Z

implement "Contains" in value

commit ea9ee417daa6697a83c1b7fbaacca7b3ccec9681
Author: gurustron 
Date:   2018-03-04T20:10:28Z

small clean up

commit eaffab9b7237187cd22924fda59f9fdae2f4cac7
Author: gurustron 
Date:   2018-03-04T20:30:17Z

small refactoring




> .NET: DML update via LINQ
> -
>
> Key: IGNITE-5298
> URL: https://issues.apache.org/jira/browse/IGNITE-5298
> Project: Ignite
>  Issue Type: New Feature
>  Components: platforms
>Affects Versions: 2.1
>Reporter: Pavel Tupitsyn
>Assignee: Sergey Stronchinskiy
>Priority: Major
>  Labels: .NET, LINQ, important
>
> Bulk update with LINQ:
> {code}
> var persons = ignite.GetCache("persons").AsCacheQueryable();
> int affectedRows = persons.Where(x => x.Key > 10).UpdateAll(x => 
> x.Value.OrgId = 7);
> {code}
> See bulk delete with {{RemoveAll}}, IGNITE-4904.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-5298) .NET: DML update via LINQ

2018-01-18 Thread Pavel Tupitsyn (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-5298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16330901#comment-16330901
 ] 

Pavel Tupitsyn commented on IGNITE-5298:


Another example: http://entityframework-extensions.net/

{code}
context.Customers.Where(x => !x.IsActif)
   .UpdateFromQuery(x => 
new Customer {IsActif = true});
{code}


> .NET: DML update via LINQ
> -
>
> Key: IGNITE-5298
> URL: https://issues.apache.org/jira/browse/IGNITE-5298
> Project: Ignite
>  Issue Type: New Feature
>  Components: platforms
>Affects Versions: 2.1
>Reporter: Pavel Tupitsyn
>Assignee: Sergey Stronchinskiy
>Priority: Major
>  Labels: .NET, LINQ, important
>
> Bulk update with LINQ:
> {code}
> var persons = ignite.GetCache("persons").AsCacheQueryable();
> int affectedRows = persons.Where(x => x.Key > 10).UpdateAll(x => 
> x.Value.OrgId = 7);
> {code}
> See bulk delete with {{RemoveAll}}, IGNITE-4904.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-5298) .NET: DML update via LINQ

2017-07-25 Thread Pavel Tupitsyn (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-5298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16099838#comment-16099838
 ] 

Pavel Tupitsyn commented on IGNITE-5298:


Yes, please go ahead, [~GuruStron]!

> .NET: DML update via LINQ
> -
>
> Key: IGNITE-5298
> URL: https://issues.apache.org/jira/browse/IGNITE-5298
> Project: Ignite
>  Issue Type: New Feature
>  Components: platforms
>Affects Versions: 2.1
>Reporter: Pavel Tupitsyn
>Assignee: Sergey Stronchinskiy
>  Labels: .NET, LINQ, important
>
> Bulk update with LINQ:
> {code}
> var persons = ignite.GetCache("persons").AsCacheQueryable();
> int affectedRows = persons.Where(x => x.Key > 10).UpdateAll(x => 
> x.Value.OrgId = 7);
> {code}
> See bulk delete with {{RemoveAll}}, IGNITE-4904.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (IGNITE-5298) .NET: DML update via LINQ

2017-07-25 Thread Sergey Stronchinskiy (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-5298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16099836#comment-16099836
 ] 

Sergey Stronchinskiy commented on IGNITE-5298:
--

[~ptupitsyn],

??We may add another one as a separate task later??

Actually I thought about this too, that for now implement only more general 
approach and later in separate task the initializer syntax. 

So I will start implementation with {{IUpdateDescriptor}} approach(if you don't 
see any better name for it :) )

> .NET: DML update via LINQ
> -
>
> Key: IGNITE-5298
> URL: https://issues.apache.org/jira/browse/IGNITE-5298
> Project: Ignite
>  Issue Type: New Feature
>  Components: platforms
>Affects Versions: 2.1
>Reporter: Pavel Tupitsyn
>Assignee: Sergey Stronchinskiy
>  Labels: .NET, LINQ, important
>
> Bulk update with LINQ:
> {code}
> var persons = ignite.GetCache("persons").AsCacheQueryable();
> int affectedRows = persons.Where(x => x.Key > 10).UpdateAll(x => 
> x.Value.OrgId = 7);
> {code}
> See bulk delete with {{RemoveAll}}, IGNITE-4904.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (IGNITE-5298) .NET: DML update via LINQ

2017-07-25 Thread Pavel Tupitsyn (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-5298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16099632#comment-16099632
 ] 

Pavel Tupitsyn commented on IGNITE-5298:


[~GuruStron] having two APIs is confusing. We may add another one as a separate 
task later; in this task we should provide a single API that has as little 
limitations as possible.

You are right, global {{Set}} method is not very good, and {{==}} approach gets 
hairy with complex update expressions. {{IUpdateDescriptor}} approach looks 
good to me. 

> .NET: DML update via LINQ
> -
>
> Key: IGNITE-5298
> URL: https://issues.apache.org/jira/browse/IGNITE-5298
> Project: Ignite
>  Issue Type: New Feature
>  Components: platforms
>Affects Versions: 2.1
>Reporter: Pavel Tupitsyn
>Assignee: Sergey Stronchinskiy
>  Labels: .NET, LINQ, important
>
> Bulk update with LINQ:
> {code}
> var persons = ignite.GetCache("persons").AsCacheQueryable();
> int affectedRows = persons.Where(x => x.Key > 10).UpdateAll(x => 
> x.Value.OrgId = 7);
> {code}
> See bulk delete with {{RemoveAll}}, IGNITE-4904.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (IGNITE-5298) .NET: DML update via LINQ

2017-07-21 Thread Pavel Tupitsyn (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-5298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16096383#comment-16096383
 ] 

Pavel Tupitsyn commented on IGNITE-5298:


[~GuruStron]

Initializer syntax is nice, but has too many limitations. Read-only entities 
(no parameterless ctor, read-only properties) are quite common, this is a good 
design, we should support that.

I like the {{Moq}} approach. It is clean, readable, has no limitations. {{Moq}} 
is very popular, so this will be familiar to many developers. Let's go this way.

> .NET: DML update via LINQ
> -
>
> Key: IGNITE-5298
> URL: https://issues.apache.org/jira/browse/IGNITE-5298
> Project: Ignite
>  Issue Type: New Feature
>  Components: platforms
>Affects Versions: 2.1
>Reporter: Pavel Tupitsyn
>Assignee: Sergey Stronchinskiy
>  Labels: .NET, LINQ, important
>
> Bulk update with LINQ:
> {code}
> var persons = ignite.GetCache("persons").AsCacheQueryable();
> int affectedRows = persons.Where(x => x.Key > 10).UpdateAll(x => 
> x.Value.OrgId = 7);
> {code}
> See bulk delete with {{RemoveAll}}, IGNITE-4904.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (IGNITE-5298) .NET: DML update via LINQ

2017-07-21 Thread Sergey Stronchinskiy (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-5298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16096367#comment-16096367
 ] 

Sergey Stronchinskiy commented on IGNITE-5298:
--

Hi [~ptupitsyn],

I've looked around a little bit and found few approaches to work around similar 
issues:

1. First approach is to pass an object initializer  in to update method like 
this:  

{code} persons.Where(x => x.Key > 10).UpdateAll(x => new Person{ OrgId = 42, 
Name = "Foo"}){code}

with signature of {{UpdateAll}} like {{public static int UpdateAll(this IQueryable> query, 
Expression> update)}}

For me it seems most clear and clean API but it has two drawbacks - if class 
has no parameterless constructor user will need to provide some dummy values 
which will not be actually parsed into SQL and if property has no public 
setter, then it would be impossible to update them.


2. {{Moq}} framework has an option to set properties of mocked object and uses 
{{==}} sign instead of {{=}} to achieve that:

{code}
Mock.Of( x => x.Name == "Foo" &&  x.OrgId = 42); 
{code}

Also there is an option which you suggested.

As for me i think first API is the way to go, cause second one is not that 
clear and the one from your suggestion will add a method with a signature which 
can be applied to anything and will be shown in intellisense suggestions to 
often. As for the restrictions of the API we can overcome them with extra 
method like:

{code}
persons.Where(x => x.Key > 10).UpdateAll(x => new { x.OrgId, x.Name, 
AddressName = x.Address.Name }, new { OrgId = 42, Name = "Foo", AddressName = 
"Bar"});
{code} 



> .NET: DML update via LINQ
> -
>
> Key: IGNITE-5298
> URL: https://issues.apache.org/jira/browse/IGNITE-5298
> Project: Ignite
>  Issue Type: New Feature
>  Components: platforms
>Affects Versions: 2.1
>Reporter: Pavel Tupitsyn
>Assignee: Sergey Stronchinskiy
>  Labels: .NET, LINQ, important
>
> Bulk update with LINQ:
> {code}
> var persons = ignite.GetCache("persons").AsCacheQueryable();
> int affectedRows = persons.Where(x => x.Key > 10).UpdateAll(x => 
> x.Value.OrgId = 7);
> {code}
> See bulk delete with {{RemoveAll}}, IGNITE-4904.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (IGNITE-5298) .NET: DML update via LINQ

2017-05-26 Thread Pavel Tupitsyn (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-5298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16026241#comment-16026241
 ] 

Pavel Tupitsyn commented on IGNITE-5298:


{{=}} cannot be used in expression trees: {{an expression tree may not contain 
an assignment operator}}.
However, there is an {{Expression.Assign}}. We can provide an extension method 
which works like this:

{{persons.Where(x => x.Key > 10).UpdateAll(x => x.Value.OrgId.Set(7));}}

> .NET: DML update via LINQ
> -
>
> Key: IGNITE-5298
> URL: https://issues.apache.org/jira/browse/IGNITE-5298
> Project: Ignite
>  Issue Type: New Feature
>  Components: platforms
>Affects Versions: 2.1
>Reporter: Pavel Tupitsyn
>Assignee: Pavel Tupitsyn
>  Labels: .NET, LINQ, important
> Fix For: 2.2
>
>
> Bulk update with LINQ:
> {code}
> var persons = ignite.GetCache("persons").AsCacheQueryable();
> int affectedRows = persons.Where(x => x.Key > 10).UpdateAll(x => 
> x.Value.OrgId = 7);
> {code}
> See bulk delete with {{RemoveAll}}, IGNITE-4904.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)