i have following Hibernate entity class, it works fine but Association of ProfileBean i would like to exclude few fields like Passwords etc, is there a way to have a conditional join and select only few columns?

```
@Root(name = "message")
@XmlRootElement
@Entity
@Table(name="app_messages")
public class MessageBean implements Serializable, DataModel {

    @Id
    @Column(name = "id")
    @GeneratedValue
    @Element
    private Long id;
    @Column(name = "from_id")
    @Element
    private Long fromUserId;
    @Column(name = "to_id")
    @Element
    private Long toUserId;
    @Column(name = "message")
    @Element
    private String message;
    @Column(name = "sent_date")
    @Element
    private Date sentDate;
    @Column(name = "read_date")
    @Element
    private Date readDate;
    @Column(name = "thread_id")
    @Element
    private Long threadId;

    @OneToOne(cascade=CascadeType.ALL)  
    @JoinTable(name="user_profiles",  
    joinColumns={@JoinColumn(name="user_id", referencedColumnName="to_id")})  
    private ProfileBean toUser;

    @OneToOne(cascade=CascadeType.ALL)  
    @JoinTable(name="user_profiles",  
    joinColumns={@JoinColumn(name="user_id", referencedColumnName="from_id")})  
    private ProfileBean fromUser;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "thread_id", nullable = false)
    private MessageThreadBean messageThreadBean;

    /**
     * @return the id public long getId() { return id; }
     *
     * /
     **
     * @param id the id to set
     */
    @XmlElement
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the fromUserId
     */
    public Long getFromUserId() {
        return fromUserId;
    }

    /**
     * @param fromUserId the fromUserId to set
     */
    @XmlElement
    public void setFromUserId(Long fromUserId) {
        this.fromUserId = fromUserId;
    }

    /**
     * @return the toUserId
     */
    public Long getToUserId() {
        return toUserId;
    }

    /**
     * @param toUserId the toUserId to set
     */
    @XmlElement
    public void setToUserId(Long toUserId) {
        this.toUserId = toUserId;
    }

    /**
     * @return the message
     */
    public String getMessage() {
        return message;
    }

    /**
     * @param message the message to set
     */
    @XmlElement
    public void setMessage(String message) {
        this.message = message;
    }

    /**
     * @return the sentDate
     */
    public Date getSentDate() {
        return sentDate;
    }

    /**
     * @param sentDate the sentDate to set
     */
    @XmlElement
    public void setSentDate(Date sentDate) {
        this.sentDate = sentDate;
    }

    /**
     * @return the readDate
     */
    public Date getReadDate() {
        return readDate;
    }

    /**
     * @param readDate the readDate to set
     */
    @XmlElement
    public void setReadDate(Date readDate) {
        this.readDate = readDate;
    }

    /**
     * @return the threadId
     */
    public Long getThreadId() {
        return threadId;
    }

    /**
     * @param threadId the threadId to set
     */
    @XmlElement
    public void setThreadId(Long threadId) {
        this.threadId = threadId;
    }

    /**
     * @return the fromUser
     */
    public ProfileBean getFromUser() {
        return fromUser;
    }

    /**
     * @param fromUser the fromUser to set
     */
    public void setFromUser(ProfileBean fromUser) {
        this.fromUser = fromUser;
    }

    /**
     * @return the toUser
     */
    public ProfileBean getToUser() {
        return toUser;
    }

    /**
     * @param toUser the toUser to set
     */
    public void setToUser(ProfileBean toUser) {
        this.toUser = toUser;
    }

    /**
     * @return the messageThreadBean
     */
    public MessageThreadBean getMessageThreadBean() {
        return messageThreadBean;
    }

    /**
     * @param messageThreadBean the messageThreadBean to set
     */
    public void setMessageThreadBean(MessageThreadBean messageThreadBean) {
        this.messageThreadBean = messageThreadBean;
    }
}

```

There is OneToOne association of toUserId and fromUserId with ProfileBean. fromUserId is the user who is sending the message, toUserId is the user who is going to receive the message. If we can get some hql solution which we can pass in annotation somewhere would be great.