mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-24 21:07:26 +08:00
updated to version 0.2.5
This commit is contained in:
parent
ea56f46e84
commit
a1b218ba64
@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>com.mysema.querydsl</groupId>
|
||||
<artifactId>querydsl-root</artifactId>
|
||||
<version>0.2.4</version>
|
||||
<version>0.2.5</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.mysema.querydsl</groupId>
|
||||
|
||||
@ -51,11 +51,6 @@ public class Alias {
|
||||
public Expr<?> getFrom() {return from;}
|
||||
public java.lang.String getTo() {return to;}
|
||||
}
|
||||
|
||||
// public interface Simple{
|
||||
// Expr<?> getFrom();
|
||||
// String getTo();
|
||||
// }
|
||||
|
||||
public interface ToPath{
|
||||
Expr<?> getFrom();
|
||||
|
||||
@ -23,27 +23,15 @@ public abstract class Expr<D> {
|
||||
public Boolean ne(D right){return IntGrammar.ne(this, right);}
|
||||
public Boolean ne(Expr<? super D> right){return IntGrammar.ne(this, right);}
|
||||
|
||||
// public static abstract class Expr<D>{
|
||||
// private final Class<D> type;
|
||||
// Expr(Class<D> type){this.type = type;}
|
||||
// public Boolean eq(D right){return IntGrammar.eq(this, right);}
|
||||
// public Boolean eq(Expr<? super D> right){return IntGrammar.eq(this, right);}
|
||||
// public Class<D> getType(){ return type;}
|
||||
// public Boolean ne(D right){return IntGrammar.ne(this, right);}
|
||||
// public Boolean ne(Expr<? super D> right){return IntGrammar.ne(this, right);}
|
||||
// }
|
||||
|
||||
public static abstract class Boolean extends Simple<java.lang.Boolean>{
|
||||
public static abstract class Boolean extends Literal<java.lang.Boolean>{
|
||||
public Boolean() {super(java.lang.Boolean.class);}
|
||||
public Boolean and(Boolean right) {return IntGrammar.and(this, right);}
|
||||
public Boolean or(Boolean right) {return IntGrammar.or(this, right);}
|
||||
}
|
||||
|
||||
public interface CollectionType<D>{
|
||||
|
||||
}
|
||||
public interface CollectionType<D>{ }
|
||||
|
||||
public static abstract class Comparable<D extends java.lang.Comparable<D>> extends Simple<D>{
|
||||
public static abstract class Comparable<D extends java.lang.Comparable<D>> extends Literal<D>{
|
||||
public Comparable(Class<D> type) {super(type);}
|
||||
public Boolean after(D right) {return IntGrammar.after(this,right);}
|
||||
public Boolean after(Expr<D> right) {return IntGrammar.after(this,right);}
|
||||
@ -96,6 +84,14 @@ public abstract class Expr<D> {
|
||||
public Simple(Class<D> type) {super(type);}
|
||||
public Expr<D> as(java.lang.String to){return IntGrammar.as(this, to);}
|
||||
}
|
||||
|
||||
public static abstract class Embeddable<D> extends Simple<D>{
|
||||
public Embeddable(Class<D> type) {super(type);}
|
||||
}
|
||||
|
||||
public static abstract class Literal<D> extends Simple<D>{
|
||||
public Literal(Class<D> type) {super(type);}
|
||||
}
|
||||
|
||||
public static abstract class String extends Comparable<java.lang.String>{
|
||||
public String() {super(java.lang.String.class);}
|
||||
|
||||
@ -22,22 +22,6 @@ import com.mysema.query.grammar.types.Expr.CollectionType;
|
||||
* @version $Id$
|
||||
*/
|
||||
class IntGrammar{
|
||||
|
||||
// static final <A extends Comparable<A>> OrderSpecifier<A> _orderAsc(Expr<A> target) {
|
||||
// checkArg("target",target);
|
||||
// OrderSpecifier<A> os = new OrderSpecifier<A>();
|
||||
// os.order = Order.ASC;
|
||||
// os.target = target;
|
||||
// return os;
|
||||
// }
|
||||
|
||||
// static final <A extends Comparable<A>> OrderSpecifier<A> _orderDesc(Expr<A> target) {
|
||||
// checkArg("target",target);
|
||||
// OrderSpecifier<A> os = new OrderSpecifier<A>();
|
||||
// os.order = Order.DESC;
|
||||
// os.target = target;
|
||||
// return os;
|
||||
// }
|
||||
|
||||
static <A extends Comparable<A>> Expr.Boolean after(Expr<A> left,
|
||||
A right) {
|
||||
|
||||
@ -20,11 +20,6 @@ public interface Operation<OP,RT> {
|
||||
Expr<?>[] getArgs();
|
||||
Op<OP> getOperator();
|
||||
|
||||
// public interface Operation<OP,RT>{
|
||||
// Expr<?>[] getArgs();
|
||||
// Op<OP> getOperator();
|
||||
// }
|
||||
|
||||
public static class Boolean extends Expr.Boolean implements Operation<java.lang.Boolean,java.lang.Boolean>{
|
||||
private final Expr<?>[] args;
|
||||
private final Op<java.lang.Boolean> op;
|
||||
|
||||
@ -23,12 +23,6 @@ public interface Path<C> {
|
||||
PathMetadata<?> getMetadata();
|
||||
Expr.Boolean isnotnull();
|
||||
Expr.Boolean isnull();
|
||||
|
||||
// public interface Path<C>{
|
||||
// PathMetadata<?> getMetadata();
|
||||
// ExprBoolean isnotnull();
|
||||
// ExprBoolean isnull();
|
||||
// }
|
||||
|
||||
public static class Boolean extends Expr.Boolean implements Simple<java.lang.Boolean>{
|
||||
private final PathMetadata<java.lang.String> metadata;
|
||||
@ -66,11 +60,11 @@ public interface Path<C> {
|
||||
this.type = type;
|
||||
this.metadata = metadata;
|
||||
}
|
||||
public Expr.Simple<D> get(Expr<Integer> index) {
|
||||
return new Literal<D>(type, forListAccess(this, index));
|
||||
public Expr.Literal<D> get(Expr<Integer> index) {
|
||||
return new Path.Literal<D>(type, forListAccess(this, index));
|
||||
}
|
||||
public Expr.Simple<D> get(int index) {
|
||||
return new Literal<D>(type, forListAccess(this, index));
|
||||
public Expr.Literal<D> get(int index) {
|
||||
return new Path.Literal<D>(type, forListAccess(this, index));
|
||||
}
|
||||
public PathMetadata<?> getMetadata() {return metadata;}
|
||||
public Expr.Boolean isnotnull() {return IntGrammar.isnotnull(this);}
|
||||
@ -92,11 +86,11 @@ public interface Path<C> {
|
||||
this.valueType = valueType;
|
||||
this.metadata = metadata;
|
||||
}
|
||||
public Expr.Simple<V> get(Expr<K> key) {
|
||||
return new Literal<V>(valueType, forMapAccess(this, key));
|
||||
public Expr.Literal<V> get(Expr<K> key) {
|
||||
return new Path.Literal<V>(valueType, forMapAccess(this, key));
|
||||
}
|
||||
public Expr.Simple<V> get(K key) {
|
||||
return new Literal<V>(valueType, forMapAccess(this, key));
|
||||
public Expr.Literal<V> get(K key) {
|
||||
return new Path.Literal<V>(valueType, forMapAccess(this, key));
|
||||
}
|
||||
public PathMetadata<?> getMetadata() {return metadata;}
|
||||
public Expr.Boolean isnotnull() {return IntGrammar.isnotnull(this);}
|
||||
@ -127,8 +121,8 @@ public interface Path<C> {
|
||||
protected <A> EntityCollection<A> _entitycol(java.lang.String path,Class<A> type) {
|
||||
return new EntityCollection<A>(type, forProperty(this, path));
|
||||
}
|
||||
protected <A> Literal<A> _simple(java.lang.String path, Class<A> type){
|
||||
return new Literal<A>(type, forProperty(this, path));
|
||||
protected <A> Expr.Literal<A> _simple(java.lang.String path, Class<A> type){
|
||||
return new Path.Literal<A>(type, forProperty(this, path));
|
||||
}
|
||||
protected <A> ComponentCollection<A> _simplecol(java.lang.String path,Class<A> type) {
|
||||
return new ComponentCollection<A>(type, forProperty(this, path));
|
||||
@ -209,7 +203,7 @@ public interface Path<C> {
|
||||
Expr<D> as(java.lang.String to);
|
||||
}
|
||||
|
||||
public static class Literal<D> extends Expr.Simple<D> implements Simple<D>{
|
||||
public static class Literal<D> extends Expr.Literal<D> implements Simple<D>{
|
||||
private final PathMetadata<?> metadata;
|
||||
public <T> Literal(Class<D> type, PathMetadata<?> metadata) {
|
||||
super(type);
|
||||
|
||||
@ -69,8 +69,6 @@ public abstract class Visitor<T extends Visitor<T>> {
|
||||
|
||||
protected abstract void visit(Alias.Simple<?> expr);
|
||||
|
||||
// protected abstract void visit(Alias.Simple expr);
|
||||
|
||||
protected abstract void visit(Alias.ToPath expr);
|
||||
|
||||
protected abstract void visit(Expr.Constant<?> expr);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user