Subject Re: [Firebird-Java] JBoss 4.0.0 and Firebird CMP BigDecimal to zero decimal numeric field
Author Joachim Van der Auwera
tsangccn wrote:
>
> Hello,
>
> I am using JBoss 4.0.0 with Jaybird 1.5.5.
>
> My table has a zero decimal numeric field defined as NUMERIC(15,0)
>
> A CMP 2.0 entity EJB is defined on the table.
> The field is defined as java.math.BigDecimal.
>
> A record is created using the entity bean with no problem.
>
> But when I get the field from the entity bean, it fails with the
> following exception
>
> Caused by: javax.ejb.TransactionRolledbackLocalException: Internal
> error getting results for field member amount; CausedByException is:
> Got a java.lang.Long[cl=0, value=550240] while looking for a
> java.math.BigDecimal[cl=24384712]; CausedByException is:
> Internal error getting results for field member amount;
> CausedByException is:
> Got a java.lang.Long[cl=0, value=550240] while looking for a
> java.math.BigDecimal[cl=24384712]

This is more a JBoss question than a Jaybird one.
Have a look at your CMP mapping. Your field is defined to expect a
BigDecimal field, but your table is defined to return a Long (which has
enough significant digits for your definition).

Joachim