-->
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: How to get aliases from the hibernate api
PostPosted: Fri Nov 21, 2003 7:21 pm 
Newbie

Joined: Sun Nov 09, 2003 12:34 pm
Posts: 15
Hi,

I am trying to generate a fragment of sql that would be used with createSQLQuery.
for example
Code:
select {subtype.*} from SUBTYPE subtypealias
inner join SUPERTYPE supertypealias on
subtypealias.pk = supertypealias.pk


where

"from SUBTYPE subtypealias
inner join SUPERTYPE supertypealias on
subtypealias.pk = supertypealias.pk"

is my string fragment.


Now the problem is that supertypealias is generated by hibernate, I tried to cheat by writing SUBTYPE_1_, but then the assumption is that hibernate will always generate the alias with tablename_1_.

If there is a way i can get the hibernate generated aliases then I don't need to hardcode the alias?

Any ideas?

thanks,


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.