Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Error about multiple fetch methods, all inherited from DataSource

    Hi,

    I get an error about multiple fetch methods:

    http://screencast.com/t/NWJmM2Jj

    They all seem to be inherited from DataSource. I have succesfully set up my environment to include the IDACall servlet with friends and defined my first DMI datasource. I get this message and I see that there is a fetch(String) and fetch(String,Object) defined in DataSource (that I inherit indirectly through BasicDataSource).

    I guess I am doing something wrong, but would appreciate a pointer to get it right. TIA.

    Sondre

    #2
    DMI does not support multiple methods with the same name and different signatures.

    Comment


      #3
      But the methods come from the class DataSource in the jar, not my code. What am I doing wrong?

      Comment


        #4
        Whatever class you use as a target of a DMI, it cannot have two methods of the same name that are the same the methodNameq you set on you're serverObject. So don't make a DMI targeting a method "fetch" and point it at a DataSource subclass, because yes, there are two methods named "fetch" on a DataSource.

        Comment


          #5
          Alright, thanks. So the to-the-point answer to my first question would be "your DMI class should not be a DataSource (extend [Basic]DataSource)".

          Comment


            #6
            No, your DMI class can be a DataSource, so long as you don't chose fetch as the serverObject.methodName.

            Comment


              #7
              Ah, thanks for clarifying. In the DMI sample this (using "fetch") is just what was done I guess. I was not yet aware that this was configurable and did not touch the sample config much, so I thought the DMI method calls for CRUD were hardwired.

              Comment

              Working...
              X