title: how to set a value to composite primary key in hibernate application
body: <p>I have a Java bean/model class with JPA annotation as below. This class has a composite key as shown below. In <code>DAO.java</code> how do I set the key to this composite key?</p>
  
  <pre><code>@EmbeddedId
  @AttributeOverrides({
      @AttributeOverride(name = "ratioFunctionId", column = @Column(name = "ratio_function_id", nullable = false, scale = 0)),
      @AttributeOverride(name = "expressionId", column = @Column(name = "expression_id", nullable = false, scale = 0))
  })
  public RatioFunctionExpressionId getId() {
      return this.id;
  }
  
  public void setId(RatioFunctionExpressionId id) {
      this.id = id;
  }
  </code></pre>