ClassCastException: TINYINT is binded to Integer and generated class is 
expecting Byte
--------------------------------------------------------------------------------------

                 Key: CAY-1317
                 URL: https://issues.apache.org/jira/browse/CAY-1317
             Project: Cayenne
          Issue Type: Bug
          Components: Cayenne Core Library
         Environment: MS SQL 2005 + JTDS Driver
            Reporter: Evgeny Ryabitskiy
            Assignee: Evgeny Ryabitskiy
            Priority: Critical
             Fix For: 2.0.5


So I have this db-entity:

<db-entity name="ServiceParam" schema="dbo" catalog="****">
....
                <db-attribute name="Required" type="TINYINT" isMandatory="true" 
length="3"/>
....
        </db-entity>



This obj-entity is generated by modeller

        <obj-entity name="TDsServiceParam" 
className="ru.diasoft.services.generator.wsgate5nt.model.TDsServiceParam" 
dbEntityName="tDsServiceParam">
.....
                <obj-attribute name="required" type="java.lang.Byte" 
db-attribute-path="Required"/>
........
        </obj-entity>

So generated class has this code:

    public void setRequired(Byte required) {
        writeProperty("required", required);
    }
    public Byte getRequired() {
        return (Byte)readProperty("required");
    }


While trying to execute getRequired() I got:
Exception in thread "main" java.lang.ClassCastException: java.lang.Integer

It's simulated on 2.0.5 branch version but not simulated on 2.0.4 release. 
Something was broken....
I will write JUnit to check it on 3.1 trunk





-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to