[jboss-user] [EJB3] - Numeric values in varchar field & use enum ?

Thomas Clifford do-not-reply at jboss.com
Thu Mar 17 12:48:37 EDT 2011


Thomas Clifford [http://community.jboss.org/people/tjclifford01] created the discussion

"Numeric values in varchar field & use enum ?"

To view the discussion, visit: http://community.jboss.org/message/593853#593853

--------------------------------------------------------------
Hi.

An application sql table I'm working on has a varchar(4) field that, according to the information I had, is only supposed to 
hold two values, '0' or '1'.  
I coded the value for that column as an enum in ejb3 previously, believing it would be specified in the database as 
a tinyint or int.  But the column has '1bbb' (b for blank), and none of them have '0bbb'.
I've tried to code it in the enum as:

0("0"), 1("1");

which gave me a compile error, and also tried:

"0"("0"), "1"("1");

which also gave a compile error.

Does anyone know if it's possible to code an enum such that a varchar field will hold numbers ?
I've argued that the field should be a tinyint, but to no avail.  It's complicated.

I believe I'll have to code it as a String in the ejb and associated beans.....

Thanks.....
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/593853#593853]

Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110317/2aae896b/attachment.html 


More information about the jboss-user mailing list