(Hibernate 3.6, Mysql 5)
I have a mapped class called 'Program' (that is working correctly).
I also have a view that is updated daily with aggregate statistics.
The view schema is like so: view ProgramSummary { long program_id long value }
program_id is unique, but there is no row-id. What I want is to just pull the value out, but I can't seem to figure out the right semantics.
I have tried mapping a separate entitiy with a OneToOne (and ManyToOne) relationship, but it gets confused between the ids. Without marking program_id as an entity, hibernate can't handle the actual mapping.
Is there a simple way to do this? It is a read-only field that is accessed by an external process and I don't have any leeway for changing the schema.
|