Hibernate. cfg. xml configuration file sample:
<? XML version = "1.0" encoding = "UTF-8"?>
<Hibernate-configuration xmlns = "urn: nhibernate-configuration-2.2">
<Session-factory name = "rock">
<! -- Properties -->
<Property name = "connection. provider"> nhib.pdf. Connection. driverconnectionprovider </property>
<Property name = "connection. driver_class"> nhib.pdf. Driver. sqlite20driver, nhib.pdf </property>
<Property name = "connection. connection_string"> Data Source = D: \ data \ sqlite_db \ rock. DB ; Version = 3 </property>
<Property name = "dialect"> nhib.pdf. dialect. sqlitedialect, nhib.pdf </property>
<Property name = "query. substitutions"> true = 1; false = 0 </property>
<Property name = "proxyfactory. factory_class"> Nhibernate. bytecode. linfu. proxyfactoryfactory, nhibcode. bytecode. linfu </property>
<Property name = "show_ SQL"> false </property>
<Property name = "use_outer_join"> true </property>
<! --
These are different than the values in APP. config so I can verify these
Are being picked up
-->
<Property name = "command_timeout"> 444 </property>
<! -- Mapping Files -->
<! -- Are now optional
<Mapping File = "ABC. HBM. xml"/>
<Mapping Resource = "nhib.pdf. domainmodel. Simple. HBM. xml" assembly = "nhib.pdf. domainmodel"/>
-->
</Session-factory>
</Hibernate-configuration>
Automatically add the mapping sample of the primary key:
<? XML version = "1.0" encoding = "UTF-8"?>
<Hibernate-mapping xmlns = "urn: nhibernate-mapping-2.2" default-Lazy = "false" namespace = "Rock. Data. Model" assembly = "Rock. Data. Model">
<Class name = "passwordmaster, Rock. Data. Model" table = "passwordmaster" lazy = "false">
<! -- Primary key (s) -->
<ID name = "ID" column = "pwdkey" type = "int32" unsaved-value = "0">
<Generator class = "increment"/>
</ID>
<! -- Properties -->
<Property column = "pwdname" type = "string" name = "pwdname" not-null = "true" length = "50"/>
<Property column = "pwdid" type = "string" name = "pwdid" not-null = "true" length = "50"/>
<Property column = "pwdvalue" type = "string" name = "pwdvalue" not-null = "true" length = "50"/>
<Property column = "website" type = "string" name = "website" length = "50"/>
<Property column = "Q1" type = "string" name = "Q1" length = "50"/>
<Property column = "A1" type = "string" name = "A1" length = "50"/>
<Property column = "Q2" type = "string" name = "Q2" length = "50"/>
<Property column = "A2" type = "string" name = "A2" length = "50"/>
<Property column = "Q3" type = "string" name = "Q3" length = "50"/>
<Property column = "A3" type = "string" name = "A3" length = "50"/>
<Property column = "createdate" type = "datetime" name = "createdate" not-null = "true"/>
<Property column = "remark" type = "string" name = "remark" length = "255"/>
</Class>
</Hibernate-mapping>
Of course, the project must reference the file system. Data. SQLite. dll.