Want Order by in descending order through hibernate hbm xml mapping

1.6k Views Asked by At

My hibernate hbm xml has an attribute mapping as

<set name="batchExceptionComments" table="BATCH_EXCEPTION_COMMENTS" 
                inverse="true" fetch="select" lazy="false" order-by="commentId">
            <key>
                <column name="EXCEPTION_ID" not-null="true" />
            </key>
            <one-to-many class="com.beans.BatchExceptionComments" />
        </set>

I am using order-by="commentId" which arranges the set by id in ascending order.

I want my set to be arranged in descending order. What changes should I make.

P.S. I dont want to change my Java Code.

Framework Used: Spring

ORM Used:Hiebrnate

1

There are 1 best solutions below

0
On BEST ANSWER

I got the solution, use this

order-by="commentId desc"