How can I use Spring Data Projection with a Transient property?
<p>I'm using Spring Data with MongoDB and a projection interface for one of the repositories.<br>
The issue is that a transient field on my entity is not recognized as a valid property on the model since it is not part of the query results. [assumption]  </p>

<p>Is there a workaround for this?  </p>

<p>Example -</p>

<pre><code>// Entity class fields 
@JsonProperty(access=Access.WRITE_ONLY)
private String password;
@Id
private String username;
private String displayName;
@DBRef
private Set&lt;EmailAddress&gt; emailAddresses = new HashSet&lt;&gt;();
@DBRef
@NotEmpty
private EmailAddress primaryEmailAddress;
private boolean hidePrimaryEmailAddress;
private String firstName;
private String lastName;
@JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NONE)
private Set&lt;Role&gt; authorities;
private boolean accountNonExpired;
private boolean accountNonLocked;
private boolean credentialsNonExpired;
private boolean enabled;
@Transient
private String gravatarUrl;

.....

// Spring Data Projection 
public interface ProfileProjection {
  @Value("#{target.primaryEmailAddress.emailAddress}")
  String getEmailAddress();
  String getUsername();
  String getDisplayName();
  String getGravatarUrl();
}  

// Repository
public interface UserRepository extends ExtendedMongoRepository&lt;SproutUser, String&gt; {
    ProfileProjection findFirstByUsername(String username);
}  
</code></pre>

<p>Exception -</p>

<pre><code>No property gravatarUrl found on savantly.sprout.domain.SproutUser!
</code></pre>