You can create you own generator and use it in the mapping.Switch
from sequence To seq-HiLo is a custom request and need a custom solution ;)

2009/3/27 Darius Damalakas <[email protected]>

>
> I did not find the answer on nhusers mailing list
> (
> http://groups.google.com/group/nhusers/search?hl=en&group=nhusers&q=hi%2Flo&qt_g=Search+this+group
> ),
>  so i will ask the question here :)
>
>
> Is it possible to make that SequenceHiLoGenerator would instead not
> increment sequence by one and then multiply sequence value with maxLo
> ?
>
> I will illustrate what i want. Now SequenceHiLoGenerator works like
> this  (sql-pseudo-code):
>
> It get current sequenceValue, by issuing command Get new value from
> sequence + 1
> then it returns some number of ids without going to database
> then it again increments sequence by +1
>
>
> I would like to work it this way:
> Reserve enough id values by issuing command Get new value from sequence +
> maxLo
> return some number of ids without going to database
> again increments sequence by + maxLo
>
>
>
> Now the difference is this: with the approach i described, it would be
> possible to switch any time from SequenceGenerator to
> SequenceHiLoGenerator without any problems.   Now it is not possible,
> as SequenceHiLoGenerator generates OIDs higher than the sequence value
>
>
> Is this possible at the moment?  As far as what i can see in NH trunk,
> there is no such code. Maybe i am not looking where i need to look. :)
>
>
> --
> Darius Damalakas
>
> >
>


-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
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