ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rusty Wright <ru...@berkeley.edu>
Subject anyone using xmlbeans with enumerations with ibatis?
Date Wed, 16 May 2007 17:01:22 GMT
Xmlbeans is a package that generates java code for you from your xml schema.

I'm a bit of a java newbie and am trying to do a simple shopping cart 
application.  In my xml schema for products I specified a product type 
(not category) that can have two values, tangible and download, using 
enumeration.  In the generated xmlbeans code it has an interface with an 
inner final static class with the name Enum.  I hadn't looked at that 
code and blazed ahead and wrote a type handler for it calling its 
toString() to get its value for ibatis.  But it blows up when ibatis 
tries to instantiate an Enum, which makes sense since it's final.

My workaround was to write a ProductWrapper which takes a Product arg 
for its constructor and it has getters for the various Product fields, 
and to use the ProductWrapper with ibatis.

I was wondering if there's a better way.


Rusty Wright
UC Berkeley
IS&T Web Applications
510-643-9097  office
925-212-3774  cell

View raw message