One, the NHibernate configuration supports the properties
Property name
Use
dialect
Set dialect class name for NHibernate-allows nhibernate to generate optimized SQL for a particular relational database
Available values: full.classname.of.Dialect, Assembly
Default_schema
In the generated SQL, attach the given schema/tablespace to the table name of the non-fully qualified name.
Available values: schema_name
Use_outer_join
Allow outer joins to be crawled, deprecated, use max_fetch_depth.
Available values: true | false
max_fetch_depth
Sets the maximum depth for a one-way association (single-to-one, many-to-a) outer join FETCH (OUTER join fetch) tree. A value of 0 means that the default outer join crawl will be turned off
Available values: It is recommended to take a value between 0 and 3 .
Use_reflection_optimizer
Turn on runtime code dynamic generation to override the run-time reflection mechanism (System-level properties). In this way, the program will consume a certain amount of performance when it starts up, but the performance will be improved during the program run time. Note that hibernate still needs to be cglib even if this optimization is turned off. You cannot set this property in Hibernate.cfg.xml. This property cannot be hibernate.cfg.xml or an application configuration file settings in the configuration section.
Available values: true | false
Bytecode.provider
Specifies bytecode provider for optimizing nhibernate reflection performance. NULL represents a complete shutdown of performance optimizations, LCG is used for lightweight code dynamic generation, andCodeDom is generated dynamically based on CodeDom code.
Available values: null | LCG | CodeDom
Cache.provider_class
Set the cache implementation Class (the class that implements the Icacheprovider interface)
Available values: classname.of.CacheProvider, Assembly
cache.use_minimal_puts
Optimizes the level two cache to minimize write operations (valid for the cluster cache) at the expense of frequent read operations.
Available values: true | false
Cache.use_query_cache
Allow query caching, individual queries still need to be set to cacheable.
Available values: true | false
cache.query_cache_factory
Custom implements the class name of the iquerycachefactory interface, which defaults to the built-in standardquerycachefactory.
Available values: classname.of.QueryCacheFactory, Assembly
Cache.region_prefix
Prefix for the two-level cache domain name.
Available values: prefix
query.substitutions
Maps a symbol in a nhibernate query to a symbol in a SQL query (the symbol may be a function name or a constant name).
Available values: hqlliteral=sql_literal, Hqlfunction=sqlfunc
Show_sql
Output all SQL statements to the console.
Available values: true | false
Hbm2ddl.auto
When isessionfactory is created, the database structure is checked automatically, or the DDL of the database schema is exported to the database. When you use Create-drop, the database schema is dropped when you explicitly close isessionfactory .
Available values: Create | Create-drop
Use_proxy_validator
Whether the authentication interface is enabled or whether the class can use a proxy is turned on by default. (Check the properties of the entity class or whether the method is set to virtual)
Available values: true | false
Transaction.factory_class
The implementation of the custom itransactionfactory , which defaults to the NHibernate built-in adonettransactionfactory.
Available values: classname.of.TransactionFactory, Assembly
second, the dialect attribute supports the dialect option value
relational database
Dialect
Note
DB2
NHibernate.Dialect.DB2Dialect
DB2 for ISeries (os/400)
NHibernate.Dialect.DB2400Dialect
Ingres
NHibernate.Dialect.IngresDialect
PostgreSQL
NHibernate.Dialect.PostgreSQLDialect
PostgreSQL 8.1
NHibernate.Dialect.PostgreSQL81Dialect
Dialects are now supported for UPDATE NOWAIT in PostgreSQL8.1.
PostgreSQL 8.2
NHibernate.Dialect.PostgreSQL82Dialect
Dialects in PostgreSQL8.2 now support the use of the IF EXISTS keyword in drop TABLE and drop SEQUENCE .
MySQL 3 or 4
NHibernate.Dialect.MySQLDialect
MySQL 5
NHibernate.Dialect.MySQL5Dialect
Oracle (any version)
NHibernate.Dialect.OracleDialect
Oracle 9/10g
NHibernate.Dialect.Oracle9Dialect
Sybase Adaptive Server Enterprise
NHibernate.Dialect.SybaseDialect
Sybase Adaptive Server Anywhere
NHibernate.Dialect.SybaseAnywhereDialect
Microsoft SQL Server 2000
NHibernate.Dialect.MsSql2000Dialect
Microsoft SQL Server 2005
NHibernate.Dialect.MsSql2005Dialect
Microsoft SQL Server 2005 Everywhere Edition
NHibernate.Dialect.MsSqlCeDialect
Microsoft SQL Server 7
NHibernate.Dialect.MsSql7Dialect
Firebird
NHibernate.Dialect.FirebirdDialect
Set driver_class to NHibernate.Driver.FirebirdClientDriver enable Firebird Provider for. NET 2.0.
Sqlite
NHibernate.Dialect.SQLiteDialect
Set driver_class to NHibernate.Driver.SQLite20Driver enable System.Data.SQLite provider for. NET 2.0.
Ingres 3.0
NHibernate.Dialect.IngresDialect
Third, NHibernate provides the ADO attribute
Property name
Use
Connection.provider_class
Implements the type of the Iconnectionprovider interface.
For example: (if it is a iconnectionprovider implementation class within NHibernate)Full.classname.of.ConnectionProvider, (If it is a custom nhibernate external Iconnectionprovider implementation Class)Full.classname.of.ConnectionProvider, assembly .
Connection.driver_class
If you use Driverconnectionprovider, implement the type of the idriver interface.
(If the Idriver type is implemented internally nhibernate)Full.classname.of.Driver (If the Idriver implementation class is a custom nhibernate external) Full.classname.of.Driver, assembly.
This configuration is usually not required to configure, if set up hibernate.dialect generally will automatically select the corresponding idriver. The default correspondence between dialect and Idriver can be viewed in the API documentation.
connection.connection_string
Database connection string
Connection.connection_string_name
Database connection string name (defined in the. NET configuration file <connectionStrings> configuration section for the name of the connection string.
connection.isolation
Ado. NET transaction isolation level, view the System.Data.IsolationLevel class to understand the specific meaning of each value, but be aware that most databases do not support all isolation levels.
For example: Chaos, ReadCommitted, ReadUncommitted, RepeatableRead, Serializable, Unspecified
Connection.release_mode
Specifies when ADO frees the database connection.
Example: auto (default) | On_close | after_transaction
Note that these settings only work for ISession that are obtained through isessionfactory.opensession . For ISessionobtained through isessionfactory.getcurrentsession , the configured Icurrentsessioncontext implementation controls these ISession The connection release mode.
Command_timeout
Specifies the time-out period for NHibernate generated idbcommands objects.
adonet.batch_size
Specifies the number of bulk updates with ADO, which is set to 0 by default (this feature is not enabled).
NHibernate Configuration File Property Description