JDK1.3 / Sybase 12.5 

Somehow, I was under impression that if I declare a class Test that has
someProperty of type int (see below) then OJB will be able to retrieve
object and set the 'int' type property without much work. That,
however, results in the following error:

[DEFAULT] ERROR: Error in operation [set] of object
[PersistentFieldPropertyImpl], getWriteMethod returned null
[DEFAULT] ERROR: Declaring class [Test]
[DEFAULT] ERROR: Property Name [someProperty]
[DEFAULT] ERROR: Property Type [int]
[DEFAULT] ERROR: anObject was class [Test]
[DEFAULT] ERROR: aValue was class [java.lang.Integer]
org.apache.ojb.broker.PersistenceBrokerException: getWriteMethod
returned null

I also thought that if boolean type is stored in the db as int, that
conversion would be handled automatically. However that does not
happen, istead "java.lang.IllegalArgumentException: argument type
mismatch" is raised.


Any ideas? Thanks in advance

-----------------------------------------
pubic class Test {
        �
        private int someProperty;
        �
        public Test() {
        }
        ...

        public int getSomeProperty() {
                return someProperty;
        }

        public void setSomeProperty(int someProperty) {
                this.someProperty = someProperty;
        }

/* ------------
it appears that OJB wants the method below instead of the one above,
otherwise the following error is raised
        public void setSomeProperty(Integer someProperty) {
                this.someProperty = someProperty.intValue();
        }
------------ */

}

-----------------------------------------
Repository.xml is as follows:

   <jdbc-connection-descriptor
        platform="Sybase"
        jdbc-level="2.0"
        driver="com.sybase.jdbc2.jdbc.SybDriver"
        protocol="..."
        ...
   />

-----------------------------------------
Repository_user.xml is as follows:

   <class-descriptor
      class="Test"
      table="test">

      <field-descriptor id="1"
         name="id"
         column="test_id"
         jdbc-type="INTEGER"
         primarykey="true"
         autoincrement="false"
      />
      <field-descriptor id="2"
         name="someProperty"
         column="some_property"
         jdbc-type="INTEGER"
      />
        ...
   </class-descriptor>


__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/

--
To unsubscribe, e-mail:   <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>

Reply via email to