-->
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: Sql Query To return null for id
PostPosted: Wed Jan 13, 2010 3:04 pm 
Newbie

Joined: Wed Jan 13, 2010 2:53 pm
Posts: 2
Is there a way to return a sql query as a list of entities that has its @Id as null from a left outer join query? Maybe return query as detached or something similar.

Thanks,
Sam


Top
 Profile  
 
 Post subject: Re: Sql Query To return null for id
PostPosted: Wed Jan 13, 2010 3:37 pm 
Senior
Senior

Joined: Mon Jul 07, 2008 4:35 pm
Posts: 141
Location: Berlin
Hi firehooper,

the ID of an entry is never null by definition. Otherwise it would not be an ID. The result set of you scenario would be empty since there are no entries with null for their IDs.

CU
Froestel

_________________
Have you tried turning it off and on again? [Roy]


Top
 Profile  
 
 Post subject: Re: Sql Query To return null for id
PostPosted: Wed Jan 13, 2010 4:36 pm 
Newbie

Joined: Wed Jan 13, 2010 2:53 pm
Posts: 2
Sorry I guess I could have worded this differently. I do a left outer join on a two tables on the two fields making up a composite key to determine which rows are missing from a table therefore the generated surrogate id is null, but still a valid new entity without a Id. I am currently returning a Object[] then setting all fields except Id in my DAO then return a list of entities. I was just seeing if there was a built-in hibernate way of doing this.


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.