title: How to map One to Many / One to One to a POJO in Spring Data R2DBC
body: <p>I am trying to replicate some functionality that I was using in Spring Data JPA in the new reactive Data r2dbc. I am aware that r2dbc is not a full-fledged ORM but wanted to understand as what could be the best way to replicate the below scenario in r2dbc:</p>
  
  <pre><code>public class Doctor extends BaseModel {
  
      //other fields and id
  
      @NotNull
      @Enumerated(EnumType.STRING)
      @ElementCollection(fetch = FetchType.LAZY, targetClass = Language.class)
      @CollectionTable(name = "doctor_language",
          joinColumns = @JoinColumn(name = "doctor_id"))
      @Column(name = "language")
      private List&lt;Language&gt; languages = new ArrayList&lt;&gt;();
  
  
      @OneToMany(fetch = FetchType.LAZY, targetEntity = DoctorHealthProvider.class, mappedBy = 
          "doctor")
      private List&lt;DoctorHealthProvider&gt; providers = new ArrayList&lt;&gt;();
  
      // other fields
  }
  </code></pre>
  
  <p>A simple findById call on DoctorRepository (which extends JpaRepository) will give me <code>doctor</code> object with list of languages from <code>doctor_language</code> table and list of health providers from <code>health_provider</code> table if I use Spring Data JPA</p>
  
  <p>I was reading about projections but couldn't seem to figure out the best way to implement the above in Reactive Spring. Any help/guidelines/direction is appreciated.</p>
  
  <p>Thanks</p>