Menu

where and order by from different tables

2004-10-06
2013-03-07
  • Jacques Exelrud

    Jacques Exelrud - 2004-10-06

    I'm trying to write something. The code I have so far is:

            Dim SA As Scarab.ScarabActivity
            SA = New Scarab.ScarabActivity

            Dim ST As Scarab.ScarabTransaction
            ST = New Scarab.ScarabTransaction

            Dim rc As CRetrieveCriteria
            rc = New CRetrieveCriteria

            Dim sql As CSqlStatement
            sql = New CSqlStatement

            Dim Cond, Cond1 As CCriteriaCondition
            Cond = New CCriteriaCondition(ST.getClassMap)

            Cond.addSelectBetween("CreatedDate_", New Date(2004, 9, 1), New Date(2004, 10, 1))

            Cond1 = New CCriteriaCondition(SA.getClassMap)
            Cond1.addSelectEqualTo("AttributeId_", 3)

            Cond.addSubCriteria(Cond1, False)

            rc.ClassName = "ScarabActivity"
            rc.ReturnFullObjects = True
            rc.ClassMap = SA.getClassMap

            rc.WhereCondition = Cond
            rc.addOrderAttribute("ScarabTransaction.CreatedDate_")

    What happens is that the map for class ScarabTransaction cannot be found.

    Suggestions would be appreciated.
    Thanks in advance,
    Jacques

     
    • Richard Banks

      Richard Banks - 2004-10-06

      Hi Jaques,

      I think you'll find that the problem is coming from the addOrderAttribute line.  At the moment you are only able to order by properties in the first class (ie ScarabActivity).  It's a known problem and an RFE already exists to add this feature.

      - Richard.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.