-->
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: Hibernate mapping for aggregated, denormalized table
PostPosted: Fri Nov 17, 2006 8:51 am 
Newbie

Joined: Mon Sep 04, 2006 6:45 am
Posts: 4
I'm using hibernate with jboss for ejb3.

I'm trying to reduce cost of a query by denormalizing tables, so that insteat of two tables: user and property (with relation one to many) I have one table aggr_user which is effectiely a result of "user join propery using (user_id)".

Now, the question is: is it possible to map this denormalized table to hibernate entities, so that I could use hibernate to parse result of native queries to this aggr_user:

Code:
sql = "select * from aggr_user where <condition>"
query = manager.createNativeQuery(sql, ???);
for(Object o : query.getResultList()) {
  UserAggrEntity e = (UserAggrEntity) o;
  e.getParameters(); // <-- is a list of parameters fetched from result set
}


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.