-->
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: Seam Hibernate field parameters using a dynamic column name
PostPosted: Mon Jan 05, 2009 5:57 am 
Newbie

Joined: Tue Nov 15, 2005 7:20 am
Posts: 17
environment seam 2. using JTA as transaction-type
I'm using I suppose the standard seam way to access my Mysql DB using hibernate through the entity manager

I would like to access the result of a query in a more genereric way using the collumn name to get to the field parameter dynamicaly.
I would like to be able to get the FieldContent using the column name at run time
Entity Manager get field content using a parameter



Code:
FullTextEntityManager em ; em using injection
List    result;
Object  row;

result =em.reateQuery( sql)
     .setMaxResults(pageMax + 1)
          .setFirstResult(pageMax * page)
          .getResultList();  ;I'm querying my DB using a  generic  create Query

         
        and  I would  like to find my individual fields in the result  as
       
        int fieldnr=((ResultSet) row).findColomn(fieldName);
        Object field=((RowSet).getObject(fieldnr) ; 
        ....




can anyone tell me how to get to the fieldnr/ fieldName combination
starting from seam and the entity manager ?
I realize this is slower then directly handling the result using hibernate but
i woulkd accept the performance loss for the gained flexibility in this case.

_________________
XML way to go


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.