How to map a database view using ActiveRecord?

后端 未结 1 1126
迷失自我
迷失自我 2021-01-15 18:33

Has anybody tried mapping database views in oracle using ActiveRecord? Please can I get some sample code for that?

1条回答
  •  伪装坚强ぢ
    2021-01-15 19:13

    No code necessary: just use the view name instead of the table in your [ActiveRecord] attribute:

    [ActiveRecord("MyView")]
    public class Document {...}
    

    Be aware that SchemaExport will treat your view as a table, here's how to fix that.

    0 讨论(0)
提交回复
热议问题