问题
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:
Define Table() method before all of your mapping declaration.
public EmployeeMap : ClassMap<Employee>
{
public EmployeeMap()
{
Table("EMPLOYEE");
// your declaration
Id(x => x.IdEmployee);
}
}
回答2:
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).
回答3:
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
来源:https://stackoverflow.com/questions/2127581/fluent-nhibernate-oracle-identifier-too-long-alias-name-issue