How to assign @Id and @OneToMany annotations to same variable in Hibernate?
<p>I would like to add the @Id and @OneToMany Annotations to the same variable, but i am getting the bleow exception:</p>

<p>Caused by: java.lang.NullPointerException
    at org.hibernate.cfg.Ejb3JoinColumn.checkReferencedColumnsType(Ejb3JoinColumn.java:537)
    at org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:125)
    at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:114)
    at org.hibernate.cfg.Configuration.processEndOfQueue(Configuration.java:1580)
    at org.hibernate.cfg.Configuration.processFkSecondPassInOrder(Configuration.java:1503)</p>

<p>... 40 more</p>

<p>Here is my Entity Class :</p>

<pre><code>@Entity
</code></pre>

<p>@Table(name="TABLE_A", schema="Test")
public class TableA implements Serializable {</p>

<pre><code>@Id
@PrimaryKeyJoinColumn
@OneToMany(mappedBy="tableB.prcCatIdNo")
private List&lt;TableB&gt; ident;

@Column(name="FOP_DAYS")
private BigDecimal fopDays;
...
</code></pre>

<p>}</p>

<p>Can someone please help</p>