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: Is this possible with nHibernate / HQL
PostPosted: Wed Apr 02, 2008 11:23 am 
Newbie

Joined: Wed Apr 02, 2008 11:07 am
Posts: 1
Forgive me for I am new to nHibernate and have been unable to find answers elsewhere.

Is it possibly at all in nHibernate to duplicate the following SQL so that it is all executed on a single db call:

Code:
DECLARE @ID uniqueidentifier;
DECLARE @ChannelID uniqueidentifier;
DECLARE @Title varchar(MAX);
DECLARE @IsProcessing bit;

SELECT TOP 1
    @ID = Id,
    @ChannelID = ChannelId,
    @Title = Title,
    @IsProcessing = IsProcessing
FROM
    dbo.UnprocessedItem
WHERE
   IsProcessing='False'

UPDATE
    dbo.UnProcessedItem
SET
   IsProcessing='True'
WHERE
   Id = @ID


So that the column IsProcessing is set to true in the db on the UnProcessedItem entity that I retrieve.

Thank you


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.