Search in sources :

Example 1 with ComparableExpressionBase

use of com.querydsl.core.types.dsl.ComparableExpressionBase in project Settler by EmhyrVarEmreis.

the class AbstractService method getComparableExpressionBase.

protected ComparableExpressionBase<?> getComparableExpressionBase(String fieldName, QEntity qObject) throws NoSuchFieldException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
    String[] t = fieldName.split("\\.");
    Object o = qObject;
    for (String fieldNameTmp : t) {
        Field f = o.getClass().getField(fieldNameTmp);
        f.setAccessible(true);
        o = f.get(o);
    }
    if (o instanceof ComparableExpressionBase) {
        return (ComparableExpressionBase<?>) o;
    } else {
        return null;
    }
}
Also used : Field(java.lang.reflect.Field) ComparableExpressionBase(com.querydsl.core.types.dsl.ComparableExpressionBase)

Aggregations

ComparableExpressionBase (com.querydsl.core.types.dsl.ComparableExpressionBase)1 Field (java.lang.reflect.Field)1