Probably I don't understand all the issues here,


Why not just use the fully qualified column name relation_name.column_name
always and dispense with aliases?  You can't use a reserved word for a
relation_name anyway, so you don't really need to worry about keeping track
of them... the db will complain.

If you do want to keep track of reserved words, there is a database
metadata method getSQLKeywords that might be helpful.

david jencks

On 2001.08.26 17:52:35 -0400 Dain Sundstrom wrote:
> Hi all,
> 
> I have been thinking over the issue of generation of table aliases in
> EJB-QL
> queries, and have run into some problems.  What I want to do is prevent
> the
> EQL-QL assembler from generating table aliases that have been already
> used,
> that are reserved words, or are a db object name (i.e., a table, view, or
> other name).  I can handle the first to easily, but I can't think of a
> way
> to prevent collision with db objects.
> 
> We could just tell users that they can prevent the code from generating
> an
> alias that is the name of a db object by adding the name to a reserved
> word
> list in the config file.  I think this is reasonable as long as it is
> rare.
> 
> Then there is the issue of generating a database alias that it the same
> as
> an auto generated table name.  This can happen because there is no
> central
> repository for the reserved word list. Let me explain the last claim a
> little more.  I am proposing adding a reserved word list to the
> type-mapping
> section section of the config file.  The type mapping is selectable on a
> per
> bean level (newer feature).  This means that each bean effectively has
> it's
> own datasource mapping information, and no central repository.
> 
> Again, I think the only way around this is to have the user hand assign
> the
> table name and if collision persists add the table name to the reserved
> list.
> 
> I just don't like the idea of forcing users to do a lot of hand
> configuration of the data mapping.  I think the system should basically
> work
> without any jboss specific configuration of the cmp engine.
> 
> If you have any insight into this issue, please speak-up.
> 
> -dain
> 
> 
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
> 
> 

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to