Hi Glenn,

> I thought that by specifiying the class name I wanted (e.g., Class1)
> that OJB would only get the fields for that class. Can anyone advise me
> how I can do this without resorting to having only one class for a
> function calls?

In the DUAL table is no information instruct OJB which row belongs to which class, so OJB find always all rows in table. To avoid this DUAL needs an additional column 'ojbConcreteClass' with java class name. See in doc
http://db.apache.org/ojb/tutorial3.html#Mapping%20All%20Classes%20on%20the%20Same%20Table


regards,
Armin

Glenn Barnard wrote:

We use Oracle 9 and have several different functions we can call. In OJB, they are all mapped with the table name of DUAL. For example:

      SELECT function(args) AS column FROM DUAL

Our repository.xml has a table entry for each function so that the result is kept in it's own class. For example:

 <class-descriptor
       class="com.business.model.ClassName1"
       table="dual"
       refresh="true"  >

   <field-descriptor id="1"
     name="fieldName1"
     column="fieldName1"
     primarykey="true"
     jdbc-type="VARCHAR"
     nullable="false" />

   </class-descriptor>

and:

 <class-descriptor
       class="com.business.model.ClassName2"
       table="dual"
       refresh="true"  >

   <field-descriptor id="1"
     name="fieldName2"
     column="fieldName2"
     primarykey="true"
     jdbc-type="VARCHAR"
     nullable="false" />

   </class-descriptor>

The problem is that when OJB goes to extract the values from the result set, it tries to do so for 2 columns, fieldName1 and fieldName2.

I thought that by specifiying the class name I wanted (e.g., Class1) that OJB would only get the fields for that class. Can anyone advise me how I can do this without resorting to having only one class for a function calls? Oh, I'm using a customized rc5 and cannot upgrade until after this release ships (a timing/resource issue).

Thanks ya'll!

_________________________________________________________________
Learn to simplify your finances and your life in Streamline Your Life from MSN Money. http://special.msn.com/money/0405streamline.armx



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to