-->
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 Queryresult with SqlResultSetMappings to a Entity
PostPosted: Thu May 05, 2011 8:05 am 
Newbie

Joined: Tue Mar 01, 2011 12:05 pm
Posts: 3
I am trying to map a NativeQuery to a Entity, there is no table exisiting, the query creates the resultset through a lot of joins.
The example is the following :

Code:
@Entity
@SqlResultSetMappings( {
     @SqlResultSetMapping(
         name="TechSpecs",
         entities={
               @EntityResult(
                     entityClass=TechSpecs.class
                         )
         }
     )
   })

      
public class TechSpecs {
   
   //@PersistenceContext
    //transient EntityManager entityManager;
   
    @EmbeddedId
   public TechSpecsPK getId() {
      return id;
   }
... all the POJO Stuff



I am filling this object with
Code:
       Query q = em.createNativeQuery(query,"TechSpecs");


During the unittest , all works fine, but during the startup of the webapplication Hibernate crashes because he tries to find the table for this entity ... Why does this keep happening ????


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.