Quantcast
Channel: ColdFused? » hibernate
Viewing all articles
Browse latest Browse all 9

ColdFusion ORM : Using DB Views instead of Table

$
0
0

One of the frequent question that comes up for ORM is – Can I use database Views instead of the table? And the answer is “of course”! From ORM perspective, there is no difference between database view and a table. Any query that ORM generates will work on the views in the same way as it does on a table. So while defining the persistence metadata for your CFC, just use the view name instead of the table name and you should be all set.

Of course views are used just for the query and not for the insert/update/delete. Hence method like EntitySave/EntityDelete which will try to do insert/update/delete on View will not change the view and would throw an error at the time of flushing the ORM session.


Viewing all articles
Browse latest Browse all 9

Latest Images

Trending Articles





Latest Images