0

First of all I won't to say that I'm an expert in database handling, and less so in oracle. However right now I need to get better at it :)

I'm using nHibernate as orm, to my oracle database. It works ok, and is rather simple to use. However now I have run in to a problem that I don't know how to solve.

In the Database theres a kind of tree with the tables, views, indexes and such. At the end there are also a entry called "Other Users" in which there are some users with access to what I'm guessing is other tables. Now I would like to get data from one of those tables (I can read them manually in SQL Developer, so it's not a access problem or anything). Does anyone have any idea how I shall do that?

Chris Pitman
  • 12,990
  • 3
  • 41
  • 56
Markus
  • 3,297
  • 4
  • 31
  • 52
  • Poor explanation of the problem. Can you rephrase? – IamDeveloper Jan 19 '12 at 12:17
  • There is no easy way for me to explain it because I don't know the correct phrases and terms. But as I understand it in oracle it's possible to give certain users access to certain tables (in my example my user doesn't have direct access to the table I'm interested in now. However I somehow have access to a user that do have access to that table. And how do I then get access to that table with nHibernate. – Markus Jan 19 '12 at 12:25

1 Answers1

1

The account that you use in SQL Developer has at least read privilges to tables in another schema (owned by another user). You can access these tables by prefixing the table name with the schema name. In Hibernate you'll have to define the non-default-schema in the mapping.

Rob van Laarhoven
  • 8,737
  • 2
  • 31
  • 49
  • Yes, I solved it by just in the hbm.xml file edit the class table value to otherUser.tableName However I don't know if that is a non-default-schema. – Markus Jan 19 '12 at 13:56