Ejemplo n.º 1
0
        public object Generate(ISessionImplementor session, object obj)
        {
            if (max_lo < 1)
            {
                long val = Convert.ToInt64(DoWorkInNewTransaction(session));
                if (val == 0)
                {
                    val = Convert.ToInt64(DoWorkInNewTransaction(session));
                }
                return(IdentifierGeneratorFactory.CreateNumber(val, returnClass));
            }
            if (lo > max_lo)
            {
                long hival = Convert.ToInt64(DoWorkInNewTransaction(session));
                lo = (hival == 0) ? 1 : 0;
                hi = hival * (max_lo + 1);
                log.Debug("New high value: " + hival);
            }

            return(IdentifierGeneratorFactory.CreateNumber(hi + lo++, returnClass));
        }
Ejemplo n.º 2
0
 protected virtual object Make(long value)
 {
     return(IdentifierGeneratorFactory.CreateNumber(value, ReturnClass));
 }
Ejemplo n.º 3
0
 public override object GetDefaultValue(object currentValue)
 {
     return(IdentifierGeneratorFactory.CreateNumber(-1L, currentValue.GetType()));
 }