Subject Re: Error converting to Long
Author jivkoto
Hi Roman,
I am using cmp so jboss is making the create statements for me.
Anyway, here is what he create:

CREATE TABLE TWLHORDER (
cID CHAR(36) NOT NULL,
cOrderTypeRef VARCHAR(36),
cPriority INTEGER default 0 NOT NULL,
cProcessState INTEGER default 0 NOT NULL,
cOrderState INTEGER default 0 NOT NULL,
cStateDescription VARCHAR(255),
cCreationDate NUMERIC(18,0) default 0 NOT NULL,
cExecutionStartDate NUMERIC(18,0) default 0 NOT NULL,
cExecutionEndDate NUMERIC(18,0) default 0 NOT NULL,
cQueueRef CHAR(36),
cOldQueueRef CHAR(36),
cNodeRef CHAR(36),
cExecutionTimeout NUMERIC(18,0) default 0 NOT NULL,
cStateUpdateTimeout NUMERIC(18,0) default 0 NOT NULL,
cLastStateUpdateTime NUMERIC(18,0) default 0 NOT NULL,
cRetryTimespan NUMERIC(18,0) default 0 NOT NULL,
cCurrentRetryCount INTEGER default 0 NOT NULL,
cMaximumRetryCount INTEGER default 0 NOT NULL,
cEstimatedTime NUMERIC(18,0) default 0 NOT NULL,
cCreatorRef CHAR(36), cRegistration BLOB,
cRequestMessage BLOB,
cResponseMessage BLOB,
CONSTRAINT PK_TWLHORDER PRIMARY KEY (cID)
)

Here is the query behind the finder method that i try to call (I hope
you find it useful):

"SELECT DISTINCT object(o)
FROM tOrder o
WHERE o.orderTypeRef = ?1
AND o.stateUpdateTimeout > 0
AND (o.lastStateUpdateTime + o.stateUpdateTimeout BETWEEN
0 AND ?2)
AND o.orderState = 256"

The problem is when trying to set attribute 2 in here:

AND (o.lastStateUpdateTime + o.stateUpdateTimeout BETWEEN 0 AND ?2)

and it is taking it as FBIntegerField.

Once again here is the mapping form jboss, but I think that problem is
not there, because it creates it as mapped (NUMBERIC(18,0))

<mapping>
<java-type>java.lang.Long</java-type>
<jdbc-type>BIGINT</jdbc-type>
<sql-type>NUMERIC(18,0) default 0</sql-type>
</mapping>

10x for the interest


--- In Firebird-Java@yahoogroups.com, "Roman Rokytskyy"
<rrokytskyy@a...> wrote:
> > As you see from the trace it is using FBIntegerField and because the
> > value is bigger then MAX_INT_VALUE it is throwing exception. I guess i
> > have to keep debugging :) (why smilling i should be angry face).
> > 10x
> > I am open for suggestion
>
> Can you post your CREATE TABLE statement (and mark the column)?
>
> As far as I remember, I have not change there anything quite long
time and
> this issue should have been reported before.
>
> Roman