V
V
vadim9112011-08-26 12:04:25
SQL
vadim911, 2011-08-26 12:04:25

NHibernate generating unique document numbers

Colleagues,

Faced a problem how to generate unique document numbers using NHIbernate. For example, I need to generate a unique order number within a year. Tell me how best to do this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Ololesha Ololoev, 2011-09-01
@alexeygrigorev

Use the UUID to generate a unique id, and store it in the field for the class. In dotnet it looks like this: System.Guid.NewGuid().ToString()

V
vadim911, 2011-09-01
@vadim911

No, GUID doesn't work, it's the same as using ID as a number. But this is not all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question