-->
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.  [ 3 posts ] 
Author Message
 Post subject: HELP! HQL SELECT * get dinamic query columns type
PostPosted: Thu Apr 21, 2016 11:19 am 
Newbie

Joined: Thu Apr 21, 2016 11:09 am
Posts: 2
Hi everybody, I have made an application which execute queries and show results in a grid. This is the way I get execute the query.

CODE:
SQLQuery query = super.getSession().createSQLQuery("SELECT * FROM TABLE1, TABLE2.........");
query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
List<Map<String, Object>> aliasToValueMapList = query.list();


I can get the columns names but I don´t know how get the column datatype (float, date....) Help please!


Top
 Profile  
 
 Post subject: Re: HELP! HQL SELECT * get dinamic query columns type
PostPosted: Thu Apr 21, 2016 3:44 pm 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Better use a DTO for your SQL projection. See the reference documentation.


Top
 Profile  
 
 Post subject: Re: HELP! HQL SELECT * get dinamic query columns type
PostPosted: Thu Apr 21, 2016 3:59 pm 
Newbie

Joined: Thu Apr 21, 2016 11:09 am
Posts: 2
Thank you, but users can generate free sql select. And I have to print result into a grid, but I need columns types informatión for apply dinamic filters at the first row...For example if the first result column is a datetype I display a component for filter bewtween two dates.


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

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.