views:

213

answers:

3

I've tried to do that.

            HasManyToMany<YechidotDoarInGroup>(x => x.Col_yig) 
                .Table("PigToYig") 
                .ChildKeyColumn("YIG_GROUP_RECID") 
                .ParentKeyColumn("PIG_GROUP_RECID"); 

but I've got

ORA-00942: table or view does not exist

I am trying to establish HasManyToMany connection not by ID , but by some other property .

First I've got - too long message.

When I've tried to enter my own Table name as an alias , it's not recognized .

What should I do?

+1  A: 

Cause: The table or view entered does not exist, a synonym that is not allowed here was used, or a view was referenced where a table is required. Existing user tables and views can be listed by querying the data dictionary. Certain privileges may be required to access the table. If an application returned this message, the table the application tried to access does not exist in the database, or the application does not have access to it.

Action:
Check each of the following:

 * the spelling of the table or view name.
 * that a view is not specified where a table is required.
 * that an existing table or view name exists.

source ora-code.com

R van Rijn
+2  A: 

The problem may well be this:

.Table("PigToYig") 

Oracle object names are, by default, in UPPER case. However, Oracle applies names in double-quotes in the given case. In other words, if your table has the default naming you may need to pass in this instead ...

.Table("PIGTOYIG") 

It depends how NHibernate converts those variables into SQL (I'm not familiar with NHibernate).

APC
Thanks for the reply.Tried it with Uppercase , still no solution .The oracle doesn't recognize the table name . By logic , the table doesn't exist in DB , it's being created by the FNH itself and when it tries to run the query it fails with -ORA-00942: table or view does not exist.Do you have some other leads on the subject ?
Gregory
A: 

Define Table() method before all of your mapping declaration.

public EmployeeMap : ClassMap<Employee>
{
    public EmployeeMap()
    {
        Table("EMPLOYEE");
        // your declaration
        Id(x => x.IdEmployee);        
    }
}
J. Horalek