Move FactoryExpression expansion and compression to an adapter

Bug #720590 reported by Timo Westkämper
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned

Bug Description

Currently the FactoryExpression and expansion and compression contract is bound to the FactoryExpression implementations themselves. To simplify FactoryExpression creation the expansion and compression could be moved to an decorator implementation.

summary: - Moved FactoryExpression expansion and compression to an adapter
+ Move FactoryExpression expansion and compression to an adapter
Changed in querydsl:
status: New → Fix Committed
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Here is a simple example of the wrapping :

// original arguments
    StringPath str1 = new StringPath("str1");
    StringPath str2 = new StringPath("str2");
    StringPath str3 = new StringPath("str3");
    StringPath str4 = new StringPath("str3");

// orginal factory expression
    Concatenation concat2 = new Concatenation(new Concatenation(str1, new Concatenation(str2, str3)), str4);

// wrapped
    FactoryExpression<String> wrapped = FactoryExpressionUtils.wrap(concat2);
    assertEquals(Arrays.asList(str1, str2, str3, str4), wrapped.getArgs());
    assertEquals("1234", wrapped.newInstance("1","2","3","4"));

The FactoryExpressionUtils.wrap(...) call should only be used in Query implementation to normalize a FactoryExpression

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Released in 2.1.2

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.