[storm] Dynamically changing OR mapping question with aliases

Gustavo Niemeyer gustavo at niemeyer.net
Thu Aug 9 19:18:50 BST 2007


> Another thing, why was the name automatic? I assigned a name to it like 
> this:
> 
> all = ClassAlias(Link)

The alias name is the second argument here, which you didn't provide.

In SQL, when you have "foo AS bar", "bar" is the alias for the
original table.  After you define the alias, you access a column in
the aliased table as "bar.column".  The table in that statement is
"bar", which is the alias, right?

In your statement above you have something resembling
"<Link's table> AS <automatic alias>", which maps perfectly well with
what you'd have with SQL.  If you do all.blah, that'd become in SQL
something similar to <automatic alias>.blah, just like I explained
above.


> besides, I wanted to retrieve the table thats its mapped to not the 
> internal name of the alias, this seems very strange.

I guess I'm blind, but I don't follow what you want, sorry.  If you
want the table that it's mapped to rather than the alias, you can use
the table that it's mapped to, rather than the alias.  The alias is
an alias, not the original table.


-- 
Gustavo Niemeyer
http://niemeyer.net



More information about the storm mailing list