Fluent Nhibernate Oracle Identifier Too Long - Alias Name Issue

倾然丶 夕夏残阳落幕 提交于 2019-12-12 20:28:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!