forked from querydsl/querydsl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
56 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.DS_Store | ||
target | ||
test-output | ||
.classpath | ||
.project | ||
.settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 12 additions & 39 deletions
51
querydsl-core/src/main/java/com/mysema/query/group/GroupExpression.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,42 @@ | ||
package com.mysema.query.group; | ||
|
||
import java.util.List; | ||
|
||
import com.mysema.query.types.Expression; | ||
import com.mysema.query.types.Operation; | ||
import com.mysema.query.types.OperationImpl; | ||
import com.mysema.query.types.Operator; | ||
import com.mysema.query.types.OperatorImpl; | ||
import com.mysema.query.types.Visitor; | ||
import com.mysema.query.types.expr.SimpleExpression; | ||
import com.mysema.query.types.expr.SimpleOperation; | ||
|
||
/** | ||
* GroupExpression combines a GroupDefinition and related Expressions | ||
* | ||
* @author tiwe | ||
* | ||
* @param <T> | ||
*/ | ||
public class GroupExpression<T> extends SimpleExpression<T> implements Operation<T> { | ||
public class GroupExpression<T> extends SimpleOperation<T> { | ||
|
||
private static final long serialVersionUID = -339842770639127388L; | ||
|
||
private static final Operator<Object> GROUP_EXPRESSION = new OperatorImpl<Object>("GROUP_EXPRESSION", Object.class); | ||
|
||
private final GroupDefinition<?,T> definition; | ||
|
||
private final Operation< T> opMixin; | ||
|
||
@SuppressWarnings("unchecked") | ||
public GroupExpression(Class<? extends T> type, GroupDefinition<?,T> definition, Expression<?>... args) { | ||
super(type); | ||
super((Class)type, GROUP_EXPRESSION, args); | ||
this.definition = definition; | ||
this.opMixin = new OperationImpl(type, GROUP_EXPRESSION, args); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
return opMixin.equals(o); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return opMixin.hashCode(); | ||
} | ||
|
||
@Override | ||
public <R, C> R accept(Visitor<R, C> v, C context) { | ||
return v.visit(opMixin, context); | ||
} | ||
|
||
public GroupDefinition<?, T> getDefinition() { | ||
return definition; | ||
} | ||
|
||
@Override | ||
public Expression<?> getArg(int index) { | ||
return opMixin.getArg(index); | ||
} | ||
|
||
@Override | ||
public List<Expression<?>> getArgs() { | ||
return opMixin.getArgs(); | ||
} | ||
|
||
|
||
@Override | ||
public Operator<? super T> getOperator() { | ||
return opMixin.getOperator(); | ||
public boolean equals(Object o) { | ||
if (o instanceof GroupExpression<?>) { | ||
return super.equals(o) && ((GroupExpression<?>)o).getDefinition().equals(definition); | ||
} else { | ||
return false; | ||
} | ||
} | ||
|
||
} |
6 changes: 4 additions & 2 deletions
6
querydsl-core/src/main/java/com/mysema/query/group/GroupImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
/** | ||
* | ||
/* | ||
* Copyright (c) 2011 Mysema Ltd. | ||
* All rights reserved. | ||
* | ||
*/ | ||
package com.mysema.query.group; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters