nhibernate mapping - hibernate generator tag -
Hibernation of the generator tag is the exact purpose of 'original' in the mapping file (I know that using the generator tag, it will be
Regulate primary key values ...)
.....................
< P>
It uses the generation strategy that is most suitable for the database:
Basic - Identification based on the abilities of the underlying database, Selection or halo chooses.
The reason is that there is no identity type that is common to all databases. In a case where the database does not support the int
/ long
identity type, the Hi / Lo generation strategy is necessary, which is the hibernate generated id.
If you know the specific database with which you are working, you can name a specific identifier generation plan to use. But for cross-DB development, using native
means that the app has more chance of being portable in various DBSs.