Open GoogleCodeExporter opened 9 years ago
you are correct, the schema is only sourced to collect metadata.
It should be possible though to augment all queries such that they prepend the
schema to table name. However, I have two impediments. I no longer have Oracle
instance to test against. The sever I ran it on crashed, and my fight to
install Oracle XE ended up in Oracle winning (I failed to install :)). So,
currently we are not even testing using Oracle.
Second, I guess there needs to be a separate test for this case, with user
logging onto one account, while getting data from tables in a different schema.
If you can help in both of these cases, we can crack this together.
Just writing code in a hope that it will work... is not my style ;)
thanks
igor
Original comment by i...@polevoy.org
on 30 Nov 2012 at 7:46
Thanks Igor for the confirmation. Sure. I would love to contribute. I will
first get the code and try to understand your layers of separation.
I am just curious to understand how others are using the schema argument just
for the Column Metadata. They would require it even for the queries or for
other DB actions...right? What is the point of getting properties of the
Columns alone?
Original comment by jve...@gmail.com
on 3 Dec 2012 at 2:05
thanks! The schema argument is to get the metadata only. Apparently this is
working for most people in multi-schema environment. When I designed AJ first
in 2009, the primary target was Oracle, and we did have to work with multiple
schemas, but the account we used had all aliases available.
It appears that in JDBC implementations, you sometimes need schema and
sometimes not, I guess this depends on driver.
In any case, the metadata is collected in ActiveJDBC so as to ensure you cannot
set values on a model that do not belong there. For instance if you have a
table PEOPLE (first_name, last_name), then this:
person.set("age", 43);
will throw exception that will say that "age" is not defined, but also give you
a list of attributes that are defined on this model (columns in table).
This can be easily traced from Model.set(String, Object) method.
Most queries are formed in the class DefaultDialect and subclasses, and maybe
if we simply modify method MetaModels.getTableName(modelClass) we can add this
enhancement.
As you get familiar with code, keep on asking questions, I will help
thanks
Igor
Original comment by i...@polevoy.org
on 3 Dec 2012 at 2:24
Original issue reported on code.google.com by
jve...@gmail.com
on 30 Nov 2012 at 5:19