Menu

Using the Framework

2004-11-03
2013-03-07
  • André Ribeiro

    André Ribeiro - 2004-11-03

    Hi,

    I am using the AToMSFrameWork and I'm using the method find of the CPersistentObject. But I saw at the CClassMap.getSelectFor() and its invoke the mehod m_relationalDatabase.getClauseStringEqualTo... If I want to invoke the criteria Like instead "=" what can I do? I'm passing the Class Product with the attribute Name whith "Tes%".

    Thank's,
    Andr Ribeiro from Brazil.

     
    • Richard Banks

      Richard Banks - 2004-11-03

      Hi Andre,

      You need to use a CRetrieveCriteria instead of a find as you are likely to retrieve multiple records based on your selection criteria.

      Try something like the following

      dim rc as new CRetrieveCriteria
      rc.ClassMap = myProduct.GetClassMap()
      rc.WhereCondition.addSelectLike("Name","Tes%")
      dim c as CCursor = rc.Perform()
      while not c.EOF
        myProduct = new Product
        c.LoadObject(myProduct)
        ...
        c.NextCursor
      end while

      - Richard.

       
    • André Ribeiro

      André Ribeiro - 2004-11-04

      It works! Thank you very much!! Bye.

       

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.