title: Annotation @BatchSize not working
body: <p>I have 3 JPA classes an <code>Account</code> that includes a single <code>Address</code> which has a <code>City</code> Object</p>
  
  <pre><code>public class Account implements java.io.Serializable {
  
  // Fields
  private Address address;
  
  
  //Setters and getters for other fields
  
  @OneToOne(fetch = FetchType.LAZY, mappedBy = "account")
  public Address getAccountAddress() {
      return this.address;
  }
  
  public void setAccountAddress(Address address) {
      this.address = address;
  }
  </code></pre>
  
  <hr>
  
  <pre><code>public class Address implements java.io.Serializable {
  
  // Fields
  private City city;
  
  //Setters and getters for other fields
  
  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "CityId", nullable = false)
  public City getCity() {
      return this.city;
  }
  </code></pre>
  
  <p>I wanted to solve the N+1 select problem, I tried using @BatchSize above the classes, but it didn't stop the N+1 calls to the Database, therefore I had to set the batchSize in my <code>persistence.xml</code> </p>
  
  <pre><code> &lt;property name="hibernate.default_batch_fetch_size" value="50" /&gt;
   &lt;property name="hibernate.jdbc.batch_size" value="50" /&gt;
  </code></pre>
  
  <p>Now It works except for one entity which is <code>Address</code>, so I get one SQL select for City and for Account but I still get N SQL select for Address. I've noticed that the only difference is that the relationship between Account and Address is one-to-one</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>Can the relation one-to-one be the reason I'm still getting N select on the table Address? and why?</li>
  <li>Why isn't the Annotation working (Why did I have to set it in <code>persistence.xml</code>), is there some setting that should be done for the annotation to be effective ?</li>
  </ol>