BITs or INTEGERs? (J2EE EL related)
- From: "David Green" <nospam@xxxxxxxxxxxxx>
- Date: Wed, 15 Aug 2007 23:45:50 +0100
Currently I have a fairly large SQL table. Half way through it is an integer
field that I'm using to represent 5 checkboxes on a JSP form. The reason I
used a single INTEGER instead of many BIT fields is I could well be adding
more checkboxes later, and I don't really want to see the new fields
somewhere other than next to the 5 existing ones.
Now I started to doubt this approach when I realised that Sun's EL for JSP
pages doesn't cater for the bit operators. The following won't compile:
<c:if test="${(myflags & 0x01) == 0x01}">
So to get around this I have to just use a scriplet, i.e.:
<c:if test="<%= (myflags & 0x01) == 0x01 %>">
It still leaves a bad taste in my mouth though and makes me wonder if
there's a better approach, so I'm asking for advice here. Maybe I shouldn't
get attached to having the SQL look nice and ordered, in favour of more
readability in the Java? (Incidently, the 0x01 shown here is represented by
a static constant in my code for readability).
.
- Follow-Ups:
- Re: BITs or INTEGERs? (J2EE EL related)
- From: David Green
- Re: BITs or INTEGERs? (J2EE EL related)
- Prev by Date: Re: INSERTINg a Clob in a portable way
- Next by Date: Re: BITs or INTEGERs? (J2EE EL related)
- Previous by thread: INSERTINg a Clob in a portable way
- Next by thread: Re: BITs or INTEGERs? (J2EE EL related)
- Index(es):
Relevant Pages
|
|