-->
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: Managing a Derived, Read-Only Object with an EntityManager?
PostPosted: Sun Oct 09, 2011 11:03 am 
Newbie

Joined: Fri Jul 08, 2011 8:45 am
Posts: 6
Hi

I'm building an application with Hibernate 3.5.6 and Spring. The application defines objects that are mapped onto a number of database tables and are managed successfully by an EntityManager.

Now I want to create a 'derived' object which contains fields that are drawn from several different existing tables. The POJO is simple to define. The SQL query that delivers a result set for these fields is also pretty straightforward. The object could be thought of as an entity because one of its fields can serve as a unique ID. The object is always read-only - it essentially provides summary information on other business objects.

Can I implement this object using a Hibernate EntityManager and Hibernate annotations?

Thanks for your advice.

Bruno.

UPDATE: Marking this POJO as an @Entity would solve the problem to a significant extent, except that a spurious table is created! Is there any way of annotating an entity to prevent table creation for that specific entity?


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.