added EDateOrTime as supertype for EDate, ETime and EDateTime

This commit is contained in:
Timo Westkämper 2009-09-10 12:16:48 +00:00
parent 5573c2f10d
commit 06035ae175
5 changed files with 53 additions and 43 deletions

View File

@ -34,46 +34,6 @@ public abstract class EComparable<D extends Comparable> extends Expr<D> {
super(type);
}
@Deprecated
public EBoolean after(D right) {
return gt(right);
}
@Deprecated
public EBoolean after(Expr<D> right) {
return gt(right);
}
@Deprecated
public EBoolean aoe(D right) {
return goe(right);
}
@Deprecated
public EBoolean aoe(Expr<D> right) {
return goe(right);
}
@Deprecated
public EBoolean before(D right) {
return lt(right);
}
@Deprecated
public EBoolean before(Expr<D> right) {
return lt(right);
}
@Deprecated
public EBoolean boe(D right) {
return loe(right);
}
@Deprecated
public EBoolean boe(Expr<D> right) {
return loe(right);
}
/**
* Create a <code>this &gt; right</code> expression
*

View File

@ -20,7 +20,7 @@ import com.mysema.query.types.operation.Ops;
* @param <D>
*/
@SuppressWarnings("unchecked")
public abstract class EDate<D extends Comparable> extends EComparable<D> {
public abstract class EDate<D extends Comparable> extends EDateOrTime<D> {
private ENumber<Integer> dayOfMonth;

View File

@ -0,0 +1,50 @@
package com.mysema.query.types.expr;
/**
* EDateOrTime is a supertype for Date/Time related types
*
* @author tiwe
*
* @param <D>
*/
@SuppressWarnings("unchecked")
public abstract class EDateOrTime<D extends Comparable> extends EComparable<D> {
public EDateOrTime(Class<? extends D> type) {
super(type);
}
public EBoolean after(D right) {
return gt(right);
}
public EBoolean after(Expr<D> right) {
return gt(right);
}
public EBoolean aoe(D right) {
return goe(right);
}
public EBoolean aoe(Expr<D> right) {
return goe(right);
}
public EBoolean before(D right) {
return lt(right);
}
public EBoolean before(Expr<D> right) {
return lt(right);
}
public EBoolean boe(D right) {
return loe(right);
}
public EBoolean boe(Expr<D> right) {
return loe(right);
}
}

View File

@ -20,7 +20,7 @@ import com.mysema.query.types.operation.Ops;
* @param <D>
*/
@SuppressWarnings("unchecked")
public abstract class EDateTime<D extends Comparable> extends EComparable<D> {
public abstract class EDateTime<D extends Comparable> extends EDateOrTime<D> {
private ENumber<Integer> dayOfMonth;

View File

@ -19,7 +19,7 @@ import com.mysema.query.types.operation.Ops;
* @param <D>
*/
@SuppressWarnings("unchecked")
public abstract class ETime<D extends Comparable> extends EComparable<D> {
public abstract class ETime<D extends Comparable> extends EDateOrTime<D> {
private ENumber<Integer> hours;