This commit is contained in:
Timo Westkämper 2010-09-18 15:25:31 +00:00
parent f1b75aac98
commit f2d557e508
2 changed files with 14 additions and 22 deletions

View File

@ -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;
}
}

View File

@ -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"