title: Can Hibernate select a join table without including some rows
body: <p>I use Hibernate to control my database and I have 2 tables: 
  </p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `User`(
      `id`        INT             NOT NULL    AUTO_INCREMENT,
      `name`      VARCHAR(255)    NOT NULL    DEFAULT '',
      `account`       VARCHAR(255)    NOT NULL    DEFAULT '',
      `password`      VARCHAR(255)    NOT NULL    DEFAULT '',
      PRIMARY KEY (`id`)
  )
  
  CREATE TABLE IF NOT EXISTS `Project` (
      `id`        INT             NOT NULL    AUTO_INCREMENT,
      `manager`   INT             NOT NULL,   
      `name`      VARCHAR(255)    NOT NULL    DEFAULT '', 
      PRIMARY KEY (`id`),
      FOREIGN KEY (`manager`) REFERENCES `User`(`id`)
  )
  </code></pre>
  
  <p>And I have done the mapping: </p>
  
  <p><em>User:</em> </p>
  
  <pre><code>// ... import code
  @Entity
  @Table
  public class User {
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private int id;
      @Column
      private String name, account, password;
  
      @OneToMany(mappedBy = "manager")
      private List&lt;Project&gt; projects;
  
      public User() {
      }
      //  ... Getter &amp; Setter code
  }
  </code></pre>
  
  <p><em>Project:</em> </p>
  
  <pre><code>// ... import code
  @Entity
  @Table
  public class Project {
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private int id;
      @Column
      private String name;
  
      @ManyToOne
      @JoinColumn(name = "manager")
      private User manager;
  
      public Project () {
      }
      //  ... Getter &amp; Setter code
  }
  </code></pre>
  
  <p>I want to know whether it is possible when I select projects, the project will include its manager data but not have password.</p>
  
  <p>In other ways, I want that each project I get will like this (format as JSON):</p>
  
  <pre class="lang-json prettyprint-override"><code>{
      "id": 0,
      "name": "A test project",
      "manager": {
          "id": 0,
          "name": "John Smith"
          "accound": "user1",
          "password": null
      }
  }
  </code></pre>