On 15.10.14 09:52, Thomas Fox wrote: > Hi Youngho, > > I am afraid my current draft does not allow TABLE enums (as you use), only > COLUMN enums (which was my primary use case). > I now see that your use case also makes sense, I did not think of it before. > > For your current ROLE table, do you need the ROLE_NAME in database? > If not, you could still use the column enum solution for the id column. > > I need to think about whether it would be possible to make Tables enum. > Perhaps something like this > > <table name="TURBINE_ROLE" idMethod="idbroker" isEnum="true"> > <column name="ROLE_ID" required="true" primaryKey="true" type="INTEGER"> > <enum-value value="1"/> > <enum-value value="2"/> > <enum-value value="3"/> > </column> > <column name="ROLE_NAME" required="true" size="99" type="VARCHAR" > javaName="Name"> > <enum-value value="Guest"/> > <enum-value value="Member"/> > <enum-value value="Owner"/> > <column> > <unique> > <unique-column name="ROLE_NAME"/> > </unique> > </table> >
I'm not sure that this is a good idea. It mixes data with code which will shoot you in the foot eventually, no matter what. I can see the use case for column enums but table enums would render the table useless in the end. Bye, Thomas. --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscr...@db.apache.org For additional commands, e-mail: torque-user-h...@db.apache.org