title: Reference an object on an attribute other the id
body: <p>I have the class Structure:</p>
  
  <pre><code>@Entity
  @Table(name = "structure")
  
  public class Structure {
  
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "id_structure", unique = true)
  private Long id;
  
  @Column(name = "code_structure")
  private String codeStructure;
  
  @ManyToOne
  @JoinColumn(name = "code_structure_mere")
  private Structure parentStructure;
  
  @OneToMany(mappedBy = "parentStructure")
  private List&lt;Structure&gt; sousStructures;
  
  ....
  </code></pre>
  
  <p>for the parentStructure: mapped by <code>code_structure_mere</code>
      in db this field contains the <code>code_structure</code> of the parent structure and not its id.</p>
  
  <p>I have the interface StructureRepository from which I wanan retrieve all the structures that I have. I get an error executing:
  <code>structureRepository.findAll()</code> :</p>
  
  <pre><code>SQL Error: 0, SQLState: 22003
  Mauvaise valeur pour le type long : 09N008000
  </code></pre>
  
  <p>Can I use another field other than the id to set the parent structure?</p>