[
https://issues.apache.org/jira/browse/CAY-1317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853384#action_12853384
]
Evgeny Ryabitskiy edited comment on CAY-1317 at 4/5/10 2:42 PM:
----------------------------------------------------------------
Reason of problem was same as in CAY-1354 .
This problem fixed with CAY-1354
was (Author: apparition):
Reason of problem was same as in CAY-1259.
This problem fixed with CAY-1259
> 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: 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.