Available Output Settings

The following settings are available for NHibernate. There are two sections, one for the global defaults, which you can edit in the Project Settings Editor of the designer, and one which discusses the settings available per element, and which default setting sets their default value. This way you can easily track which default to set for which element setting.

Defaults

The following default settings and attributes are available, which control the default value for settings available per element.

Settings

These settings are edited using the Project Properties Editor, Output Setting Values tab.

CacheUsageDefault
This setting specifies the default for the cache usage setting for entity mappings. Default is 'no-caching'
CacheRegionDefault
This setting specifies the default for the cache region setting for entity mappings. Default is "", which within NHibernate defaults to the entity name
CollectionNavigatorCascadeTypeDefault

The cascade attribute to set for navigator mappings which represent a set/collection. Default value: all-delete-orphan

CollectionTypeDefault

This setting specifies the default collection type to use for navigators which represent a set (e.g. Customer.Orders). Default value: set.

CustomGeneratorTypeToUseDefault

This setting specifies the default for the CustomGeneratorTypeToUse setting of entity fields. It's the custom generator type to use for entity fields which have their UseCustomGenerator setting set to true. 'seqhilo' is only available on RDBMSs which support Oracle style sequences (DB2, Postgresql, Oracle). If 'seqhilo' is chosen and a database type is used which doesn't support Oracle-style sequences, 'hilo' is used and the settings related to 'hilo'.

CustomGeneratorIntervalSizeDefault

This setting specifies the default for the CustomGeneratorIntervalSize setting of entity fields. It's the size of the set of values to obtain from the generator. Setting this to 0 or 1 makes using the generator inefficient. When setting it to -1, the interval size isn't emitted into the output and the NHibernate default is used (32K).

CustomGeneratorHiLoFieldDefault

This setting specifies the default for the CustomGeneratorHiLoField setting of entity fields. It's the field in the table specified in the setting CustomGeneratorHiLoTable which contains the value for the custom generator. Used when CustomGeneratorToUse is set to 'hilo'.

CustomGeneratorHiLoTableDefault

This setting specifies the default for the CustomGeneratorHiLoTable setting of entity fields. It's the table to use by NHibernate for storing the custom generator values. Used when CustomGeneratorToUse is set to 'hilo'. If you use a custom generator for a field, be sure the table specified exists and has at least one row. Don't use name wrapping characters like [], these are added automatically. Name is considered case sensitive.

CustomGeneratorHiLoTableSchemaDefault

This setting specifies the default for the CustomGeneratorHiLoTableSchema setting of entity fields. If specified, it's the schema in which the table specified in CustomGeneratorHiLoTable is located. Used when CustomGeneratorToUse is set to 'hilo'. If not specified, the schema of the target of the entity with the field using the custom generator is used as the schema for the table specification. Don't use name wrapping characters like [], these are added automatically. Name is considered case sensitive.

CustomGeneratorSeqHiLoSequenceDefault

This setting specifies the default for the CustomGeneratorSeqHiLoSequence setting of entity fields. It's the sequence name to use by NHibernate for storing the custom generator values. Used when CustomGeneratorToUse is set to 'seqhilo'. 'seqhilo' is only supported on databases with sequences, e.g. Oracle, DB2 and Postgresql. Don't use name wrapping characters like [], these are added automatically. Name is considered case sensitive.

CustomGeneratorSeqHiLoSequenceSchemaDefault

This setting specifies the default for the CustomGeneratorSeqHiLoSequenceSchema setting of entity fields. If specified, it's the schema in which the sequence specified in CustomGeneratorSeqHiLoSequence is located. Used when CustomGeneratorToUse is set to 'seqhilo'. If not specified, the schema of the target of the entity with the field using the custom generator is used as the schema for the sequence specification. Don't use name wrapping characters like [], these are added automatically. Name is considered case sensitive.

EmitFieldSetterDefault

This setting specifies the default for the EmitFieldSetter setting for fields, whether the code generator should emit setters in properties representing fields (true, default) or not (false). Default value: true

EmitCatalogNameInMappings

This setting controls whether the catalog name is emitted into the mappings or not.

EmitSchemaNameInMappings

This setting controls whether the schema name is emitted into the mappings or not. Ignored if EmitCatalogNameInMappings is set to true.

EmitKnownTypeAttributesForWCFDefault

This setting specifies the default value for the EmitKnownTypeAttributesForWCF setting of an entity. Default value: false

EmitNavigatorSetterDefault

This setting specifies the default for the EmitNavigatorSetter setting for navigators, whether the code generator should emit setters in properties representing navigators (true, default) or not (false). Default value: true

EntityBaseClassNameDefault

This setting specifies the default value for the EntityBaseClassName setting of an entity. Default value: empty string

EntityOptimisticLockTypeDefault

This setting specifies the default for the OptimisticLockType setting for entities. Default value: version

FetchStrategyForCollectionNavigatorsDefault

This setting specifies the default for the FetchStrategy setting for navigators which represent a set/collection. Default value: select

FetchStrategyForSingleEntityNavigatorsDefault

This setting specifies the default for the FetchStrategy setting for navigators which represent a single entity. Default value: select

PropertyAccessModifierDefault

This setting specifies the default property access modifier for properties representing fields, navigators and fields mapped onto related fields. Default value: public

SingleEntityNavigatorCascadeTypeDefault

The cascade attribute to set for navigator mappings which represent a single entity. Default value: none

TypedListRowBaseClassNameDefault

This setting specifies the default value for the TypedListRowBaseClassName setting of a typed list. Default value: empty string

TypedViewRowBaseClassNameDefault

This setting specifies the default value for the TypedViewRowBaseClassName setting of a typed view. Default value: empty string

UseDynamicInsertsForEntitiesDefault

This setting specifies the default for the UseDynamicInserts setting for entities, which controls the dynamic-inert mapping element for entity classes. Default value: false

UseDynamicUpdatesForEntitiesDefault

This setting specifies the default for the UseDynamicUpdates setting for entities, which controls the dynamic-update mapping element for entity classes. Default value: false

UseLazyLoadingForSingleEntityNavigatorsDefault

This setting specifies the default for the UseLazyLoading setting for navigators which represent a single entity. Default value: true

ValueTypeBaseClassNameDefault

This setting specifies the default value for the ValueTypeBaseClassName setting of a value type. Default value: empty string

Element Settings

The following settings are available per element. These settings are edited on the element's own editor (or the containing element's editor, in the case where the element itself doesn't have a separate editor) on the Code-gen info tab, or on the Project Settings Editor, if the element is the project.

Entity definition settings

CacheUsage
This setting specifies the cache strategy for the entity mapping. Sub-types inherit their cache usage value from their super-types. Default value: the value of the default CacheUsageDefault
CacheRegion
This setting specifies the name of the second level cache region for the entity mapping. If Cache Usage is set to 'no-caching', this value is ignored.
EntityBaseClassName

The name of the base class for a generated entity class. The following macros are available: {$Name} for the entity name without group name, {$GroupName} for the name of the group the entity is in, {$FullName} for the group name plus entity name. Sub-types will always inherit from their super-type and not from the class specified. Default value: the value of the default EntityBaseClassNameDefault.

UseDynamicInserts

This setting specifies the value for the 'dynamic-insert' mapping element. Default value: the value of the default UseDynamicInsertsForEntitiesDefault

UseDynamicUpdates

This setting specifies the value for the 'dynamic-update' mapping element. Default value: the value of the default UseDynamicUpdatesForEntitiesDefault

UseExplicitPolymorphism

This setting specifies whether implicit polymorphism (false, default) or explicit polymorphism (true) should be used for this entity. Set this setting to true for entities which have to be fetched without the subclasses they might define. Default value: false

UseLazyLoading

This setting specifies whether lazy loading (true, default) should be used or not, when the entity is on the 'one' side of a relationship. Default value: the value of the default UseLazyLoadingForSingleEntityNavigatorsDefault

OptimisticLockType

This setting specifies the optimistic-lock value for this entity. When choosing 'version' (the default), be sure you select a field in this entity for versioning. Ignored on subtypes Default value: the value of the default EntityOptimisticLockTypeDefault

Field (Entity / Value type) settings

CustomGeneratorTypeToUse

The custom generator type to use for entity fields which have their UseCustomGenerator setting set to true. 'seqhilo' is only available on RDBMSs which support Oracle style sequences (DB2, Postgresql, Oracle). If 'seqhilo' is chosen and a database type is used which doesn't support Oracle-style sequences, 'hilo' is used and the settings related to 'hilo'

CustomGeneratorIntervalSize

The size of the set of values to obtain from the generator. Setting this to 0 or 1 makes using the generator inefficient. When setting it to -1, the interval size isn't emitted into the output and the NHibernate default is used (32K).

CustomGeneratorHiLoTable

The table to use by NHibernate for storing the custom generator values. Used when CustomGeneratorToUse is set to 'hilo'. If you use a custom generator for a field, be sure the table specified exists and has at least one row. Don't use name wrapping characters like [], these are added automatically. Name is considered case sensitive.

CustomGeneratorHiLoTableSchema

If specified, the schema in which the table specified in CustomGeneratorHiLoTable is located. Used when CustomGeneratorToUse is set to 'hilo'. If not specified, the schema of the target of this entity is used as the schema for the table specification. Don't use name wrapping characters like [], these are added automatically. Name is considered case sensitive.

CustomGeneratorHiLoField

The field in the table specified in the setting CustomGeneratorHiLoTable which contains the value for the custom generator. Used when CustomGeneratorToUse is set to 'hilo'

CustomGeneratorSeqHiLoSequence

The sequence name to use by NHibernate for storing the custom generator values. Used when CustomGeneratorToUse is set to 'seqhilo'. 'seqhilo' is only supported on databases with sequences, e.g. Oracle, DB2 and Postgresql. Don't use name wrapping characters like [], these are added automatically. Name is considered case sensitive.

CustomGeneratorSeqHiLoSequenceSchema

If specified, the schema in which the sequence specified in CustomGeneratorSeqHiLoSequence is located. Used when CustomGeneratorToUse is set to 'seqhilo'. If not specified, the schema of the target of this entity is used as the schema for the sequence specification. Don't use name wrapping characters like [], these are added automatically. Name is considered case sensitive.

EmitFieldSetter

This setting controls whether the code generator should emit setters in properties representing fields (true, default) or not (false)

PropertyAccessModifier

Setting which controls the access modifier for the generated property

UseAsVersionField

This setting controls whether this field should be used as a version field (true) or not (false, default). Only one version field per entity, all others are ignored for versioning. When using a field for versioning, be sure to set the OptimisticLockType for the entity to 'version' (default).

UseCustomGenerator

Setting which controls for Identifying numeric fields if the Custom generator specified in the 'output setting values' of the project properties has to be used (true) or not (false, default). If a sequence is specified for the field, it will take precedence over the custom generator. Ignored on non-identifying fields and identifying fields which have a non-numeric type.

EmitNavigatorSetter

This setting controls whether the code generator should emit setters in properties representing navigators (true, default) or not (false). Default value: the value of the default EmitNavigatorSetterDefault

FetchStrategy

This setting specifies whether the collection represented by this navigator should be fetched using a new 'select' (default) or by an outer-join ('join'). Although 'select' is the default, it might cause SELECT N+1 problems. Join always fetches the related data. Default value: the value of the default FetchStrategyForSingleEntityNavigatorsDefault.

SingleEntityNavigatorCascadeType

The cascade value to set for this navigator. Default value: the value of the default SingleEntityNavigatorCascadeTypeDefault.

CollectionNavigatorCascadeType

The cascade value to set for this navigator. Default value: the value of the default: CollectionNavigatorCascadeTypeDefault

CollectionType

This setting specifies the collection type to use for navigators which represent a set (e.g. Customer.Orders). Default value: the value of the default: CollectionTypeDefault

FetchStrategy

This setting specifies whether the collection represented by this navigator should be fetched using a new 'select' (default) or by an outer-join ('join'). Although 'select' is the default, it might cause SELECT N+1 problems. Join always fetches the related data. Default value: the value of the default: FetchStrategyForCollectionNavigatorsDefault

UseLazyLoading

This setting specifies whether lazy loading (true, default) should be used or eager loading (false). Default value: the value of the default: UseLazyLoadingForCollectionNavigatorsDefault

Project settings

BytecodeProxyFactory

The bytecode proxy factory to use for the hibernate.cfg.xml file. The chosen proxy factory has to be referenced in the 'Persistence' VS.NET project which contains the hibernate.cfg.xml file generated. Default value: LinFu

GenerateGuidPKValuesAsCOMBs

The method to use for generating guids to be used as primary key value. True (default) means: guid.comb, false means: guid. Default value: true

InitializeCollectionFields

This setting specifies whether backing fields for collection navigators are initialized with an empty instance (List, HashedSet) (true, default) or not (false). Default value: true

SetInverseTrueOnCollectionMappings

This setting controls whether 'inverse=true' is appended to navigator mappings which represent a set/collection. Default value: true

Typed List definition settings

TypedListRowBaseClassName

The name of the base class for a generated typed list class. The following macros are available: {$Name} for the typed list name without group name, {$GroupName} for the name of the group the typed list is in, {$FullName} for the group name plus typed list name. Default value: the value of the default TypedListRowBaseClassNameDefault

Typed View definition settings

TypedViewRowBaseClassName

The name of the base class for a generated typed view class. The following macros are available: {$Name} for the typed view name without group name, {$GroupName} for the name of the group the typed view is in, {$FullName} for the group name plus typed view name. Default value: the value of the default TypedViewRowBaseClassNameDefault

Value type definition settings

ValueTypeBaseClassName

The name of the base class for a generated value type class. The following macros are available: {$Name} for the value type name without group name, {$GroupName} for the name of the group the value type is in, {$FullName} for the group name plus value typename. Default value: the value of the default ValueTypeBaseClassNameDefault