QueryDSL, Spring Data: Select datetime between constant and database value with Predicate
<p>Hi I would like to generate a Predicate for spring data QueryDSLRepository that would generate following query (or equivalent):</p>

<pre><code>SELECT * FROM USER user JOIN PASSWORD_POLICY policy
ON
    user.password_policy_oid = policy.password_policy_oid
WHERE
    user.password_expiration_date BETWEEN CURRENT TIMESTAMP - (SELECT EXPIRATION_WARN_PERIOD_IN_DAYS FROM PASSWORD_POLICY subQueryPolicy WHERE subQueryPolicy.password_policy_oid = policy.password_policy_oid) DAYS AND CURRENT TIMESTAMP
</code></pre>

<p>The meaning of this query would be:
Get me all users that password is about to expire</p>

<p>and by about to expire I mean - password expiration date is between now and (now - EXPIRATION_WARN_PERIOD_IN_DAYS from PASSWORD_POLICY table)</p>

<p>Is it possible?</p>