Inherit fields from previous operation if at least one field is excluded. Extend FieldsExposingAggregationOperation to conditionally inherit fields.
Backport to Java 6 code.
Original pull request: #538.
@ -169,6 +169,14 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
@@ -169,6 +169,14 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
@ -62,6 +62,14 @@ public class CountOperation implements FieldsExposingAggregationOperation {
@@ -62,6 +62,14 @@ public class CountOperation implements FieldsExposingAggregationOperation {
@ -96,6 +96,14 @@ public class FacetOperation implements FieldsExposingAggregationOperation {
@@ -96,6 +96,14 @@ public class FacetOperation implements FieldsExposingAggregationOperation {
@ -132,6 +132,14 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
@@ -132,6 +132,14 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
@ -53,7 +53,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -53,7 +53,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -64,7 +64,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -64,7 +64,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -73,7 +73,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -73,7 +73,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -90,7 +90,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -90,7 +90,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -100,7 +100,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -100,7 +100,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
/**
*Builderfor{@linkGroupOperation}sonafield.
*
*
*@authorThomasDarimont
*/
publicstaticfinalclassGroupOperationBuilder{
@ -110,7 +110,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -110,7 +110,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -125,7 +125,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -125,7 +125,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -139,7 +139,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -139,7 +139,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
*<p>
*Countexpressionsareemulatedvia{@code$sum:1}.
*<p>
*
*
*@return
*/
publicGroupOperationBuildercount(){
@ -148,7 +148,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -148,7 +148,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -177,7 +177,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -177,7 +177,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -187,7 +187,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -187,7 +187,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -201,7 +201,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -201,7 +201,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -212,7 +212,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -212,7 +212,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -222,7 +222,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -222,7 +222,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -233,7 +233,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -233,7 +233,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -243,7 +243,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -243,7 +243,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -254,7 +254,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -254,7 +254,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -264,7 +264,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -264,7 +264,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -274,7 +274,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -274,7 +274,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -288,7 +288,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -288,7 +288,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -299,7 +299,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -299,7 +299,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -309,7 +309,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -309,7 +309,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -320,7 +320,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -320,7 +320,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -379,7 +379,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -379,7 +379,7 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -395,6 +395,14 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -395,6 +395,14 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -73,6 +73,14 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe
@@ -73,6 +73,14 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe
privatestaticfinalStringEXCLUSION_ERROR="Exclusion of field %s not allowed. Projections by the mongodb "
+"aggregation framework only support the exclusion of the %s field!";
privatefinalList<Projection>projections;
@ -66,7 +65,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -66,7 +65,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -76,7 +75,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -76,7 +75,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -92,7 +91,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -92,7 +91,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -103,7 +102,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -103,7 +102,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -116,7 +115,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -116,7 +115,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -134,7 +133,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -134,7 +133,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
/**
*Excludesthegivenfieldsfromtheprojection.
*
*
*@paramfieldNamesmustnotbe{@literalnull}.
*@return
*/
@ -146,7 +145,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -146,7 +145,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
/**
*Includesthegivenfieldsintotheprojection.
*
*
*@paramfieldNamesmustnotbe{@literalnull}.
*@return
*/
@ -158,7 +157,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -158,7 +157,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
/**
*Includesthegivenfieldsintotheprojection.
*
*
*@paramfieldsmustnotbe{@literalnull}.
*@return
*/
@ -183,6 +182,25 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -183,6 +182,25 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -201,7 +219,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -201,7 +219,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -211,7 +229,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -211,7 +229,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -224,7 +242,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -224,7 +242,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -235,7 +253,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -235,7 +253,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -262,7 +280,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -262,7 +280,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -273,7 +291,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -273,7 +291,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -321,7 +339,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -321,7 +339,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
/**
*A{@linkProjection}basedonaSpELexpression.
*
*
*@authorThomasDarimont
*@authorOliverGierke
*/
@ -334,7 +352,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -334,7 +352,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -350,7 +368,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -350,7 +368,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -368,7 +386,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -368,7 +386,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
/**
*Builderfor{@linkProjectionOperation}sonafield.
*
*
*@authorOliverGierke
*@authorThomasDarimont
*@authorChristophStrobl
@ -384,7 +402,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -384,7 +402,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -400,7 +418,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -400,7 +418,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -417,7 +435,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -417,7 +435,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -428,7 +446,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -428,7 +446,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
/**
*Definesanestedfieldbindingforthecurrentfield.
*
*
*@paramfieldsmustnotbe{@literalnull}.
*@return
*/
@ -438,7 +456,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -438,7 +456,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -480,7 +498,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -480,7 +498,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -492,7 +510,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -492,7 +510,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -504,7 +522,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -504,7 +522,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -517,7 +535,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -517,7 +535,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -543,7 +561,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -543,7 +561,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -556,7 +574,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -556,7 +574,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -582,7 +600,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -582,7 +600,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -596,7 +614,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -596,7 +614,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -623,7 +641,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -623,7 +641,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1232,7 +1250,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1232,7 +1250,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1245,7 +1263,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1245,7 +1263,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1254,7 +1272,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1254,7 +1272,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1262,7 +1280,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1262,7 +1280,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1274,7 +1292,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1274,7 +1292,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1286,7 +1304,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1286,7 +1304,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1305,7 +1323,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1305,7 +1323,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1315,7 +1333,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1315,7 +1333,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1332,7 +1350,14 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1332,7 +1350,14 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1371,7 +1396,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1371,7 +1396,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1425,7 +1450,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1425,7 +1450,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1448,7 +1473,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1448,7 +1473,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1489,7 +1514,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1489,7 +1514,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1508,7 +1533,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1508,7 +1533,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
/**
*Extractstheminutefromadateexpression.
*
*
*@return
*/
publicProjectionOperationBuilderextractMinute(){
@ -1517,7 +1542,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1517,7 +1542,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
/**
*Extractsthehourfromadateexpression.
*
*
*@return
*/
publicProjectionOperationBuilderextractHour(){
@ -1526,7 +1551,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1526,7 +1551,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
/**
*Extractsthesecondfromadateexpression.
*
*
*@return
*/
publicProjectionOperationBuilderextractSecond(){
@ -1535,7 +1560,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1535,7 +1560,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1544,7 +1569,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1544,7 +1569,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
/**
*Extractstheyearfromadateexpression.
*
*
*@return
*/
publicProjectionOperationBuilderextractYear(){
@ -1553,7 +1578,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1553,7 +1578,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
/**
*Extractsthemonthfromadateexpression.
*
*
*@return
*/
publicProjectionOperationBuilderextractMonth(){
@ -1562,7 +1587,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1562,7 +1587,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
/**
*Extractstheweekfromadateexpression.
*
*
*@return
*/
publicProjectionOperationBuilderextractWeek(){
@ -1571,7 +1596,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1571,7 +1596,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1580,7 +1605,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1580,7 +1605,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1589,7 +1614,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1589,7 +1614,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1599,7 +1624,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1599,7 +1624,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
/**
*Baseclassfor{@linkProjection}implementations.
*
*
*@authorOliverGierke
*/
privatestaticabstractclassProjection{
@ -1608,7 +1633,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1608,7 +1633,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1619,7 +1644,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1619,7 +1644,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
/**
*Returnsthefieldexposedbythe{@linkProjection}.
*
*
*@returnwillneverbe{@literalnull}.
*/
publicExposedFieldgetExposedField(){
@ -1629,7 +1654,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1629,7 +1654,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1639,14 +1664,14 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1639,14 +1664,14 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -95,6 +95,14 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
@@ -95,6 +95,14 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
@ -196,6 +198,20 @@ public class TypeBasedAggregationOperationContextUnitTests {
@@ -196,6 +198,20 @@ public class TypeBasedAggregationOperationContextUnitTests {
@ -352,18 +368,13 @@ public class TypeBasedAggregationOperationContextUnitTests {
@@ -352,18 +368,13 @@ public class TypeBasedAggregationOperationContextUnitTests {