tenwit wrote:
I don't know too much about the internals, so I can't answer your EntityPersister question. Are you sure that your DBS doesn't handle updatable views? They're becoming more common, maybe you just need to update the version of your DB.
Oracle at least is very restrictive about how the views are structured, some of our views are too complicated to write to.
tenwit wrote:
If modelling your views as join elements in your mapping file isn't going to cut it with the powers that be in your company, then I'd probably go with using two classes, one read-only (using the view), and one normal using the table. Then write factory save methods which instantiate instances of the table-based classes from instances of the view-based classes. If the views that you use always add the same columns (something from an auditing table, maybe?) then you can do it all in base classes, so it won't be too hard.
That's a pretty good idea, if I can't figure out how to do this with a configuration only, that's probably what I'll do.
tenwit wrote:
Reading from a view/writing to a table is an implementation detail. If you're choosing your DAL based on an implementation detail like that, you have to expect that not all DALs are going to work for you.
I have to consider "implementation details" like this because they have a huge impact on the amount of work we need to do during the migration.