I have a need to generate a unique integer which I use to identify an order to an external system. I'm using the NHibernate HiLo generator in the application, so can I access the generator programmatically to get it to return me a unique integer? I don't need to store this in any database key. I just want to use the NH functionality of generating unique integers.
I'd add a column to the HiLo table that I'd only use for this unique number sequence and not for any real database key. For example, say I added a column "Foo" to the hibernate_unique_key table.
Could I then do something to the effect:
int n = GetNextId("Foo");
Where I just pass the name of the column?