NHibernate Implementation of BulkOperationCleanupAction. An operation which may be scheduled for later execution. Usually, the operation is a database insert/update/delete, together with required second-level cache management. Called before executing any actions Execute this action Do we need to retain this instance until after the transaction completes? False if this class defines a no-op has after transaction completion. Called after the transaction completes What spaces (tables) are affected by this action? Create an action that will evict collection and entity regions based on queryspaces (table names). Any action relating to insert/update/delete of a collection Initializes a new instance of . The that is responsible for the persisting the Collection. The Persistent collection. The identifier of the Collection. The that the Action is occuring in. Called before executing any actions Execute this action Do we need to retain this instance until after the transaction completes? False if this class defines a no-op has after transaction completion. Called after the transaction completes Compares the current object with another object of the same type. A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the other parameter.Zero This object is equal to other. Greater than zero This object is greater than other. An object to compare with this object. What spaces (tables) are affected by this action? Execute this action Acts as a stand-in for an entity identifier which is supposed to be generated on insert (like an IDENTITY column) where the insert needed to be delayed because we were outside a transaction when the persist occurred (save currently still performs the insert). The stand-in is only used within the see cref="NHibernate.Engine.PersistenceContext" in order to distinguish one instance from another; it is never injected into the entity instance or returned to the client... Base class for actions relating to insert/update/delete of an entity instance. Instantiate an action. The session from which this action is coming. The id of the entity The entiyt instance The entity persister Entity name accessor Entity Id accessor Entity Instance Session from which this action originated The entity persister. Manages prepared statements and batching. Class exists to enforce separation of concerns Manages s and s for an .

Abstracts ADO.NET batching to maintain the illusion that a single logical batch exists for the whole session, even when batching is disabled. Provides transparent IDbCommand caching.

This will be useful once ADO.NET gets support for batching. Until that point no code exists that will do batching, but this will provide a good point to do error checking and making sure the correct number of rows were affected.

Get an for using in loading / querying. The to convert to an . The of the command. The SqlTypes of parameters in . An that is ready to be executed. If not explicitly released by , it will be released when the session is closed or disconnected. This does NOT add anything to the batch - it only creates the IDbCommand and does NOT cause the batch to execute... Get a non-batchable an to use for inserting / deleting / updating. Must be explicitly released by CloseCommand() The to convert to an . The of the command. The SqlTypes of parameters in . An that is ready to have the parameter values set and then executed. Close a opened using PrepareCommand() The to ensure is closed. The to ensure is closed. Close a opened using The to ensure is closed. Get a batchable to use for inserting / deleting / updating (might be called many times before a single call to ExecuteBatch() After setting parameters, call AddToBatch() - do not execute the statement explicitly. The to convert to an . The of the command. The SqlTypes of parameters in . Add an insert / delete / update to the current batch (might be called multiple times for a single PrepareBatchStatement()) Determines whether the number of rows affected by query is correct. Execute the batch Close any query statements that were left lying around Use this method instead of Dispose if the can be used again. Gets an by calling ExecuteReader on the . The to execute to get the . The from the . The Batcher is responsible for ensuring that all of the Drivers rules for how many open s it can have are followed. Executes the . The to execute. The number of rows affected. The Batcher is responsible for ensuring that all of the Drivers rules for how many open s it can have are followed. Must be called when an exception occurs. Cancel the current query statement Gets the value indicating whether there are any open resources managed by this batcher (IDbCommands or IDataReaders). Gets or sets the size of the batch, this can change dynamically by calling the session's SetBatchSize. The size of the batch. Initializes a new instance of the class. The owning this batcher. Prepares the for execution in the database. This takes care of hooking the up to an and if one exists. It will call Prepare if the Driver supports preparing commands. Ensures that the Driver's rules for Multiple Open DataReaders are being followed. Adds the expected row count into the batch. The number of rows expected to be affected by the query. If Batching is not supported, then this is when the Command should be executed. If Batching is supported then it should hold of on executing the batch until explicitly told to. A flag to indicate if Disose() has been called. Finalizer that ensures the object is correctly disposed of. Takes care of freeing the managed and unmanaged resources that this class is responsible for. Takes care of freeing the managed and unmanaged resources that this class is responsible for. Indicates if this BatcherImpl is being Disposed of or Finalized. If this BatcherImpl is being Finalized (isDisposing==false) then make sure not to call any methods that could potentially bring this BatcherImpl back to life. Gets the current that is contained for this Batch The current . Gets or sets the size of the batch, this can change dynamically by calling the session's SetBatchSize. The size of the batch. Gets the the Batcher was created in. The the Batcher was created in. Gets the for this batcher. Implementation of ColumnNameCache. Manages the database connection and transaction for an . This class corresponds to ConnectionManager and JDBCContext in Hibernate, combined. The batcher managed by this ConnectionManager. Expected row count. Valid only for batchable expectations. Factory for instances. Provide the class of according to the configuration and the capabilities of the driver. By default, .Net doesn't have any batching capabilities, drivers that does have batching support. The BatcherFactory trough session-factory configuration section. This interface was added in NHibernate for backdraw compatibility to have the ability to specify a default for a specific . An implementation of the interface that does no batching. Initializes a new instance of the class. The for this batcher. Executes the current and compares the row Count to the expectedRowCount. The expected number of rows affected by the query. A value of less than 0 indicates that the number of rows to expect is unknown or should not be a factor. Thrown when there is an expected number of rows to be affected and the actual number of rows is different. This Batcher implementation does not support batching so this is a no-op call. The actual execution of the is run in the AddToBatch method. A BatcherFactory implementation which constructs Batcher instances that do not perform batch operations. Summary description for OracleDataClientBatchingBatcher. By Tomer Avissar A ResultSet delegate, responsible for locally caching the columnName-to-columnIndex resolution that has been found to be inefficient in a few vendor's drivers (i.e., Oracle and Postgres). Summary description for SqlClientBatchingBatcher. Expose the batch functionality in ADO.Net 2.0 Microsoft in its wisdom decided to make my life hard and mark it internal. Through the use of Reflection and some delegates magic, I opened up the functionality. Observable performance benefits are 50%+ when used, so it is really worth it. Append a command to the batch This is required because SqlClient.SqlCommandSet will throw if the command has no parameters. Executes the batch This seems to be returning the total number of affected rows in all queries Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. 2 Return the batch command to be executed The number of commands batched in this instance Any exception that occurs in the O-R persistence layer. Exceptions that occur in the database layer are left as native exceptions. Initializes a new instance of the class. Initializes a new instance of the class. The message that describes the error. Initializes a new instance of the class. The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. Initializes a new instance of the class. The message that describes the error. The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. Initializes a new instance of the class with serialized data. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. CodeDOM-based bytecode provider. Retrieve the delegate for this provider capable of generating reflection optimization components. The class to be reflected upon. All property getters to be accessed via reflection. All property setters to be accessed via reflection. The reflection optimization delegate. The specific factory for this provider capable of generating run-time proxies for lazy-loading purposes. ctor The target class Array of setters Array of getters Set up the compiler options Add an assembly to the list of ReferencedAssemblies required to build the class Build the generated code Generated code An instance of the generated class Check if the property is public If IsPublic==true I can directly set the property If IsPublic==false I need to use the setter/getter Generate the required code C# code Represents optimized entity property access. Factory that generate object based on IReflectionOptimizer needed to replace the use of reflection. Used in and Generate the IReflectionOptimizer object The target class Array of setters Array of getters if the generation fails Represents reflection optimization for a particular class. Represents optimized entity instantiation. Perform instantiation of an instance of the underlying class. The new instance. Class constructor. Generates a dynamic method which creates a new instance of when invoked. Generates a dynamic method on the given type. Generates a dynamic method on the given type. An interface for factories of proxy factory instances. Currently used to abstract from the tupizer even if... Build a proxy factory specifically for handling runtime lazy loading. The lazy-load proxy factory. Emits an ldc.i4 opcode using the fastest available opcode choice. Emits IL to unbox a value type and if null, create a new instance of the value type. This does not work if the value type doesn't have a default constructor - we delegate that to the ISetter. Defines a new delegate type. A implementation that returns , disabling reflection optimization. A cached instance of a persistent class An item of cached data, timestamped with the time it was cached, when it was locked, when it was unlocked Caches data that is sometimes updated while maintaining the semantics of "read committed" isolation level. If the database is set to "repeatable read", this concurrency strategy almost maintains the semantics. Repeatable read isolation is compromised in the case of concurrent writes. This is an "asynchronous" concurrency strategy. If this strategy is used in a cluster, the underlying cache implementation must support distributed hard locks (which are held only momentarily). This strategy also assumes that the underlying cache implementation does not do asynchronous replication and that state has been fully replicated as soon as the lock is released. for a faster algorithm Implementors manage transactional access to cached data. Transactions pass in a timestamp indicating transaction start time. When used to cache entities and collections the key is the identifier of the entity/collection and the value should be set to the for an entity and the results of for a collection. Attempt to retrieve an object from the Cache The key (id) of the object to get out of the Cache. A timestamp prior to the transaction start time The cached object or Attempt to cache an object, after loading from the database The key (id) of the object to put in the Cache. The value A timestamp prior to the transaction start time the version number of the object we are putting a Comparer to be used to compare version numbers indicates that the cache should avoid a put if the item is already cached if the object was successfully cached We are going to attempt to update/delete the keyed object The key This method is used by "asynchronous" concurrency strategies. Called after an item has become stale (before the transaction completes). This method is used by "synchronous" concurrency strategies. Called after an item has been updated (before the transaction completes), instead of calling Evict(). This method is used by "synchronous" concurrency strategies. Called after an item has been inserted (before the transaction completes), instead of calling Evict(). This method is used by "synchronous" concurrency strategies. Called when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion. The key The soft lock This method is used by "asynchronous" concurrency strategies. Called after an item has been updated (after the transaction completes), instead of calling Release(). This method is used by "asynchronous" concurrency strategies. Called after an item has been inserted (after the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies. Evict an item from the cache immediately (without regard for transaction isolation). Evict all items from the cache immediately. Clean up all resources. Gets the cache region name. Gets or sets the for this strategy to use. The for this strategy to use. Generate an id for a new lock. Uniqueness per cache instance is very desirable but not absolutely critical. Must be called from one of the synchronized methods of this class. Do not return an item whose timestamp is later than the current transaction timestamp. (Otherwise we might compromise repeatable read unnecessarily.) Do not return an item which is soft-locked. Always go straight to the database instead. Note that since reading an item from that cache does not actually go to the database, it is possible to see a kind of phantom read due to the underlying row being updated after we have read it from the cache. This would not be possible in a lock-based implementation of repeatable read isolation. It is also possible to overwrite changes made and committed by another transaction after the current transaction read the item from the cache. This problem would be caught by the update-time version-checking, if the data is versioned or timestamped. Stop any other transactions reading or writing this item to/from the cache. Send them straight to the database instead. (The lock does time out eventually.) This implementation tracks concurrent locks by transactions which simultaneously attempt to write to an item. Do not add an item to the cache unless the current transaction timestamp is later than the timestamp at which the item was invalidated. (Otherwise, a stale item might be re-added if the database is operating in repeatable read isolation mode.) Whether the item was actually put into the cache decrement a lock and put it back in the cache Re-cache the updated state, if and only if there there are no other concurrent soft locks. Release our lock. Is the client's lock commensurate with the item in the cache? If it is not, we know that the cache expired the original lock. Gets the cache region name. Lock the item Is this item visible to the timestamped transaction? Don't overwite already cached items The timestamp on the cached data The actual cached data Not a lock! Represents any exception from an . Initializes a new instance of the class. Initializes a new instance of the class. The message that describes the error. Initializes a new instance of the class. The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. Initializes a new instance of the class. The message that describes the error. The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. Initializes a new instance of the class with serialized data. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. Factory class for creating an . No providers implement transactional caching currently, it was ported from Hibernate just for the sake of completeness. Creates an from the parameters. The name of the strategy that should use for the class. The name of the class the strategy is being created for. if the object being stored in the cache is mutable. Used to retrieve the global cache region prefix. Properties the cache provider can use to configure the cache. An to use for this object in the . Allows multiple entity classes / collection roles to be stored in the same cache region. Also allows for composite keys which do not properly implement equals()/hashCode(). Construct a new key for a collection or entity instance. Note that an entity name should always be the root entity name, not a subclass entity name. The identifier associated with the cached data The Hibernate type mapping The entity or collection-role name. The entiyt mode of the originating session The session factory for which we are caching A soft lock which supports concurrent locking, timestamped with the time it was released This class was named Lock in H2.1 Marker interface, denoting a client-visible "soft lock" on a cached item. Increment the lock, setting the new lock timeout Decrement the lock, setting the unlock timestamp if now unlocked Can the timestamped transaction re-cache this locked item now? locks are not returned to the client! Was this lock held concurrently by multiple transactions? Yes, this is a lock A simple -based cache Implementors define a caching algorithm. All implementations must be threadsafe. The key is the identifier of the object that is being cached and the value is a . Get the object from the Cache Remove an item from the Cache. The Key of the Item in the Cache to remove. Clear the Cache Clean up. If this is a clustered cache, lock the item The Key of the Item in the Cache to lock. If this is a clustered cache, unlock the item The Key of the Item in the Cache to unlock. Generate a timestamp Get a reasonable "lock timeout" Gets the name of the cache region Cache Provider plugin for NHibernate that is configured by using cache.provider_class="NHibernate.Cache.HashtableCacheProvider" Support for pluggable caches Configure the cache the name of the cache region configuration settings generate a timestamp Callback to perform any necessary initialization of the underlying cache implementation during ISessionFactory construction. current configuration settings Callback to perform any necessary cleanup of the underlying cache implementation during . Contract for sources of optimistically lockable data sent to the second level cache. Note currently EntityPersisters are the only viable source. Does this source represent versioned (i.e., and thus optimistically lockable) data? True if this source represents versioned data; false otherwise. Get the comparator used to compare two different version values together. An appropriate comparator. Defines the contract for caches capable of storing query results. These caches should only concern themselves with storing the matching result ids. The transactional semantics are necessarily less strict than the semantics of an item cache. Defines a factory for query cache instances. These factories are responsible for creating individual QueryCache instances. A cache provider placeholder used when caching is disabled. Configure the cache the name of the cache region configuration settings Generate a timestamp Callback to perform any necessary initialization of the underlying cache implementation during SessionFactory construction. current configuration settings. Callback to perform any necessary cleanup of the underlying cache implementation during SessionFactory.close(). Caches data that is sometimes updated without ever locking the cache. If concurrent access to an item is possible, this concurrency strategy makes no guarantee that the item returned from the cache is the latest version available in the database. Configure your cache timeout accordingly! This is an "asynchronous" concurrency strategy. for a much stricter algorithm Get the most recent version, if available. Add an item to the cache Do nothing Invalidate the item Invalidate the item Do nothing Invalidate the item (again, for safety). Invalidate the item (again, for safety). Do nothing Gets the cache region name. Initializes a new instance of the class. the sesion factory for this query key, required to get the identifiers of entities that are used as values. The query string. The query parameters. The filters. Caches data that is never updated Unsupported! Unsupported! Unsupported! Do nothing. Do nothing. Do nothing. Unsupported! Gets the cache region name. The standard implementation of the Hibernate interface. This implementation is very good at recognizing stale query results and re-running queries when it detects this condition, recaching the new results. Standard Hibernate implementation of the IQueryCacheFactory interface. Returns instances of . Generates increasing identifiers (in a single application domain only). Not valid across multiple application domains. Identifiers are not necessarily strictly increasing, but usually are. Tracks the timestamps of the most recent updates to particular tables. It is important that the cache timeout of the underlying cache implementation be set to a higher value than the timeouts of any of the query caches. In fact, we recommend that the the underlying cache not be configured for expiry at all. Note, in particular, that an LRU cache expiry policy is never appropriate. Helper to parse hibernate-configuration XmlNode. The XML node name for hibernate configuration section in the App.config/Web.config and for the hibernate.cfg.xml . The XML Namespace for the nhibernate-configuration XPath expression for bytecode-provider property. XPath expression for reflection-optimizer property. XPath expression for session-factory whole node. XPath expression for session-factory.property nodes XPath expression for session-factory.mapping nodes XPath expression for session-factory.class-cache nodes XPath expression for session-factory.collection-cache nodes XPath expression for session-factory.event nodes XPath expression for session-factory.listener nodes Convert a string to . The string that represent . The converted to . for invalid values. See for allowed values. Convert a string to . The string that represent . The converted to . If the values is invalid. See for allowed values. Convert a string to . The string that represent . The converted to . If the values is invalid. See for allowed values. Convert a string to . The string that represent . The converted to . If the values is invalid. See for allowed values. Values for class-cache and collection-cache strategy. Xml value: read-only Xml value: read-write Xml value: nonstrict-read-write Xml value: transactional Values for class-cache include. Not implemented in Cache. Xml value: all Xml value: non-lazy Configuration parsed values for a class-cache XML node. Initializes a new instance of the class. The class full name. Cache strategy. When is null or empty. Initializes a new instance of the class. The class full name. Cache strategy. Values for class-cache include. When is null or empty. Initializes a new instance of the class. The class full name. Cache strategy. The cache region. When is null or empty. Initializes a new instance of the class. The class full name. Cache strategy. Values for class-cache include. The cache region. When is null or empty. The class full name. The cache region. If null or empty the is used during configuration. Cache strategy. class-cache include. Not implemented in Cache. Defaul value . Configuration parsed values for a collection-cache XML node. Initializes a new instance of the class. The cache role. Cache strategy. When is null or empty. Initializes a new instance of the class. The cache role. Cache strategy. The cache region. When is null or empty. The role. The cache region. If null or empty the is used during configuration. Cache strategy. Configuration parsed values for a event XML node. Initializes a new instance of the class. The listener. The type. The default type of listeners. Listeners for this event. Values for bytecode-provider system property. Xml value: codedom Xml value: lcg Xml value: null Configuration parsed values for hibernate-configuration section. Initializes a new instance of the class. The XML reader to parse. The nhibernate-configuration.xsd is applied to the XML. When nhibernate-configuration.xsd can't be applied. Value for bytecode-provider system property. Default value . Value for reflection-optimizer system property. Default value true. The if the session-factory exists in hibernate-configuration; Otherwise null. Configuration parsed values for a listener XML node Initializes a new instance of the class. The class full name. When is null or empty. Initializes a new instance of the class. The class full name. The listener type. When is null or empty. The class full name. The listener type. Default value mean that the value is ignored. Configuration parsed values for a mapping XML node There are 3 possible combinations of mapping attributes 1 - resource and assembly: NHibernate will read the mapping resource from the specified assembly 2 - file only: NHibernate will read the mapping from the file. 3 - assembly only: NHibernate will find all the resources ending in hbm.xml from the assembly. Initializes a new instance of the class. Mapped file. When is null or empty. Initializes a new instance of the class. The assembly name. The mapped embedded resource. When is null or empty. Configuration parsed values for a session-factory XML node. Initializes a new instance of the class. The session factory name. Null or empty string are allowed. The session factory name. Session factory propeties bag. Session factory mapping configuration. Session factory class-cache configurations. Session factory collection-cache configurations. Session factory event configurations. Session factory listener configurations. Responsible for checking that a resource name matches the default pattern of "*.hbm.xml". This is the default filter for . Responsible for determining whether an embedded resource should be parsed for HBM XML data while iterating through an . A base class for HBM schema classes that provides helper methods. Responsible for converting a of HBM XML into an instance of . Responsible for building a list of objects from a range of acceptable sources. Calls the greedy constructor, passing it new instances of and . Adds any embedded resource streams which pass the . An assembly containing embedded mapping documents. A custom filter. Adds any embedded resource streams which pass the default filter. An assembly containing embedded mapping documents. Responsible for converting a of HBM XML into an instance of . Uses an to deserialize HBM. Converts a partial class name into a fully qualified one Attempts to find a type by its full name. Throws a using the provided in case of failure. name of the class to find Error message to use for the in case of failure. Should contain the {0} formatting placeholder. A instance. Thrown when there is an error loading the class. Similar to , but handles short class names by calling . Called for all collections. parameter was added in NH to allow for reflection related to generic types. Called for arrays and primitive arrays Called for Maps Called for all collections Extracts the names of classes mapped in a given file, and the names of the classes they extend. Returns a collection of containing information about all classes in this stream. A validated representing a mapping file. Holds information about mapped classes found in the hbm.xml files. Allows the application to specify properties and mapping documents to be used when creating a . Usually an application will create a single , build a single instance of , and then instantiate objects in threads servicing client requests. The is meant only as an initialization-time object. is immutable and does not retain any association back to the The XML Namespace for the nhibernate-mapping Default name for hibernate configuration file. Clear the internal state of the object. Create a new Configuration object. Get the mapping for a particular class Get the mapping for a particular entity An entity name. the entity mapping information Get the mapping for a particular collection role a collection role Read mappings from a particular XML file. This method is equivalent to . Read mappings from a particular XML file. a path to a file This configuration object. Read mappings from a . This method is equivalent to . an XML string The name to use in error reporting. May be . This configuration object. Read mappings from a . an XML string This configuration object. Read mappings from a URL. a URL This configuration object. Read mappings from a URL. a to read the mappings from. This configuration object. Read mappings from an . A loaded that contains the mappings. The name of the document, for error reporting purposes. This configuration object. Takes the validated XmlDocument and has the Binder do its work of creating Mapping objects from the Mapping Xml. The NamedXmlDocument that contains the validated mapping XML file. Create a new to add classes and collection mappings to. Read mappings from a . The stream containing XML This Configuration object. The passed in through the parameter is not guaranteed to be cleaned up by this method. It is the caller's responsiblity to ensure that is properly handled when this method completes. Read mappings from a . The stream containing XML The name of the stream to use in error reporting. May be . This Configuration object. The passed in through the parameter is not guaranteed to be cleaned up by this method. It is the caller's responsiblity to ensure that is properly handled when this method completes. Adds the mappings in the resource of the assembly. The path to the resource file in the assembly. The assembly that contains the resource file. This configuration object. Read a mapping from an embedded resource, using a convention. The type to map. This configuration object. The convention is for class Foo.Bar.Foo to be mapped by the resource named Foo.Bar.Foo.hbm.xml, embedded in the class' assembly. If the mappings and classes are defined in different assemblies or don't follow the naming convention, this method cannot be used. Adds all of the assembly's embedded resources whose names end with .hbm.xml. The name of the assembly to load. This configuration object. The assembly must be loadable using . If this condition is not satisfied, load the assembly manually and call instead. Adds all of the assembly's embedded resources whose names end with .hbm.xml. The assembly. This configuration object. Read all mapping documents from a directory tree. Assume that any file named *.hbm.xml is a mapping document. a directory Generate DDL for droping tables Generate DDL for creating tables This method may be called many times!! Instantiate a new , using the properties and mappings in this configuration. The will be immutable, so changes made to the configuration after building the will not affect it. An instance. Set the default assembly to use for the mappings added to the configuration afterwards. The default assembly name. This configuration instance. This setting can be overridden for a mapping file by setting default-assembly attribute of <hibernate-mapping> element. Set the default namespace to use for the mappings added to the configuration afterwards. The default namespace. This configuration instance. This setting can be overridden for a mapping file by setting default-namespace attribute of <hibernate-mapping> element. Sets the default interceptor for use by all sessions. The default interceptor. This configuration instance. Specify a completely new set of properties Adds an of configuration properties. The Key is the name of the Property and the Value is the value of the Property. An of configuration properties. This object. Sets the value of the configuration property. The name of the property. The value of the property. This configuration object. Gets the value of the configuration property. The name of the property. The configured value of the property, or if the property was not specified. Configure NHibernate using the <hibernate-configuration> section from the application config file, if found, or the file hibernate.cfg.xml if the <hibernate-configuration> section not include the session-factory configuration. A configuration object initialized with the file. To configure NHibernate explicitly using hibernate.cfg.xml, appling merge/override of the application configuration file, use this code: configuration.Configure("path/to/hibernate.cfg.xml"); Configure NHibernate using the file specified. The location of the XML file to use to configure NHibernate. A Configuration object initialized with the file. Calling Configure(string) will override/merge the values set in app.config or web.config Configure NHibernate using a resource contained in an Assembly. The that contains the resource. The name of the manifest resource being requested. A Configuration object initialized from the manifest resource. Calling Configure(Assembly, string) will overwrite the values set in app.config or web.config Configure NHibernate using the specified XmlReader. The that contains the Xml to configure NHibernate. A Configuration object initialized with the file. Calling Configure(XmlReader) will overwrite the values set in app.config or web.config Set up a cache for an entity class Set up a cache for a collection role Create an object-oriented view of the configuration properties A object initialized from the settings properties. Set a custom naming strategy the NamingStrategy to set Load and validate the mappings in the against the nhibernate-mapping-2.2 schema, without adding them to the configuration. This method is made public to be usable from the unit tests. It is not intended to be called by end users. The XmlReader that contains the mapping. The name of the document, for error reporting purposes. NamedXmlDocument containing the validated XmlDocument built from the XmlReader. Adds the Mappings in the after validating it against the nhibernate-mapping-2.2 schema. The XmlReader that contains the mapping. This Configuration object. Adds the Mappings in the after validating it against the nhibernate-mapping-2.2 schema. The XmlReader that contains the mapping. The name of the document to use for error reporting. May be . This Configuration object. Set or clear listener for a given . The . The array of AssemblyQualifiedName of each listener for . must implements the interface related with . All listeners of the given will be cleared if the is null or empty. when an element of have an invalid value or cant be instantiated. Set or clear listener for a given . The . The listener for or null to clear. must implements the interface related with . Set or clear listeners for a given . The . The listener for or null to clear. Listners of must implements one of the interface of event listenesr. Generate DDL for altering tables The class mappings The collection mappings The table mappings The named queries Retrieve the user-supplied delegate to handle non-existent entity scenarios. Specify a user-supplied delegate to be used to handle scenarios where an entity could not be located by specified id. This is mainly intended for EJB3 implementations to be able to control how proxy initialization errors should be handled... Gets or sets the to use. The to use. Gets or sets the that contains the configuration properties and their values. The that contains the configuration properties and their values. Get the query language imports The named SQL queries Naming strategy for tables and columns Defines operations common to "compiled" mappings (ie. SessionFactory) and "uncompiled" mappings (ie Configuration that are used by implementors of IType Summary description for ConfigurationSectionHandler. The default See for a better alternative A set of rules for determining the physical column and table names given the information in the mapping document. May be used to implement project-scoped naming standards for database objects. Return a table name for an entity class the fully-qualified class name a table name Return a column name for a property path expression a property path a column name Alter the table name given in the mapping document a table name a table name Alter the column name given in the mapping document a column name a column name Return a table name for a collection the fully-qualified name of the owning entity class a property path a table name Return the logical column name used to refer to a column in the metadata (like index, unique constraints etc) A full bijection is required between logicalNames and physical ones logicalName have to be case insersitively unique for a given table given column name if any property name of this column The singleton instance Return the unqualified class name Return the unqualified property name Return the argument Return the argument Return the unqualified property name Provides access to configuration information. NHibernate has two property scopes: Factory-level properties may be passed to the when it is instantiated. Each instance might have different property values. If no properties are specified, the factory gets them from Environment System-level properties are shared by all factory instances and are always determined by the properties In NHibernate, <hibernate-configuration> section in the application configuration file corresponds to Java system-level properties; <session-factory> section is the session-factory-level configuration. It is possible to use the applicatoin configuration file (App.config) together with the NHibernate configuration file (hibernate.cfg.xml) at the same time. Properties in hibernate.cfg.xml override/merge properties in applicatoin configuration file where same property is found. For others configuration a merge is applied. Used to find the .Net 2.0 named connection string A default database schema (owner) name to use for unqualified tablenames A default database catalog name to use for unqualified tablenames Should named queries be checked during startup (the default is enabled). Mainly intended for test environments. Enable statistics collection Issue warnings to user when any obsolete property names are used. NHibernate version (informational). Gets a copy of the configuration found in <hibernate-configuration> section of app.config/web.config. This is the replacement for hibernate.properties The bytecode provider to use. This property is read from the <nhibernate> section of the application configuration file by default. Since it is not always convenient to configure NHibernate through the application configuration file, it is also possible to set the property value manually. This should only be done before a configuration object is created, otherwise the change may not take effect. Whether to enable the use of reflection optimizer This property is read from the <nhibernate> section of the application configuration file by default. Since it is not always convenient to configure NHibernate through the application configuration file, it is also possible to set the property value manually. This should only be done before a configuration object is created, otherwise the change may not take effect. Represents a mapping queued for delayed processing to await processing of an extends entity upon which it depends. An exception that occurs at configuration time, rather than runtime, as a result of something screwy in the hibernate.cfg.xml. An exception that usually occurs at configuration time, rather than runtime, as a result of something screwy in the O-R mappings Initializes a new instance of the class. The message that describes the error. Initializes a new instance of the class. The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. Initializes a new instance of the class. The message that describes the error. The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. Initializes a new instance of the class with serialized data. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. Initializes a new instance of the class. Default message is used. Initializes a new instance of the class. The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. Initializes a new instance of the class. The message that describes the error. Initializes a new instance of the class. The message that describes the error. The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. Initializes a new instance of the class with serialized data. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. Summary description for ImprovedNamingStrategy. The singleton instance Return the unqualified class name, mixed case converted to underscores Return the full property path with underscore seperators, mixed case converted to underscores Convert mixed case to underscores Convert mixed case to underscores Return the full property path prefixed by the unqualified class name, with underscore seperators, mixed case converted to underscores A collection of mappings from classes and collections to relational database tables. Represents a single <hibernate-mapping> element. Binding table between the logical column name and the name out of the naming strategy for each table. According that when the column name is not set, the property name is considered as such This means that while theorically possible through the naming strategy contract, it is forbidden to have 2 real columns having the same logical name Binding between logical table name and physical one (ie after the naming strategy has been applied) Adds an import to allow for the full class name Namespace.Entity to be referenced as Entity or some other name in HQL. The name of the type that is being renamed. The new name to use in HQL for the type. Thrown when the rename already identifies another type. The default namespace for persistent classes The default assembly for persistent classes Gets or sets a boolean indicating if the Fully Qualified Type name should automattically have an import added as the class name. if the class name should be used as an import. Auto-import is used to shorten the string used to refer to types to just their unqualified name. So if the type MyAssembly.MyNamespace.MyClass, MyAssembly has auto-import="false" then all use of it in HQL would need to be the fully qualified version MyAssembly.MyNamespace.MyClass. If auto-import="true", the type could be referred to in HQL as just MyClass. Queues mapping files according to their dependency order. Adds the specified document to the queue. Gets a that can now be processed (i.e. that doesn't depend on classes not yet processed). Checks that no unprocessed documents remain in the queue. Holds information about mapped classes found in an embedded resource Gets the names of all classes outside this resource needed by the classes in this resource. An of Settings that affect the behavior of NHibernate at runtime. Reads configuration properties and configures a instance. Provides callbacks from the to the persistent object. Persistent classes may implement this interface but they are not required to. , , and are intended to be used to cascade saves and deletions of dependent objects. This is an alternative to declaring cascaded operations in the mapping file. may be used to initialize transient properties of the object from its persistent state. It may not be used to load dependent objects since the interface may not be invoked from inside this method. A further intended usage of , , and is to store a reference to the for later use. If , , or return , the operation is silently vetoed. If a is thrown, the operation is vetoed and the exception is passed back to the application. Note that is called after an identifier is assigned to the object, except when identity key generation is used. Called when an entity is saved The session If we should veto the save Called when an entity is passed to . The session A value indicating whether the operation should be vetoed or allowed to proceed. This method is not called every time the object's state is persisted during a flush. Called when an entity is deleted The session A value indicating whether the operation should be vetoed or allowed to proceed. Called after an entity is loaded. It is illegal to access the from inside this method.. However, the object may keep a reference to the session for later use The session The identifier Veto the action Accept the action Implemented by persistent classes with invariants that must be checked before inserting into or updating the database Validate the state of the object before persisting it. If a violation occurs, throw a . This method must not change the state of the object by side-effect. Thrown from when an invariant was violated. Some applications might subclass this exception in order to provide more information about the violation Initializes a new instance of the class. Initializes a new instance of the class. The message that describes the error. Initializes a new instance of the class. The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. Initializes a new instance of the class. The message that describes the error. The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. Initializes a new instance of the class with serialized data. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. An unordered, unkeyed collection that can contain the same element multiple times. The .NET collections API, has no Bag. The interface closely resembles bag semantics, however NHibernate for .NET 1.1 used so is used to ensure the easiest transition to generics. The type of the element the bag should hold. The underlying collection used is an Base class for implementing . Persistent collections are treated as value objects by NHibernate. ie. they have no independent existence beyond the object holding a reference to them. Unlike instances of entity classes, they are automatically deleted when unreferenced and automatically become persistent when held by a persistent object. Collections can be passed between different objects (change "roles") and this might cause their elements to move from one database table to another. NHibernate "wraps" a collection in an instance of . This mechanism is designed to support tracking of changes to the collection's persistent state and lazy instantiation of collection elements. The downside is that only certain abstract collection types are supported and any extra semantics are lost. Applications should never use classes in this namespace directly, unless extending the "framework" here. Changes to structure of the collection are recorded by the collection calling back to the session. Changes to mutable elements (ie. composite elements) are discovered by cloning their state when the collection is initialized and comparing at flush time. Return the user-visible collection (or array) instance By default, the NHibernate wrapper is an acceptable collection for the end user code to work with because it is interface compatible. An NHibernate PersistentList is an IList, an NHibernate PersistentMap is an IDictionary and those are the types user code is expecting. Clears out any Queued Additions. After a Flush() the database is in synch with the in-memory contents of the Collection. Since everything is in synch remove any Queued Additions. Called just before reading any rows from the Called after reading all rows from the This should be overridden by sub collections that use temporary collections to store values read from the db. Disassociate this collection from the given session. true if this was currently associated with the given session Associate the collection with the given session. false if the collection was already associated with the session Read the state of the collection from a disassembled cached value. Iterate all collection entries, during update of the database An that gives access to all entries in the collection. Reads the row from the . This method should be prepared to handle duplicate elements caused by fetching multiple collections, or should be updated to return for the collection type. The IDataReader that contains the value of the Identifier The persister for this Collection. The descriptor providing result set column names The owner of this Collection. The object that was contained in the row. Get the identifier of the given collection entry Get the index of the given collection entry Get the value of the given collection entry Called before any elements are read into the collection, allowing appropriate initializations to occur. The for this persistent collection. Does the current state exactly match the snapshot? The to compare the elements of the Collection. if the wrapped collection is different than the snapshot of the collection or if one of the elements in the collection is dirty. Disassemble the collection, ready for the cache The for this Collection. The contents of the persistent collection in a cacheable form. Gets a indicating if the rows for this collection need to be recreated in the table. The for this Collection. by default since most collections can determine which rows need to be individually updated/inserted/deleted. Currently only 's for many-to-many need to be recreated. Return a new snapshot of the current state of the collection To be called internally by the session, forcing immediate initalization. This method is similar to , except that different exceptions are thrown. Does an element exist at this entry in the collection? Do we need to insert this element? Do we need to update this element? Get all the elements that need deleting Is this the wrapper for the given underlying collection instance? The collection to see if this IPersistentCollection is wrapping. if the IPersistentCollection is wrappping the collection instance, otherwise. Called before inserting rows, to ensure that any surrogate keys are fully generated Called after inserting a row, to fetch the natively generated id Get all "orphaned" elements The snapshot of the collection. The persistent class whose objects the collection is expected to contain. An that contains all of the elements that have been orphaned. Get the snapshot value of the given collection entry Called after initializing from cache Clear the dirty flag, after flushing changes to the database. Mark the collection as dirty The owning entity. Note that the owner is only set during the flush cycle, and when a new collection wrapper is created while loading an entity. Is the initialized collection empty? Gets a indicating if the underlying collection is directly accessable through code. if we are not guaranteed that the NHibernate collection wrapper is being used. This is typically whenever a transient object that contains a collection is being associated with an through or . NHibernate can't guarantee that it will know about all operations that would cause NHibernate's collections to call or . Is the collection dirty? Note that this is only reliable during the flush cycle, after the collection elements are dirty checked against the snapshot. Called by any read-only method of the collection interface Called by any writer method of the collection interface Queue an addition if the peristent collection supports it if the addition was queued up, if the persistent collection doesn't support Queued Addition. Queue additions After reading all existing elements from the database, add the queued elements to the underlying collection. The to add. The that is currently loading the collection. The default implementation is to throw an because most collections do not support delayed addition. If the collection does then override this method. Clears out any Queued Additions. After a Flush() the database is in synch with the in-memory contents of the Collection. Since everything is in synch remove any Queued Additions. Not called by Hibernate, but used by non-NET serialization, eg. SOAP libraries. Not called by Hibernate, but used by non-NET serialization, eg. SOAP libraries. Return the user-visible collection (or array) instance By default, the NHibernate wrapper is an acceptable collection for the end user code to work with because it is interface compatible. An NHibernate PersistentList is an IList, an NHibernate PersistentMap is an IDictionary and those are the types user code is expecting. Called just before reading any rows from the Called after reading all rows from the This should be overridden by sub collections that use temporary collections to store values read from the db. Initialize the collection, if possible, wrapping any exceptions in a runtime exception currently obsolete if we cannot initialize Mark the collection as initialized. Disassociate this collection from the given session. true if this was currently associated with the given session Associate the collection with the given session. false if the collection was already associated with the session Read the state of the collection from a disassembled cached value. Iterate all collection entries, during update of the database Reads the row from the . The IDataReader that contains the value of the Identifier The persister for this Collection. The descriptor providing result set column names The owner of this Collection. The object that was contained in the row. Get the index of the given collection entry Called before any elements are read into the collection, allowing appropriate initializations to occur. Return a new snapshot of the current state The for this Collection. Disassemble the collection, ready for the cache Gets a indicating if the rows for this collection need to be recreated in the table. The for this Collection. by default since most collections can determine which rows need to be individually updated/inserted/deleted. Currently only 's for many-to-many need to be recreated. To be called internally by the session, forcing immediate initalization. This method is similar to , except that different exceptions are thrown. Does an element exist at this entry in the collection? Do we need to insert this element? Do we need to update this element? Get all the elements that need deleting Is this the wrapper for the given underlying collection instance? Gets the Snapshot from the current session the collection is in. Called before inserting rows, to ensure that any surrogate keys are fully generated Called after inserting a row, to fetch the natively generated id Get all "orphaned" elements Is the initialized collection empty? Is the collection currently connected to an open session? Is this collection in a state that would allow us to "queue" additions? Gets a indicating if the underlying collection is directly accessable through code. if we are not guaranteed that the NHibernate collection wrapper is being used. This is typically whenever a transient object that contains a collection is being associated with an through or . NHibernate can't guarantee that it will know about all operations that would cause NHibernate's collections to call or . Initializes an instance of the in the . The the bag is in. Initializes an instance of the that wraps an existing in the . The the bag is in. The to wrap. Gets a indicating if this Bag needs to be recreated in the database. The for this Collection. if this is a one-to-many bag, if this is not a one-to-many bag. Since a bag is an unordered, unindexed collection that permits duplicates it is not possible to determine what has changed in a many-to-many so it is just recreated. Counts the number of times that the occurs in the . The element to find in the list. The to search. The that can determine equality. The number of occurrences of the element in the list. Is this the wrapper for the given underlying bag instance? The bag that might be wrapped. if the is equal to the wrapped collection by object reference. Is the initialized GenericBag empty? if the bag has a Count==0, otherwise. Implements "bag" semantics more efficiently than by adding a synthetic identifier column to the table. The identifier is unique for all rows in the table, allowing very efficient updates and deletes. The value of the identifier is never exposed to the application. Identifier bags may not be used for a many-to-one association. Furthermore, there is no reason to use inverse="true". Initializes this Bag from the cached values. The CollectionPersister to use to reassemble the PersistentIdentifierBag. The disassembled PersistentIdentifierBag. The owner object. A persistent wrapper for an The type of the element the list should hold. The underlying collection used is a Initializes an instance of the in the . The the list is in. Initializes an instance of the that wraps an existing in the . The the bag is in. The to wrap. Return a new snapshot of the current state. The for this Collection. A new that contains Deep Copies of the Elements stored in this wrapped collection. Get all "orphaned" elements. The snapshot of the collection. The type of the entities the collection is supposed to contain. An that contains all of the elements that have been orphaned. A persistent wrapper for a . Underlying collection is a The type of the keys in the IDictionary. The type of the elements in the IDictionary. Initializes an instance of the in the . The the map is in. Initializes an instance of the that wraps an existing in the . The the bag is in. The to wrap. .NET has no design equivalent for Java's Set so we are going to use the Iesi.Collections library. This class is internal to NHibernate and shouldn't be used by user code. The code for the Iesi.Collections library was taken from the article Add Support for "Set" Collections to .NET that was written by JasonSmith. The that NHibernate is wrapping. A temporary list that holds the objects while the set is being populated from the database. This is necessary to ensure that the object being added to the set doesn't have its and methods called during the load process. Returns a Hashtable where the Key & the Value are both a Copy of the same object. This constructor is NOT meant to be called from user code. Creates a new PersistentGenericSet initialized to the values in the Map. This constructor is NOT meant to be called from user code. Only call this constructor if you consider the map initialized. Initializes this PersistentGenericSet from the cached values. The CollectionPersister to use to reassemble the set. The disassembled set. The owner object. Set up the temporary List that will be used in the EndRead() to fully create the set. Takes the contents stored in the temporary list created during that was populated during and writes it to the underlying set. A persistent wrapper for an array. lazy initialization is NOT supported The that NHibernate is wrapping. A temporary list that holds the objects while the PersistentArrayHolder is being populated from the database. Before is called the PersistentArrayHolder needs to setup a temporary list to hold the objects. Takes the contents stored in the temporary list created during that was populated during and write it to the underlying array. Initializes this array holder from the cached values. The CollectionPersister to use to reassemble the Array. The disassembled Array. The owner object. Returns the user-visible portion of the NHibernate PersistentArrayHolder. The array that contains the data, not the NHibernate wrapper. An unordered, unkeyed collection that can contain the same element multiple times. The .NET collections API has no Bag class. Most developers seem to use s to represent bag semantics, so NHibernate follows this practice. Counts the number of times that the occurs in the . The element to find in the list. The to search. The that can determine equality. The number of occurrences of the element in the list. Initializes this PersistentBag from the cached values. The CollectionPersister to use to reassemble the PersistentBag. The disassembled PersistentBag. The owner object. Gets a indicating if this PersistentBag needs to be recreated in the database. if this is a one-to-many Bag, if this is not a one-to-many Bag. Since a Bag is an unordered, unindexed collection that permits duplicates it is not possible to determine what has changed in a many-to-many so it is just recreated. Implements "bag" semantics more efficiently than a regular by adding a synthetic identifier column to the table. The identifier is unique for all rows in the table, allowing very efficient updates and deletes. The value of the identifier is never exposed to the application. PersistentIdentifierBags may not be used for a many-to-one association. Furthermore, there is no reason to use inverse="true". Initializes this Bag from the cached values. The CollectionPersister to use to reassemble the PersistentIdentifierBag. The disassembled PersistentIdentifierBag. The owner object. A persistent wrapper for an The underlying collection used in an . Return a new snapshot of the current state. The for this Collection. A new that contains Deep Copies of the Elements stored in this wrapped collection. Initializes an instance of the in the . The the list is in. Initializes an instance of the that wraps an existing in the . The the list is in. The to wrap. Initializes this PersistentList from the cached values. The CollectionPersister to use to reassemble the PersistentList. The disassembled PersistentList. The owner object. A persistent wrapper for a . Underlying collection is a . Construct an uninitialized PersistentMap. The ISession the PersistentMap should be a part of. Construct an initialized PersistentMap based off the values from the existing IDictionary. The ISession the PersistentMap should be a part of. The IDictionary that contains the initial values. Initializes this PersistentMap from the cached values. The CollectionPersister to use to reassemble the PersistentMap. The disassembled PersistentMap. The owner object. .NET has no design equivalent for Java's Set so we are going to use the Iesi.Collections library. This class is internal to NHibernate and shouldn't be used by user code. The code for the Iesi.Collections library was taken from the article Add Support for "Set" Collections to .NET that was written by JasonSmith. The that NHibernate is wrapping. A temporary list that holds the objects while the PersistentSet is being populated from the database. This is necessary to ensure that the object being added to the PersistentSet doesn't have its' GetHashCode() and Equals() methods called during the load process. Returns a Hashtable where the Key & the Value are both a Copy of the same object. This constructor is NOT meant to be called from user code. Creates a new PersistentSet initialized to the values in the Map. This constructor is NOT meant to be called from user code. Only call this constructor if you consider the map initialized. Initializes this PersistentSet from the cached values. The CollectionPersister to use to reassemble the PersistentSet. The disassembled PersistentSet. The owner object. Set up the temporary List that will be used in the EndRead() to fully create the set. Takes the contents stored in the temporary list created during BeginRead() that was populated during ReadFrom() and write it to the underlying PersistentSet. The base class for the ConnectionProvider. A strategy for obtaining ADO.NET . The IConnectionProvider interface is not intended to be exposed to the application. Instead it is used internally by NHibernate to obtain . Implementors should provide a public default constructor. Initialize the connection provider from the given properties. The connection provider settings Dispose of a used The to clean up. Get an open . An open . Gets the this ConnectionProvider should use to communicate with the .NET Data Provider The to communicate with the .NET Data Provider. Closes the . The to clean up. Configures the ConnectionProvider with the Driver and the ConnectionString. An that contains the settings for this ConnectionProvider. Thrown when a could not be found in the settings parameter or the Driver Class could not be loaded. Get the .NET 2.0 named connection string Thrown when a was found in the settings parameter but could not be found in the app.config Configures the driver for the ConnectionProvider. An that contains the settings for the Driver. Thrown when the could not be found in the settings parameter or there is a problem with creating the . Get an open . An open . A flag to indicate if Disose() has been called. Finalizer that ensures the object is correctly disposed of. Takes care of freeing the managed and unmanaged resources that this class is responsible for. Takes care of freeing the managed and unmanaged resources that this class is responsible for. Indicates if this ConnectionProvider is being Disposed of or Finalized.

If this ConnectionProvider is being Finalized (isDisposing==false) then make sure not to call any methods that could potentially bring this ConnectionProvider back to life.

If any subclasses manage resources that also need to be disposed of this method should be overridden, but don't forget to call it in the override.

Gets the for the to connect to the database. The for the to connect to the database. Gets the that can create the object. The that can create the . Instanciates a connection provider given configuration properties. A ConnectionProvider that uses an IDriver to create connections. Initializes a new instance of the class. Closes and Disposes of the . The to clean up. Gets a new open through the . An Open . If there is any problem creating or opening the . An implementation of the IConnectionProvider that simply throws an exception when a connection is requested. This implementation indicates that the user is expected to supply an ADO.NET connection Throws an if this method is called because the user is responsible for closing s. The to clean up. Thrown when this method is called. User is responsible for closing s. Throws an if this method is called because the user is responsible for creating s. No value is returned because an is thrown. Thrown when this method is called. User is responsible for creating s. Configures the ConnectionProvider with only the Driver class. All other settings of the Connection are the responsibility of the User since they configured NHibernate to use a Connection supplied by the User. Provides a current session for each . Not recommended for .NET 2.0 web applications. Extends the contract defined by by providing methods to bind and unbind sessions to the current context. The notion of a contextual session is managed by some external entity (generally some form of interceptor like the HttpModule). This external manager is responsible for scoping these contextual sessions appropriately binding/unbinding them here for exposure to the application through calls. Defines the contract for implementations which know how to scope the notion of a current session. Implementations should adhere to the following: contain a constructor accepting a single argument of type should be thread safe should be fully serializable Implementors should be aware that they are also fully responsible for cleanup of any generated current-sessions. Note that there will be exactly one instance of the configured ICurrentSessionContext implementation per . It is recommended to inherit from the class whenever possible as it simplifies the implementation and provides single entry point with session binding support. Retrieve the current session according to the scoping defined by this implementation. The current session. Typically indicates an issue locating or creating the current session. Retrieve the current session according to the scoping defined by this implementation. The current session. Indicates an issue locating the current session. Binds the specified session to the current context. Returns whether there is a session bound to the current context. Unbinds and returns the current session. Gets or sets the currently bound session. Get the dicitonary mapping session factory to its current session. Set the map mapping session factory to its current session. Gets or sets the currently bound session. The key is the session factory and the value is the bound session. The key is the session factory and the value is the bound session. Provides a current session for each . Works only with Web Applications. A impl which scopes the notion of current session by the current thread of execution. Threads do not give us a nice hook to perform any type of cleanup making it questionable for this impl to actually generate Session instances. In the interest of usability, it was decided to have this default impl actually generate a session upon first request and then clean it up after the associated with that session is committed/rolled-back. In order for ensuring that happens, the sessions generated here are unusable until after {@link Session#beginTransaction()} has been called. If Close() is called on a session managed by this class, it will be automatically unbound.

Additionally, the static and methods are provided to allow application code to explicitly control opening and closing of these sessions. This, with some from of interception, is the preferred approach. It also allows easy framework integration and one possible approach for implementing long-sessions.

Unassociate a previously bound session from the current thread of execution. Provides a current session for each . Works only with web applications. Base class for implementations. An object-oriented representation of a query criterion that may be used as a constraint in a query. Built-in criterion types are provided by the Expression factory class. This interface might be implemented by application classes but, more commonly, application criterion types would extend AbstractCriterion. Render a SqlString fragment for the expression. A SqlString that contains a valid Sql fragment. Return typed values for all parameters in the rendered SQL fragment An array of TypedValues for the Expression. Gets a string representation of the . A String that shows the contents of the . This is not a well formed Sql fragment. It is useful for logging what the looks like. Render a SqlString for the expression. A SqlString that contains a valid Sql fragment. Return typed values for all parameters in the rendered SQL fragment An array of TypedValues for the Expression. See here for details: http://steve.emxsoftware.com/NET/Overloading+the++and++operators See here for details: http://steve.emxsoftware.com/NET/Overloading+the++and++operators See here for details: http://steve.emxsoftware.com/NET/Overloading+the++and++operators See here for details: http://steve.emxsoftware.com/NET/Overloading+the++and++operators An Aggregation A single-column projection that may be aliased Render the SQL Fragment. The criteria. The position. The criteria query. The enabled filters. Render the SQL Fragment to be used in the Group By Clause. The criteria. The criteria query. The enabled filters. Return types for a particular user-visible alias Get the SQL select clause column aliases for a particular user-visible alias Get the SQL select clause column aliases for a particular user-visible alias Gets the typed values for parameters in this projection The criteria. The criteria query. Get the user-visible aliases for this projection (ie. the ones that will be passed to the ResultTransformer) Does this projection specify grouping attributes? Gets the typed values for parameters in this projection The criteria. The criteria query. Gets the typed values for parameters in this projection The criteria. The criteria query. An that combines two s with an and between them. An that combines two s with a operator (either "and" or "or") between them. Initialize a new instance of the class that combines two other s. The to use in the Left Hand Side. The to use in the Right Hand Side. Combines the for the Left Hand Side and the Right Hand Side of the Expression into one array. An arry of s. Converts the LogicalExpression to a . A well formed SqlString for the Where clause. The SqlString will be enclosed by ( and ). Gets a string representation of the LogicalExpression. The String contains the LeftHandSide.ToString() and the RightHandSide.ToString() joined by the Op. This is not a well formed Sql fragment. It is useful for logging what Expressions are being combined. Gets the that will be on the Left Hand Side of the Op. Gets the that will be on the Right Hand Side of the Op. Get the Sql operator to put between the two s. Initializes a new instance of the class that combines two . The to use as the left hand side. The to use as the right hand side. Get the Sql operator to put between the two s. The string "and" An that represents a "between" constraint. Initializes a new instance of the class. The _projection. The _lo. The _hi. Initialize a new instance of the class for the named Property. The name of the Property of the Class. The low value for the BetweenExpression. The high value for the BetweenExpression. Casting a value from one type to another, at the database level An that Junctions together multiple s with an and A sequence of logical s combined by some associative logical operator. Adds an to the list of s to junction together. The to add. This instance. Get the Sql operator to put between multiple s. The corresponding to an instance with no added subcriteria. Get the Sql operator to put between multiple s. The string " and " This is useful if we want to send a value to the database A Count The alias that refers to the "root" entity of the criteria query. Each row of results is a from alias to entity instance Each row of results is an instance of the root entity Each row of results is a distinct instance of the root entity This result transformer is selected implicitly by calling Specifies joining to an entity based on an inner join. Specifies joining to an entity based on a full join. Specifies joining to an entity based on a left outer join. Some applications need to create criteria queries in "detached mode", where the Hibernate session is not available. This class may be instantiated anywhere, and then a ICriteria may be obtained by passing a session to GetExecutableCriteria(). All methods have the same semantics and behavior as the corresponding methods of the ICriteria interface. Get an executable instance of Criteria, to actually run the query. An that Junctions together multiple s with an or Get the Sql operator to put between multiple s. The string " or " Gets the typed values for parameters in this projection The criteria. The criteria query. An that represents an "equal" constraint between two properties. Superclass for an that represents a constraint between two properties (with SQL binary operators). Initializes a new instance of the class. The projection. Name of the RHS property. Initializes a new instance of the class. The LHS projection. The RHS projection. Initializes a new instance of the class. Name of the LHS property. Name of the RHS property. Initializes a new instance of the class. Name of the LHS property. The RHS projection. Get the Sql operator to use for the property expression. Initializes a new instance of the class. Name of the LHS property. The RHS projection. Initializes a new instance of the class. The LHS projection. The RHS projection. Initializes a new instance of the class. The projection. Name of the RHS property. Initializes a new instance of the class that compares two mapped properties using an "equal" constraint. The name of the Property to use as the left hand side. The name of the Property to use as the right hand side. Get the Sql operator to use for the . The string " = " Support for Query By Example. List results = session.CreateCriteria(typeof(Parent)) .Add( Example.Create(parent).IgnoreCase() ) .CreateCriteria("child") .Add( Example.Create( parent.Child ) ) .List(); "Examples" may be mixed and matched with "Expressions" in the same Set escape character for "like" clause Set the for this . The to determine which properties to include. This instance. This should be used when a custom has been implemented. Otherwise use the methods or to set the to the s built into NHibernate. Set the for this to exclude zero-valued properties. Set the for this to exclude no properties. Use the "like" operator for all string-valued properties with the specified . The to convert the string to the pattern for the like comparison. Use the "like" operator for all string-valued properties. The default is MatchMode.Exact. Exclude a particular named property The name of the property to exclude. Create a new instance, which includes all non-null properties by default A new instance of . Initialize a new instance of the class for a particular entity. The that the Example is being built from. The the Example should use. Determines if the property should be included in the Query. The value of the property. The name of the property. The of the property. if the Property should be included, if the Property should not be a part of the Query. Adds a based on the value and type parameters to the in the list parameter. The value of the Property. The of the Property. The to add the to. This method will add objects to the list parameter. A strategy for choosing property values for inclusion in the query criteria Determine if the Property should be included. The value of the property that is being checked for inclusion. The name of the property that is being checked for inclusion. The of the property. if the Property should be included in the Query, otherwise. Implementation of that includes all properties regardless of value. Implementation of that includes the properties that are not and do not have an returned by propertyValue.ToString(). This selector is not present in H2.1. It may be useful if nullable types are used for some properties. This class is semi-deprecated. Use . The namespace may be used by applications as a framework for building new kinds of . However, it is intended that most applications will simply use the built-in criterion types via the static factory methods of this class. Apply an "equal" constraint to the identifier property ICriterion Apply an "equal" constraint from the projection to the identifier property The projection. ICriterion Apply an "equal" constraint to the named property The name of the Property in the class. The value for the Property. Apply an "equal" constraint to the projection The projection. The value for the Property. Apply a "like" constraint to the named property The name of the Property in the class. The value for the Property. A . Apply a "like" constraint to the project The projection. The value for the Property. A . Apply a "like" constraint to the project The projection. The value for the Property. The match mode. A . A case-insensitive "like", similar to Postgres "ilike" operator The name of the Property in the class. The value for the Property. An . A case-insensitive "like", similar to Postgres "ilike" operator The projection. The value for the Property. An . Apply a "greater than" constraint to the named property The name of the Property in the class. The value for the Property. Apply a "greater than" constraint to the projection The projection. The value for the Property. Apply a "less than" constraint to the named property The name of the Property in the class. The value for the Property. Apply a "less than" constraint to the projection The projection. The value for the Property. Apply a "less than or equal" constraint to the named property The name of the Property in the class. The value for the Property. Apply a "less than or equal" constraint to the projection The projection. The value for the Property. Apply a "greater than or equal" constraint to the named property The name of the Property in the class. The value for the Property. Apply a "greater than or equal" constraint to the projection The projection. The value for the Property. Apply a "between" constraint to the named property The name of the Property in the class. The low value for the Property. The high value for the Property. A . Apply a "between" constraint to the projection The projection. The low value for the Property. The high value for the Property. A . Apply an "in" constraint to the named property The name of the Property in the class. An array of values. An . Apply an "in" constraint to the projection The projection. An array of values. An . Apply an "in" constraint to the projection The projection. An ICollection of values. An . Apply an "in" constraint to the named property The name of the Property in the class. An ICollection of values. An . Apply an "in" constraint to the named property. This is the generic equivalent of , renamed to avoid ambiguity. The name of the Property in the class. An of values. An . Apply an "in" constraint to the projection. This is the generic equivalent of , renamed to avoid ambiguity. The projection. An of values. An . Apply an "is null" constraint to the named property The name of the Property in the class. A . Apply an "is null" constraint to the projection The projection. A . Apply an "equal" constraint to two properties The lhs Property Name The rhs Property Name A . Apply an "equal" constraint to projection and property The projection. The rhs Property Name A . Apply an "equal" constraint to lshProjection and rshProjection The LHS projection. The RSH projection. A . Apply an "equal" constraint to the property and rshProjection Name of the property. The RSH projection. A . Apply an "not equal" constraint to two properties The lhs Property Name The rhs Property Name A . Apply an "not equal" constraint to projection and property The projection. The rhs Property Name A . Apply an "not equal" constraint to the projections The LHS projection. The RHS projection. A . Apply an "not equal" constraint to the projections Name of the property. The RHS projection. A . Apply a "greater than" constraint to two properties The lhs Property Name The rhs Property Name A . Apply a "greater than" constraint to two properties The projection. The rhs Property Name A . Apply a "greater than" constraint to two properties Name of the property. The projection. A . Apply a "greater than" constraint to two properties The LHS projection. The RHS projection. A . Apply a "greater than or equal" constraint to two properties The lhs Property Name The rhs Property Name A . Apply a "greater than or equal" constraint to two properties The LHS projection. The RHS projection. A . Apply a "greater than or equal" constraint to two properties The projection. The rhs Property Name A . Apply a "greater than or equal" constraint to two properties The lhs Property Name The projection. A . Apply a "less than" constraint to two properties The lhs Property Name The rhs Property Name A . Apply a "less than" constraint to two properties The projection. The rhs Property Name A . Apply a "less than" constraint to two properties The lhs Property Name The projection. A . Apply a "less than" constraint to two properties The LHS projection. The RHS projection. A . Apply a "less than or equal" constraint to two properties The lhs Property Name The rhs Property Name A . Apply a "less than or equal" constraint to two properties The projection. The rhs Property Name A . Apply a "less than or equal" constraint to two properties The lhs Property Name The projection. A . Apply a "less than or equal" constraint to two properties The LHS projection. The RHS projection. A . Apply an "is not null" constraint to the named property The name of the Property in the class. A . Apply an "is not null" constraint to the named property The projection. A . Apply an "is not empty" constraint to the named property The name of the Property in the class. A . Apply an "is not empty" constraint to the named property The name of the Property in the class. A . Return the conjuction of two expressions The Expression to use as the Left Hand Side. The Expression to use as the Right Hand Side. An . Return the disjuction of two expressions The Expression to use as the Left Hand Side. The Expression to use as the Right Hand Side. An . Return the negation of an expression The Expression to negate. A . Group expressions together in a single conjunction (A and B and C...) Group expressions together in a single disjunction (A or B or C...) Apply an "equals" constraint to each property in the key set of a IDictionary a dictionary from property names to values Apply a constraint expressed in SQL, with the given SQL parameters Apply a constraint expressed in SQL, with the given SQL parameter Apply a constraint expressed in SQL, with the given SQL parameter Apply a constraint expressed in SQL Apply a constraint expressed in SQL An that represents an "greater than or equal" constraint between two properties. Initializes a new instance of the class. Name of the LHS property. The RHS projection. Initializes a new instance of the class. The LHS projection. The RHS projection. Initializes a new instance of the class. The projection. Name of the RHS property. Initializes a new instance of the class that compares two mapped properties using an "greater than or equal" constraint. The name of the Property to use as the left hand side. The name of the Property to use as the right hand side. Get the Sql operator to use for the . The string " < " An that represents an "greater than" constraint between two properties. Initializes a new instance of the class. Name of the LHS property. The RHS projection. Initializes a new instance of the class. The LHS projection. The RHS projection. Initializes a new instance of the class. The projection. Name of the RHS property. Initializes a new instance of the class that compares two mapped properties using an "greater than" constraint. The name of the Property to use as the left hand side. The name of the Property to use as the right hand side. Get the Sql operator to use for the . The string " < " An identifier constraint An that constrains the property to a specified list of values. InExpression - should only be used with a Single Value column - no multicolumn properties... Initializes a new instance of the class. The projection. The _values. An that represents an "like" constraint that is not case sensitive. Initializes a new instance of the class. The projection. The value. The match mode. Initializes a new instance of the class. The projection. The _value. Initialize a new instance of the class for a named Property and its value. The name of the Property in the class. The value for the Property. An that represents empty association constraint. An that represents non-empty association constraint. An that represents an "less than or equal" constraint between two properties. Initializes a new instance of the class. Name of the LHS property. The RHS projection. Initializes a new instance of the class. The LHS projection. The RHS projection. Initializes a new instance of the class. The projection. Name of the RHS property. Initializes a new instance of the class that compares two mapped properties using an "less than or equal" constraint. The name of the Property to use as the left hand side. The name of the Property to use as the right hand side. Get the Sql operator to use for the . The string " <= " An that represents an "like" constraint. The case sensitivity depends on the database settings for string comparisons. Use if the string comparison should not be case sensitive. An that represents an "less than" constraint between two properties. Initializes a new instance of the class. Name of the LHS property. The RHS projection. Initializes a new instance of the class. The LHS projection. The RHS projection. Initializes a new instance of the class. The projection. Name of the RHS property. Initializes a new instance of the class that compares two mapped properties using an "less than" constraint. The name of the Property to use as the left hand side. The name of the Property to use as the right hand side. Get the Sql operator to use for the . The string " < " Represents an strategy for matching strings using "like". Initialize a new instance of the class. The code that identifies the match mode. The friendly name of the match mode. The parameter intCode is used as the key of to store instances and to ensure only instance of a particular is created. The string representation of the . The friendly name used to describe the . Convert the pattern, by appending/prepending "%" The string to convert to the appropriate match pattern. A that contains a "%" in the appropriate place for the Match Strategy. Match the entire string to the pattern Match the start of the string to the pattern Match the end of the string to the pattern Match the pattern anywhere in the string The that matches the entire string to the pattern. Initialize a new instance of the class. Converts the string to the Exact MatchMode. The string to convert to the appropriate match pattern. The pattern exactly the same as it was passed in. The that matches the start of the string to the pattern. Initialize a new instance of the class. Converts the string to the Start MatchMode. The string to convert to the appropriate match pattern. The pattern with a "%" appended at the end. The that matches the end of the string to the pattern. Initialize a new instance of the class. Converts the string to the End MatchMode. The string to convert to the appropriate match pattern. The pattern with a "%" appended at the beginning. The that exactly matches the string by appending "%" to the beginning and end. Initialize a new instance of the class. Converts the string to the Exact MatchMode. The string to convert to the appropriate match pattern. The pattern with a "%" appended at the beginning and the end. An that negates another . Initialize a new instance of the class for an The to negate. An that represents "not null" constraint. Initializes a new instance of the class. The projection. Initialize a new instance of the class for a named Property that should not be null. The name of the Property in the class. An that represents "null" constraint. Initializes a new instance of the class. The projection. Initialize a new instance of the class for a named Property that should be null. The name of the Property in the class. Represents an order imposed upon a result set. Constructor for Order. Render the SQL fragment Ascending order Descending order An that combines two s with an "or" between them. Initialize a new instance of the class for two s. The to use as the left hand side. The to use as the right hand side. Get the Sql operator to put between the two s. Returns "or" Gets the typed values for parameters in this projection The criteria. The criteria query. The criterion package may be used by applications as a framework for building new kinds of Projection. However, it is intended that most applications will simply use the built-in projection types via the static factory methods of this class.

The factory methods that take an alias allow the projected value to be referred to by criterion and order instances.
Create a distinct projection from a projection Create a new projection list The query row count, ie. count(*) The RowCount projection mapped to an . The query row count, ie. count(*) The RowCount projection mapped to an . A property value count A distinct property value count A property maximum value A property minimum value A property average value A property value sum A SQL projection, a typed select clause fragment A grouping SQL projection, specifying both select clause and group by clause fragments A grouping property value A projected property value A projected identifier value Assign an alias to a projection, by wrapping it Casts the projection result to the specified type. The type. The projection. Return a constant value The obj. Calls the named Name of the function. The type. The projections. Calls the specified the function. The type. The projections. Conditionally return the true or false part, dependention on the criterion The criterion. The when true. The when false. A factory for property-specific AbstractCriterion and projection instances A property value, or grouped property value Get a component attribute of this property A comparison between a property value in the outer query and the result of a subquery The base class for an that compares a single Property to a value. Initialize a new instance of the class for a named Property and its value. The name of the Property in the class. The value for the Property. The SQL operation. Converts the SimpleExpression to a . A SqlString that contains a valid Sql fragment. Gets the named Property for the Expression. A string that is the name of the Property. Gets the Value for the Expression. An object that is the value for the Expression. Get the Sql operator to use for the specific subclass of . A comparison between a constant value and the the result of a subquery An that creates a SQLExpression. The string {alias} will be replaced by the alias of the root entity. This allows for database specific Expressions at the cost of needing to write a correct . A SQL fragment. The string {alias} will be replaced by the alias of the root entity. Gets the typed values for parameters in this projection The criteria. The criteria query. Factory class for AbstractCriterion instances that represent involving subqueries. Expression Projection AbstractCriterion Used to show a better debug display for dictionaries ::= EXTRACT FROM ::= | Represents HQL functions that can have different representations in different SQL dialects. E.g. in HQL we can define function concat(?1, ?2) to concatenate two strings p1 and p2. Target SQL function will be dialect-specific, e.g. (?1 || ?2) for Oracle, concat(?1, ?2) for MySql, (?1 + ?2) for MS SQL. Each dialect will define a template as a string (exactly like above) marking function parameters with '?' followed by parameter's index (first index is 1). Provides support routines for the HQL functions as used in the various SQL Dialects Provides an interface for supporting various HQL functions that are translated to SQL. The Dialect and its sub-classes use this interface to provide details required for processing of the function. The function return type The type of the first argument Render the function call as SQL. List of arguments SQL fragment for the fuction. Does this function have any arguments? If there are no arguments, are parens required? Applies the template to passed in arguments. args function arguments generated SQL function call ANSI-SQL substring Documented in: ANSI X3.135-1992 American National Standard for Information Systems - Database Language - SQL Syntax: ::= SUBSTRING FROM < start position> [ FOR ] ]]> A SQLFunction implementation that emulates the ANSI SQL trim function on dialects which do not support the full definition. However, this function definition does assume the availability of ltrim, rtrim, and replace functions which it uses in various combinations to emulate the desired ANSI trim() functionality. according to both the ANSI-SQL and EJB3 specs, trim can either take exactly one parameter or a variable number of parameters between 1 and 4. from the SQL spec: ::= TRIM ::= [ [ ] [ ] FROM ] ::= LEADING | TRAILING | BOTH ]]> If only trim specification is omitted, BOTH is assumed; if trim character is omitted, space is assumed ANSI-SQL style cast(foo as type) where the type is a NHibernate type Emulation of locate() on Sybase Initializes a new instance of the StandardSQLFunction class. SQL function name. Whether the function accepts an asterisk (*) in place of arguments Initializes a new instance of the StandardSQLFunction class. SQL function name. True if accept asterisk like argument Return type for the fuction. Classic AVG sqlfunction that return types as it was done in Hibernate 3.1 Classic COUNT sqlfunction that return types as it was done in Hibernate 3.1 Classic SUM sqlfunction that return types as it was done in Hibernate 3.1 Summary description for NoArgSQLFunction. Emulation of coalesce() on Oracle, using multiple nvl() calls Emulation of locate() on PostgreSQL Provides a standard implementation that supports the majority of the HQL functions that are translated to SQL. The Dialect and its sub-classes use this class to provide details required for processing of the associated function. Provides a standard implementation that supports the majority of the HQL functions that are translated to SQL. The Dialect and its sub-classes use this class to provide details required for processing of the associated function. Initializes a new instance of the StandardSQLFunction class. SQL function name. Initializes a new instance of the StandardSQLFunction class. SQL function name. Return type for the fuction. Initializes a new instance of the StandardSafeSQLFunction class. SQL function name. Exact number of arguments expected. Initializes a new instance of the StandardSafeSQLFunction class. SQL function name. Return type for the fuction. Exact number of arguments expected. Support for slightly more general templating than StandardSQLFunction, with an unlimited number of arguments. A strategy abstraction for how locks are obtained in the underlying database. All locking provided implemenations assume the underlying database supports (and that the connection is in) at least read-committed transaction isolation. The most glaring exclusion to this is HSQLDB which only offers support for READ_UNCOMMITTED isolation. Acquire an appropriate type of lock on the underlying data that will endure until the end of the current transaction. The id of the row to be locked The current version (or null if not versioned) The object logically being locked (currently not used) The session from which the lock request originated A locking strategy where the locks are obtained through select statements. For non-read locks, this is achieved through the Dialect's specific SELECT ... FOR UPDATE syntax. A locking strategy where the locks are obtained through update statements. This strategy is not valid for read style locks. Construct a locking strategy based on SQL UPDATE statements. The metadata for the entity to be locked. Indictates the type of lock to be acquired. read-locks are not valid for this strategy. An SQL dialect for DB2 on iSeries OS/400. The DB2400Dialect defaults the following configuration properties: Property Default Value connection.driver_class An SQL dialect for DB2. The DB2Dialect defaults the following configuration properties: Property Default Value connection.driver_class Represents a dialect of SQL implemented by a particular RDBMS. Subclasses implement NHibernate compatibility with different systems. Subclasses should provide a public default constructor that Register() a set of type mappings and default Hibernate properties. Characters used for quoting sql identifiers The base constructor for Dialect. Every subclass should override this and call Register() with every except , , , , , . The Default properties for this Dialect should also be set - such as whether or not to use outer-joins and what the batch size should be. Get an instance of the dialect specified by the current properties. The specified Dialect Get de from a property bag (prop name ) The property bag. An instance of . When is null. When the property bag don't contains de property . Get the name of the database type associated with the given , The SqlType The database type name used by ddl. Get the name of the database type associated with the given . The SqlType The datatype length The datatype precision The datatype scale The database type name used by ddl. Get the name of the database type appropriate for casting operations (via the CAST() SQL function) for the given typecode. The typecode The database type name Subclasses register a typename for the given type code and maximum column length. $l in the type name will be replaced by the column length (if appropriate) The typecode Maximum length of database type The database type name Suclasses register a typename for the given type code. $l in the typename will be replaced by the column length (if appropriate). The typecode The database type name Get the name of the Hibernate associated with th given typecode. The typecode The Hibernate name. Get the name of the Hibernate associated with the given typecode with the given storage specification parameters. The typecode The datatype length The datatype precision The datatype scale The Hibernate name. Registers a Hibernate name for the given type code and maximum column length. The typecode The maximum length of database type The Hibernate name Registers a Hibernate name for the given type code. The typecode The Hibernate name The syntax used to add a foreign key constraint to a table. The FK constraint name. The names of the columns comprising the FK The table referenced by the FK The explicit columns in the referencedTable referenced by this FK. if false, constraint should be explicit about which column names the constraint refers to the "add FK" fragment The syntax used to add a primary key constraint to a table Get a strategy instance which knows how to acquire a database-level lock of the specified mode for this dialect. The persister for the entity to be locked. The type of lock to be acquired. The appropriate locking strategy. Given a lock mode, determine the appropriate for update fragment to use. The lock mode to apply. The appropriate for update fragment. Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked. The columns to be write locked. The appropriate FOR UPDATE OF column_list clause string. Get the FOR UPDATE OF column_list NOWAIT fragment appropriate for this dialect given the aliases of the columns to be write locked. The columns to be write locked. The appropriate FOR UPDATE colunm_list NOWAIT clause string. Modifies the given SQL by applying the appropriate updates for the specified lock modes and key columns. the SQL string to modify a map of lock modes indexed by aliased table names. a map of key columns indexed by aliased table names. the modified SQL string. The behavior here is that of an ANSI SQL SELECT FOR UPDATE. This method is really intended to allow dialects which do not support SELECT FOR UPDATE to achieve this in their own fashion. Some dialects support an alternative means to SELECT FOR UPDATE, whereby a "lock hint" is appends to the table name in the from clause. The lock mode to apply The name of the table to which to apply the lock hint. The table with any required lock hints. Return SQL needed to drop the named table. May (and should) use some form of "if exists" clause, and cascade constraints. Generate a temporary table name given the bas table. The table name from which to base the temp table name. The generated temp table name. Does the dialect require that temporary table DDL statements occur in isolation from other statements? This would be the case if the creation would cause any current transaction to get committed implicitly. see the result matrix above. JDBC defines a standard way to query for this information via the {@link java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()} method. However, that does not distinguish between temporary table DDL and other forms of DDL; MySQL, for example, reports DDL causing a transaction commit via its driver, even though that is not the case for temporary table DDL.

Possible return values and their meanings:

  • {@link Boolean#TRUE} - Unequivocally, perform the temporary table DDL in isolation.
  • {@link Boolean#FALSE} - Unequivocally, do not perform the temporary table DDL in isolation.
  • null - defer to the JDBC driver response in regards to {@link java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()}
Do we need to drop the temporary table after use? Registers an OUT parameter which will be returing a . How this is accomplished varies greatly from DB to DB, hence its inclusion (along with {@link #getResultSet}) here. The callable statement. The bind position at which to register the OUT param. The number of (contiguous) bind positions used. Given a callable statement previously processed by , extract the from the OUT parameter. The callable statement. The extracted result set. SQLException Indicates problems extracting the result set. The syntax used to drop a foreign key constraint from a table. The name of the foreign key constraint to drop. The SQL string to drop the foreign key constraint. The syntax that is used to check if a constraint does not exists before creating it The table. The name. The syntax that is used to close the if for a constraint exists check, used for dialects that requires begin/end for ifs The table. The name. The syntax that is used to check if a constraint exists before dropping it The table. The name. The syntax that is used to close the if for a constraint exists check, used for dialects that requires begin/end for ifs The table. The name. The syntax used to drop a primary key constraint from a table. The name of the primary key constraint to drop. The SQL string to drop the primary key constraint. The syntax used to drop an index constraint from a table. The name of the index constraint to drop. The SQL string to drop the primary key constraint. Provided we , then attch the "select identity" clause to the insert statement. The insert command The insert command with any necessary identity select clause attached. Note, if == false then the insert-string should be returned without modification. Get the select command to use to retrieve the last generated IDENTITY value for a particuar table The table into which the insert was done The PK column. The type code. The appropriate select command The syntax used during DDL to define a column as being an IDENTITY of a particular type. The type code. The appropriate DDL fragment. Generate the appropriate select statement to to retreive the next value of a sequence. the name of the sequence String The "nextval" select string. This should be a "stand alone" select statement. Typically dialects which support sequences can drop a sequence with a single command. The name of the sequence The sequence drop commands This is convenience form of to help facilitate that. Dialects which support sequences and can drop a sequence in a single command need *only* override this method. Dialects which support sequences but require multiple commands to drop a sequence should instead override . The multiline script used to drop a sequence. The name of the sequence The sequence drop commands Generate the select expression fragment that will retreive the next value of a sequence as part of another (typically DML) statement. the name of the sequence The "nextval" fragment. This differs from in that this should return an expression usable within another statement. Typically dialects which support sequences can create a sequence with a single command. The name of the sequence The sequence creation command This is convenience form of to help facilitate that. Dialects which support sequences and can create a sequence in a single command need *only* override this method. Dialects which support sequences but require multiple commands to create a sequence should instead override . An optional multi-line form for databases which . The name of the sequence The initial value to apply to 'create sequence' statement The increment value to apply to 'create sequence' statement The sequence creation commands Overloaded form of , additionally taking the initial value and increment size to be applied to the sequence definition. The name of the sequence The initial value to apply to 'create sequence' statement The increment value to apply to 'create sequence' statement The sequence creation command The default definition is to suffix with the string: " start with {initialValue} increment by {incrementSize}" where {initialValue} and {incrementSize} are replacement placeholders. Generally dialects should only need to override this method if different key phrases are used to apply the allocation information. Create a strategy responsible for handling this dialect's variations in how joins are handled. This dialect's strategy. Create a strategy responsible for handling this dialect's variations in how CASE statements are handled. This dialect's strategy. The SQL literal value to which this database maps boolean values. The boolean value The appropriate SQL literal. Add a LIMIT clause to the given SQL SELECT A Query in the form of a SqlString. Offset of the first row to be returned by the query (zero-based) Maximum number of rows to be returned by the query A new SqlString that contains the LIMIT clause. Apply s limit clause to the query. The query to which to apply the limit. Is the query requesting an offset? the modified SQL Typically dialects utilize limit caluses when they support limits. Thus, when building the select command we do not actually need to know the limit or the offest since we will just be using placeholders.

Here we do still pass along whether or not an offset was specified so that dialects not supporting offsets can generate proper exceptions. In general, dialects will override one or the other of this method and .

Checks to see if the name has been quoted. The name to check if it is quoted true if name is already quoted. The default implementation is to compare the first character to Dialect.OpenQuote and the last char to Dialect.CloseQuote
Quotes a name. The string that needs to be Quoted. A QuotedName

This method assumes that the name is not already Quoted. So if the name passed in is "name then it will return """name". It escapes the first char - the " with "" and encloses the escaped string with OpenQuote and CloseQuote.

Quotes a name for being used as a aliasname Original implementation calls Name of the alias A Quoted name in the format of OpenQuote + aliasName + CloseQuote

If the aliasName is already enclosed in the OpenQuote and CloseQuote then this method will return the aliasName that was passed in without going through any Quoting process. So if aliasName is passed in already Quoted make sure that you have escaped all of the chars according to your DataBase's specifications.

Quotes a name for being used as a columnname Original implementation calls Name of the column A Quoted name in the format of OpenQuote + columnName + CloseQuote

If the columnName is already enclosed in the OpenQuote and CloseQuote then this method will return the columnName that was passed in without going through any Quoting process. So if columnName is passed in already Quoted make sure that you have escaped all of the chars according to your DataBase's specifications.

Quotes a name for being used as a tablename Name of the table A Quoted name in the format of OpenQuote + tableName + CloseQuote

If the tableName is already enclosed in the OpenQuote and CloseQuote then this method will return the tableName that was passed in without going through any Quoting process. So if tableName is passed in already Quoted make sure that you have escaped all of the chars according to your DataBase's specifications.

Quotes a name for being used as a schemaname Name of the schema A Quoted name in the format of OpenQuote + schemaName + CloseQuote

If the schemaName is already enclosed in the OpenQuote and CloseQuote then this method will return the schemaName that was passed in without going through any Quoting process. So if schemaName is passed in already Quoted make sure that you have escaped all of the chars according to your DataBase's specifications.

Unquotes and unescapes an already quoted name Quoted string Unquoted string

This method checks the string quoted to see if it is quoted. If the string quoted is already enclosed in the OpenQuote and CloseQuote then those chars are removed.

After the OpenQuote and CloseQuote have been cleaned from the string quoted then any chars in the string quoted that have been escaped by doubling them up are changed back to a single version.

The following quoted values return these results "quoted" = quoted "quote""d" = quote"d quote""d = quote"d

If this implementation is not sufficient for your Dialect then it needs to be overridden. MsSql2000Dialect is an example of where UnQuoting rules are different.

Unquotes an array of Quoted Names. strings to Unquote an array of unquoted strings. This use UnQuote(string) for each string in the quoted array so it should not need to be overridden - only UnQuote(string) needs to be overridden unless this implementation is not sufficient. Given a type code, determine an appropriate null value to use in a select clause. The type code. The appropriate select clause value fragment. One thing to consider here is that certain databases might require proper casting for the nulls here since the select here will be part of a UNION/UNION ALL. Build an instance of the preferred by this dialect for converting into NHibernate's ADOException hierarchy. The Dialect's preferred . The default Dialect implementation simply returns a converter based on X/Open SQLState codes. It is strongly recommended that specific Dialect implementations override this method, since interpretation of a SQL error is much more accurate when based on the ErrorCode rather than the SQLState. Unfortunately, the ErrorCode is a vendor-specific approach. Retrieve a set of default Hibernate properties for this database. Aggregate SQL functions as defined in general. This is a case-insensitive hashtable! The results of this method should be integrated with the specialization's data. The class (which implements ) which acts as this dialects native generation strategy. The native generator class. Comes into play whenever the user specifies the native generator. The keyword used to insert a generated value into an identity column (or null). Need if the dialect does not support inserts that specify no column values. Get the select command used retrieve the names of all sequences. The select command; or null if sequences are not supported. Get the command used to select a GUID from the underlying database. (Optional operation.) The appropriate command. Command used to create a table. Slight variation on . The command used to create a multiset table. Here, we have the command used to create a table when there is no primary key and duplicate rows are expected.

Most databases do not care about the distinction; originally added for Teradata support which does care.

Command used to create a temporary table.
Get any fragments needing to be postfixed to the command for temporary table creation. Should the value returned by be treated as callable. Typically this indicates that JDBC escape sytnax is being used... Retrieve the command used to retrieve the current timestammp from the database. The name of the database-specific SQL function for retrieving the current timestamp. The keyword used to insert a row without specifying any column values The name of the SQL function that transforms a string to lowercase The syntax used to add a column to a table. Note this is deprecated The keyword used to specify a nullable column Completely optional cascading drop clause Does this dialect support the ALTER TABLE syntax? Do we need to drop constraints before dropping tables in the dialect? Do we need to qualify index names with the schema name? Does this dialect support the UNIQUE column syntax? Does this dialect support adding Unique constraints via create and alter table ? Does the dialect support the syntax 'drop table if exists NAME' Does the dialect support the syntax 'drop table NAME if exists' Does this dialect support column-level check constraints? True if column-level CHECK constraints are supported; false otherwise. Does this dialect support table-level check constraints? True if table-level CHECK constraints are supported; false otherwise. Get the string to append to SELECT statements to acquire locks for this dialect. The appropriate FOR UPDATE clause string. Is FOR UPDATE OF syntax supported? True if the database supports FOR UPDATE OF syntax; false otherwise. Does this dialect support FOR UPDATE in conjunction with outer joined rows? True if outer joined rows can be locked via FOR UPDATE. Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect The appropriate FOR UPDATE NOWAIT clause string. Does this dialect support temporary tables? Does this dialect support a way to retrieve the database's current timestamp value? Gives the best resolution that the database can use for storing date/time values, in ticks. For example, if the database can store values with 100-nanosecond precision, this property is equal to 1L. If the database can only store values with 1-millisecond precision, this property is equal to 10000L (number of ticks in a millisecond). Used in TimestampType. Does this dialect support subselects? How we seperate the queries when we use multiply queries. Does this dialect support identity column key generation? Does the dialect support some form of inserting and selecting the generated IDENTITY value all in the same statement. Whether this dialect has an identity clause added to the data type or a completely seperate identity data type. Get the select command to use to retrieve the last generated IDENTITY value. The appropriate select command The keyword used to specify an identity column, if native key generation is supported Does this dialect support sequences? Does this dialect support "pooled" sequences. Not aware of a better name for this. Essentially can we specify the initial and increment values? True if such "pooled" sequences are supported; false otherwise. Does this Dialect have some kind of LIMIT syntax? False, unless overridden. Does this Dialect support an offset? Can parameters be used for a statement containing a LIMIT? Does the LIMIT clause specify arguments in the "reverse" order limit, offset instead of offset, limit? False, unless overridden. Inheritors should return true if the correct order is limit, offset Does the LIMIT clause come at the start of the SELECT statement rather than at the end? false, unless overridden Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows? True if limit is relative from offset; false otherwise. This is easiest understood via an example. Consider you have a table with 20 rows, but you only want to retrieve rows number 11 through 20. Generally, a limit with offset would say that the offset = 11 and the limit = 10 (we only want 10 rows at a time); this is specifying the total number of returned rows. Some dialects require that we instead specify offset = 11 and limit = 20, where 20 is the "last" row we want relative to offset (i.e. total number of rows = 20 - 11 = 9) So essentially, is limit relative from offset? Or is limit absolute? The opening quote for a quoted identifier. The closing quote for a quoted identifier. Does this dialect support UNION ALL, which is generally a faster variant of UNION? True if UNION ALL is supported; false otherwise. Does this dialect support empty IN lists? For example, is [where XYZ in ()] a supported construct? True if empty in lists are supported; false otherwise. Are string comparisons implicitly case insensitive. In other words, does [where 'XYZ' = 'xyz'] resolve to true? True if comparisons are case insensitive. Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax.

Basically, does it support syntax like "... where (FIRST_NAME, LAST_NAME) = ('Steve', 'Ebersole') ...".

True if this SQL dialect is known to support "row value constructor" syntax; false otherwise.
If the dialect supports {@link #supportsRowValueConstructorSyntax() row values}, does it offer such support in IN lists as well?

For example, "... where (FIRST_NAME, LAST_NAME) IN ( (?, ?), (?, ?) ) ..."

True if this SQL dialect is known to support "row value constructor" syntax in the IN list; false otherwise.
Should LOBs (both BLOB and CLOB) be bound using stream operations (i.e. {@link java.sql.PreparedStatement#setBinaryStream}). True if BLOBs and CLOBs should be bound using stream operations. Does this dialect support parameters within the select clause of INSERT ... SELECT ... statements? True if this is supported; false otherwise. Does this dialect support asking the result set its positioning information on forward only cursors. Specifically, in the case of scrolling fetches, Hibernate needs to use {@link java.sql.ResultSet#isAfterLast} and {@link java.sql.ResultSet#isBeforeFirst}. Certain drivers do not allow access to these methods for forward only cursors.

NOTE : this is highly driver dependent!

True if methods like {@link java.sql.ResultSet#isAfterLast} and {@link java.sql.ResultSet#isBeforeFirst} are supported for forward only cursors; false otherwise.
Does this dialect support definition of cascade delete constraints which can cause circular chains? True if circular cascade delete constraints are supported; false otherwise. Are subselects supported as the left-hand-side (LHS) of IN-predicates. In other words, is syntax like "... {subquery} IN (1, 2, 3) ..." supported?