Hi,
Is there a to find the id generated by Hibernate for an Object with out firing a Query after the merge is called ??
I have a the following Mapping
Code:
<class name="RiskReportDataTypes" table="RISK_REPORT_DATA_TYPES" optimistic-lock="none">
<id name="riskReportDataTypesId" type="string" unsaved-value="null">
<column name="RISK_REPORT_DATA_TYPES_ID" not-null="true" unique="true"/>
<generator class="native"/>
</id>
<property name="reportItemId" type="string" column="REPORT_ITEM_ID" not-null="true"/>
<property name="dataType" type="string" column="DATA_TYPE" length="100" />
</class>
and the code i am using is
Code:
RiskReport dpaRiskReport = new RiskReport();
riskReport.setFileName(theFile.getName());
riskReport.setJobId(fileHash);
getDataAccessBean().mergeEntity(riskReport);
getDataAccessBean().refreshEntity(riskReport);
System.out.println("riskReport.getId()="+riskReport.getId());
now the above output statement is printing null..Is there a way to get the Id generated by the hibernate Sequence with out firing a Query ??
Thanks
Sateesh