Update:

Using NHibernatePersistHelpers posted by Fabio in this group I can
execute following:

AbstractEntityPersister persister =
NHibernatePersistHelpers.GetPersister(typeof (TestEntity), session);
            object generate = persister.IdentifierGenerator.Generate
(session.GetSessionImplementation(), new TestEntity());

which seems to do want I want.

Now I can use the generated id to manually insert data.

Anyone having any comments on this?

On Aug 9, 10:56 pm, cws <[email protected]> wrote:
> Hello!
>
> Developing a new app using nhibernate the id strategy used is hilo.
> We have an old app using the same db, but without nh. The problem is
> that the old app increments the max value of a table to generate the
> new id and uses hand written sql.
>
> My question is if anybody know if I can use nh to generate the next
> id  for a table if i wrap all db calls from the old app in the
> session's transaction.
> I want to put the generated ids into the hand written sql inserts to
> avoid conflicts between the old and the new app.
>
> Regards
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to