These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping a view with a single value to a read-only field
PostPosted: Thu May 05, 2011 3:34 pm 
Newbie

Joined: Thu May 05, 2011 3:27 pm
Posts: 1
(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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.