could not read column value from result set could not read column value from result set oracle oracle

could not read column value from result set


Why not try turning the association around and define it as a @ManyToOne association in ColAgreementLinkageEJB3, and then define the @OneToMany as a 'mappedBy' relationship?

So your ColAgreementLinkageEJB3 would contain:

@Column(name = "AGREEMENT_ID")private Long agreementId;@ManyToOne(fetch = FetchType.LAZY, optional = true)@JoinColumn(name = "AGREEMENT_ID", referencedColumnName = "ID", insertable = false, updatable = false)private ColAgreementHeaderEJB3 header;

Note, you don't need to put the insertable/updatable parameters on the column definition.

And your ColAgreementHeaderEJB3 Entity would contain:

@OneToMany(mappedBy = "header", fetch = FetchType.LAZY)private Set<ColAgreementLinkageEJB3> linkageSet;

Also, you do not need the @NotFound annotation as a one-to-many relationship is essentially one-to-zero-or-many.

If you want to always load the set of linkages, you would make the FetchType EAGER.


you will get this exception if you have data in table with this format Value '0000-00-00' can not be represented as java.sql.Date.hence you have delete these data and insert proper Date format in DB..!!