How to keep the ordering?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KusoYumi
    New Member
    • Mar 2008
    • 11

    How to keep the ordering?

    Hello, i have met a order problems now, that's happen between Order and Items.
    My Order database consists fields: id, transId, totalAmount, orderType, stallFk and dateOrder.
    Then Item database consists fields: id, qty, amount, unitPrice, productName, and orderFk.

    I have get a list of orders which filter those sales-cancel transaction(whi ch customer may make sales, but he/she wanna to cancel the sales), order by stallName and Date. Then i need to order those items by productName, then i implement Comparable in Item bean and use Collections.sor t( ), but somehow it change my previous ordering, which it order by productName, not order by stallName, follow order by date and productName.

    Any clue or solution fit this problems are welcome. Your reply is apprecited.
    Thanks.
  • KusoYumi
    New Member
    • Mar 2008
    • 11

    #2
    Originally posted by KusoYumi
    Hello, i have met a order problems now, that's happen between Order and Items.
    My Order database consists fields: id, transId, totalAmount, orderType, stallFk and dateOrder.
    Then Item database consists fields: id, qty, amount, unitPrice, productName, and orderFk.

    I have get a list of orders which filter those sales-cancel transaction(whi ch customer may make sales, but he/she wanna to cancel the sales), order by stallName and Date. Then i need to order those items by productName, then i implement Comparable in Item bean and use Collections.sor t( ), but somehow it change my previous ordering, which it order by productName, not order by stallName, follow order by date and productName.

    Any clue or solution fit this problems are welcome. Your reply is apprecited.
    Thanks.
    Erm, maybe some will confusing on stallFk and orderFk. stallFk actually is stall's id which is primary key; and orderFk is order's id , which also a primary key. About stallName, since Order database consists stallFk, then it can get stallName by stallFk. I hope this reply will make all more understand the flow and hope to get you'll reply soon.
    Thanks.

    Comment

    Working...