moved Detachable to com.mysema.query.types.query

This commit is contained in:
Timo Westkämper 2010-03-22 19:04:12 +00:00
parent aa53307202
commit ceca163268
11 changed files with 50 additions and 45 deletions

View File

@ -7,7 +7,6 @@ package com.mysema.query.serialization;
import java.lang.reflect.Field;
import com.mysema.query.QueryException;
import com.mysema.query.types.Templates;
import com.mysema.query.types.operation.OperatorImpl;
import com.mysema.query.types.operation.Ops;
@ -99,7 +98,7 @@ public class JavaTemplates extends Templates {
add(op, "Math." + getTemplate(op));
}
} catch (IllegalAccessException e) {
throw new QueryException(e.getMessage(), e);
throw new RuntimeException(e.getMessage(), e);
}
add(Ops.MOD, "{0} % {0}");

View File

@ -5,7 +5,6 @@
*/
package com.mysema.query.support;
import com.mysema.query.Detachable;
import com.mysema.query.types.EBoolean;
import com.mysema.query.types.EComparable;
import com.mysema.query.types.EDate;
@ -18,6 +17,7 @@ import com.mysema.query.types.query.BooleanSubQuery;
import com.mysema.query.types.query.ComparableSubQuery;
import com.mysema.query.types.query.DateSubQuery;
import com.mysema.query.types.query.DateTimeSubQuery;
import com.mysema.query.types.query.Detachable;
import com.mysema.query.types.query.ListSubQuery;
import com.mysema.query.types.query.NumberSubQuery;
import com.mysema.query.types.query.ObjectSubQuery;

View File

@ -6,7 +6,6 @@
package com.mysema.query.support;
import com.mysema.commons.lang.Assert;
import com.mysema.query.Detachable;
import com.mysema.query.types.EBoolean;
import com.mysema.query.types.EComparable;
import com.mysema.query.types.EDate;
@ -20,6 +19,7 @@ import com.mysema.query.types.query.BooleanSubQuery;
import com.mysema.query.types.query.ComparableSubQuery;
import com.mysema.query.types.query.DateSubQuery;
import com.mysema.query.types.query.DateTimeSubQuery;
import com.mysema.query.types.query.Detachable;
import com.mysema.query.types.query.ListSubQuery;
import com.mysema.query.types.query.NumberSubQuery;
import com.mysema.query.types.query.ObjectSubQuery;

View File

@ -5,7 +5,6 @@
*/
package com.mysema.query.support;
import com.mysema.query.Detachable;
import com.mysema.query.types.EBoolean;
import com.mysema.query.types.EComparable;
import com.mysema.query.types.EDate;
@ -18,6 +17,7 @@ import com.mysema.query.types.query.BooleanSubQuery;
import com.mysema.query.types.query.ComparableSubQuery;
import com.mysema.query.types.query.DateSubQuery;
import com.mysema.query.types.query.DateTimeSubQuery;
import com.mysema.query.types.query.Detachable;
import com.mysema.query.types.query.ListSubQuery;
import com.mysema.query.types.query.NumberSubQuery;
import com.mysema.query.types.query.ObjectSubQuery;

View File

@ -12,8 +12,6 @@ import java.util.List;
import org.apache.commons.lang.ClassUtils;
import com.mysema.query.QueryException;
/**
* EConstructor represents a constructor invocation
*
@ -49,7 +47,7 @@ public class EConstructor<D> extends Expr<D> {
}
}
}
throw new QueryException("Got no matching constructor");
throw new ExprException("Got no matching constructor");
}
private final List<Expr<?>> args;
@ -116,9 +114,9 @@ public class EConstructor<D> extends Expr<D> {
try {
return (Constructor<D>) getType().getConstructor(parameterTypes);
} catch (SecurityException e) {
throw new QueryException(e.getMessage(), e);
throw new ExprException(e.getMessage(), e);
} catch (NoSuchMethodException e) {
throw new QueryException(e.getMessage(), e);
throw new ExprException(e.getMessage(), e);
}
}

View File

@ -0,0 +1,19 @@
package com.mysema.query.types;
public class ExprException extends RuntimeException{
private static final long serialVersionUID = 6031724386976562965L;
public ExprException(String msg){
super(msg);
}
public ExprException(String msg, Throwable t){
super(msg, t);
}
public ExprException(Throwable t){
super(t);
}
}

View File

@ -12,10 +12,10 @@ import java.util.Map;
import javax.annotation.Nullable;
import com.mysema.query.QueryException;
import com.mysema.query.types.EBoolean;
import com.mysema.query.types.Expr;
import com.mysema.query.types.ExprConst;
import com.mysema.query.types.ExprException;
import com.mysema.query.types.Path;
import com.mysema.query.types.PathMetadata;
import com.mysema.query.types.Visitor;
@ -83,13 +83,13 @@ public class PEntity<D> extends Expr<D> implements Path<D> {
}
} catch (InstantiationException e) {
throw new QueryException(e.getMessage(), e);
throw new ExprException(e.getMessage(), e);
} catch (IllegalAccessException e) {
throw new QueryException(e.getMessage(), e);
throw new ExprException(e.getMessage(), e);
} catch (InvocationTargetException e) {
throw new QueryException(e.getMessage(), e);
throw new ExprException(e.getMessage(), e);
} catch (NoSuchMethodException e) {
throw new QueryException(e.getMessage(), e);
throw new ExprException(e.getMessage(), e);
}
}

View File

@ -18,11 +18,11 @@ import java.util.Set;
import javax.annotation.Nullable;
import com.mysema.commons.lang.Assert;
import com.mysema.query.QueryException;
import com.mysema.query.types.EBoolean;
import com.mysema.query.types.ECollectionBase;
import com.mysema.query.types.EList;
import com.mysema.query.types.Expr;
import com.mysema.query.types.ExprException;
import com.mysema.query.types.Path;
import com.mysema.query.types.PathMetadata;
import com.mysema.query.types.Visitor;
@ -87,13 +87,13 @@ public class PList<E, Q extends Expr<E>> extends ECollectionBase<List<E>,E> impl
PathMetadata<Integer> md = forListAccess(index);
return newInstance(md);
} catch (NoSuchMethodException e) {
throw new QueryException(e);
throw new ExprException(e);
} catch (InstantiationException e) {
throw new QueryException(e);
throw new ExprException(e);
} catch (IllegalAccessException e) {
throw new QueryException(e);
throw new ExprException(e);
} catch (InvocationTargetException e) {
throw new QueryException(e);
throw new ExprException(e);
}
}
@ -108,13 +108,13 @@ public class PList<E, Q extends Expr<E>> extends ECollectionBase<List<E>,E> impl
PathMetadata<Integer> md = forListAccess(index);
return newInstance(md);
} catch (NoSuchMethodException e) {
throw new QueryException(e);
throw new ExprException(e);
} catch (InstantiationException e) {
throw new QueryException(e);
throw new ExprException(e);
} catch (IllegalAccessException e) {
throw new QueryException(e);
throw new ExprException(e);
} catch (InvocationTargetException e) {
throw new QueryException(e);
throw new ExprException(e);
}
}

View File

@ -15,10 +15,10 @@ import java.util.Set;
import javax.annotation.Nullable;
import com.mysema.query.QueryException;
import com.mysema.query.types.EBoolean;
import com.mysema.query.types.EMapBase;
import com.mysema.query.types.Expr;
import com.mysema.query.types.ExprException;
import com.mysema.query.types.Path;
import com.mysema.query.types.PathMetadata;
import com.mysema.query.types.Visitor;
@ -90,13 +90,13 @@ public class PMap<K, V, E extends Expr<V>> extends EMapBase<K, V> implements Pat
PathMetadata<K> md = forMapAccess(key);
return newInstance(md);
} catch (NoSuchMethodException e) {
throw new QueryException(e);
throw new ExprException(e);
} catch (InstantiationException e) {
throw new QueryException(e);
throw new ExprException(e);
} catch (IllegalAccessException e) {
throw new QueryException(e);
throw new ExprException(e);
} catch (InvocationTargetException e) {
throw new QueryException(e);
throw new ExprException(e);
}
}
@ -106,13 +106,13 @@ public class PMap<K, V, E extends Expr<V>> extends EMapBase<K, V> implements Pat
PathMetadata<K> md = forMapAccess(key);
return newInstance(md);
} catch (NoSuchMethodException e) {
throw new QueryException(e);
throw new ExprException(e);
} catch (InstantiationException e) {
throw new QueryException(e);
throw new ExprException(e);
} catch (IllegalAccessException e) {
throw new QueryException(e);
throw new ExprException(e);
} catch (InvocationTargetException e) {
throw new QueryException(e);
throw new ExprException(e);
}
}

View File

@ -3,7 +3,7 @@
* All rights reserved.
*
*/
package com.mysema.query;
package com.mysema.query.types.query;
import com.mysema.query.types.EBoolean;
import com.mysema.query.types.EComparable;
@ -13,15 +13,6 @@ import com.mysema.query.types.ENumber;
import com.mysema.query.types.EString;
import com.mysema.query.types.ETime;
import com.mysema.query.types.Expr;
import com.mysema.query.types.query.BooleanSubQuery;
import com.mysema.query.types.query.ComparableSubQuery;
import com.mysema.query.types.query.DateSubQuery;
import com.mysema.query.types.query.DateTimeSubQuery;
import com.mysema.query.types.query.ListSubQuery;
import com.mysema.query.types.query.NumberSubQuery;
import com.mysema.query.types.query.ObjectSubQuery;
import com.mysema.query.types.query.StringSubQuery;
import com.mysema.query.types.query.TimeSubQuery;
/**
* Detachable defines methods for the construction of SubQuery instances

View File

@ -11,8 +11,6 @@ import java.util.Collection;
import org.apache.commons.lang.ClassUtils;
import com.mysema.query.QueryException;
/**
* @author tiwe
*