Hello Michael,

at the moment, I can't comment on why findAll works.

The cause, perhapsm is the types mismatch between the one that is used
by MySQL driver for generated keys be default and the one you
use for primary key column.

AFAIK, MySQL's default is java.lang.Integer. Abstracting from
vendor-specific types supported in current Branch_3_2. It is not yet
ported to HEAD.

alex

Thursday, July 10, 2003, 6:27:31 PM, MNewcomb MNewcomb wrote:

Mtc> jboss-head from ~ July 1.
Mtc> RedHat 8
Mtc> JDK 1.4.1
Mtc> Mysql

Mtc> I have a simple bean that has auto-generated Integer primary keys.

Mtc> MyLocal myLocal = myLocalHome.create(name, description);
Mtc> myLocal.getName(); <-- works fine
Mtc> myLocal.getDescription(); <-- works fine
Mtc> myLocal.getId(); <-- Throws ClassCastException in the proxy.

Mtc> Bean gets created fine.  Primary key comes back fine from the SQL insert
Mtc> (verified in log file from debug from JDBCGetGeneratedKeysCreateCommand).

Mtc> But, for some reason, when I call getId() it throws a ClassCastException.
Mtc> Calling getName() and getDescription() work fine.

Mtc> What's wierd, is that I can do a myLocalHome.findAll(), iterate through the
Mtc> returned collection and call getId() on those just fine.

Mtc> It just seems to be when I call getId() on the returned local ejb...

Mtc> Any clues?

Mtc> Thanks,
Mtc> Michael

Mtc> This is being done from a Servlet...



-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to