0

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

Ayush
  • 206
  • 7
  • 22

1 Answers1

2

I got the solution, use this

order-by="commentId desc"
Ayush
  • 206
  • 7
  • 22