Hibernate @OneToOne is null
<p>I'm trying to get Hibernate @OneToOne annotation working with 2 classes, Hito and Portada. Portada table has the foreign key of Hito, an int attribute called hito.</p>
<p>My entities looks like this:</p>
<p>Hito:</p>
<pre><code>@Entity
@Table(name = &quot;hito&quot;)
public class Hito implements Serializable {
    //...other attributes
    private Portada portada;

    //...getters and setters from other attributes

    @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = &quot;hito&quot;)
    public Portada getPortada(){ return portada;}

    public void setPortada(Portada portada){ this.portada = portada;}
}
</code></pre>
<p>Portada:</p>
<pre><code>@Entity
@Table(name = &quot;portada&quot;)
public class Portada {
    //...other attributes
    private Hito hito;

    //...getters and setters from other attributes
    @OneToOne(fetch = FetchType.EAGER, optional = false)
    @JoinColumn(name = &quot;hito&quot;)
    public Hito getHito() {return hito;}
      
    public void setHito(Hito hito) {this.hito = hito;}

}
</code></pre>
<p>When I call hito.getPortada(), I expect a Portada object, but it returns null.</p>
<p>Any suggestions?</p>