mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
This commit is contained in:
parent
f1b75aac98
commit
f2d557e508
@ -73,31 +73,14 @@ object Conversions {
|
||||
|
||||
implicit def javaMapPath[K,V](l: java.util.Map[K,V]): MapPath[K,V] = aliasFactory.getCurrentAndReset();
|
||||
|
||||
// implicit def expression[T](arg: T): Expression[T] = {
|
||||
// var rv : Expression[T] = aliasFactory.getCurrentAndReset();
|
||||
// if (rv != null){
|
||||
// rv;
|
||||
// }else{
|
||||
// arg match {
|
||||
// case x:Expression[T] => x;
|
||||
// case x:ManagedObject => x.__mappedPath.asInstanceOf[Expression[T]];
|
||||
// case _ => null;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//implicit def simplePath(s: Object): SimplePath[_] = aliasFactory.getCurrentAndReset();
|
||||
|
||||
implicit def entityPath[T](arg: T): EntityPathImpl[T] = {
|
||||
var rv : EntityPathImpl[T] = aliasFactory.getCurrentAndReset();
|
||||
if (rv != null) {
|
||||
rv;
|
||||
}else {
|
||||
arg match {
|
||||
case x:EntityPathImpl[T] => x;
|
||||
case x:ManagedObject => x.__mappedPath.asInstanceOf[EntityPathImpl[T]];
|
||||
case _ => null;
|
||||
}
|
||||
val rv = Option(aliasFactory.getCurrentAndReset());
|
||||
rv.getOrElse(arg) match {
|
||||
case x:EntityPathImpl[T] => x;
|
||||
case x:ManagedObject => x.__mappedPath.asInstanceOf[EntityPathImpl[T]];
|
||||
case _ => null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -25,6 +25,15 @@ object Constants {
|
||||
|
||||
}
|
||||
|
||||
object Resolver {
|
||||
|
||||
def resolve(value: java.lang.Integer) = ConstantImpl.create(value.intValue);
|
||||
|
||||
def resolve(value: String) = ConstantImpl.create(value);
|
||||
|
||||
def resolve[T](value: T) = new ConstantImpl(value);
|
||||
}
|
||||
|
||||
trait SimpleExpression[T] extends Expression[T] {
|
||||
|
||||
def $eq(right: T): BooleanExpression = $eq(constant(right)); // XXX "is"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user