Note that there are some explanatory texts on larger screens.

plurals
  1. POspringframework/hibernate returns duplicate rows
    text
    copied!<p>I am using springframework HibernateTemplate to query a single table. Using debug settings I have captured the query that Hibernate is generating, run it in Toad, and gotten 75 distinct rows. However in my application I get a collection with 75 duplicate records and nothing else.</p> <p>The mapping is as simple as it gets:</p> <pre><code>&lt;hibernate-mapping&gt; &lt;class name="com.p.e.d.s.PmaSummary" &lt;!-- hiding info --&gt; table="V_PMA_SUMMARY" schema="ECREDIT"&gt; &lt;cache usage="read-only" /&gt; &lt;id column="member_id" name="memberId"&gt; &lt;generator class="assigned" /&gt; &lt;/id&gt; &lt;property name="weekEnding" column="week_ending" /&gt; &lt;property name="actualInvoice" column="actual_invoice" /&gt; &lt;property name="ftrAdjustments" column="ftr_adjustments" /&gt; &lt;property name="edcLseAdjustments" column="edc_lse_adjustments" /&gt; &lt;property name="blidAdjustments" column="blid_adjustments" /&gt; &lt;property name="pmaMiscAdjustments" column="pma_misc_adjustments" /&gt; &lt;property name="pmaEarlyPayments" column="pma_early_payments" /&gt; &lt;property name="adjInv" column="adj_inv" /&gt; &lt;property name="adjInvExcEarlyPayment" column="adj_inv_exc_early_payment" /&gt; &lt;property name="initialPma" column="initial_pma" /&gt; &lt;property name="threeWeekPma" column="three_week_pma" /&gt; &lt;property name="pmaOverride" column="pma_override" /&gt; &lt;property name="pmaOverride_type" column="pma_override_type" /&gt; &lt;property name="pmaOverride_reason" column="pma_override_reason" /&gt; &lt;/class&gt; &lt;/hibernate-mapping&gt; </code></pre> <p>And this generated query works correctly in Toad:</p> <pre><code>select this_.member_id as member1_45_0_, this_.week_ending as week2_45_0_, this_.actual_invoice as actual3_45_0_, this_.ftr_adjustments as ftr4_45_0_, this_.edc_lse_adjustments as edc5_45_0_, this_.blid_adjustments as blid6_45_0_, this_.pma_misc_adjustments as pma7_45_0_, this_.pma_early_payments as pma8_45_0_, this_.adj_inv as adj9_45_0_, this_.adj_inv_exc_early_payment as adj10_45_0_, this_.initial_pma as initial11_45_0_, this_.three_week_pma as three12_45_0_, this_.pma_override as pma13_45_0_, this_.pma_override_type as pma14_45_0_, this_.pma_override_reason as pma15_45_0_ from ecredit.v_pma_summary this_ where this_.member_id = 10003 order by this_.week_ending desc; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload