From Eigenpedia

Jump to: navigation, search



Enki is configurable at two levels: code generation and run-time. Typically, Enki/Netbeans code generation options are a subset of Enki/Hibernate's. The run-time configuration parameters for the two storage mechanisms are very different.

Code Generation

Code generation options are split into two groups: model parameters and generator parameters. Model parameters modify how code is generated for specific elements in the UML model. For example, you can control the maximum length of a string attribute in a particular class. Generator parameters modify code generation at a much coarser scale. For example, you can control the prefix used for table names.

EnkiDocs#Code_Generation defines both types of parameters.

Run-time Configuration

Enki expects a java.util.Properties object that contains at least one property named org.eigenbase.enki.implementationType which specifies either NETBEANS_MDR or ENKI_HIBERNATE as a provider.

Netbeans MDR

If the NETBEANS_MDR provider is chosen all other properties are passed to Netbeans using the following logic:

  1. If org.netbeans.mdr.storagemodel.StorageFactoryClassName is set and has value other than org.netbeans.mdr.persistence.btreeimpl.btreestorage.BTreeFactory, all properties are passed to Netbeans with a key prefix of MDRStorageProperty. prepended. If the key is already has the given prefix, it is not modified.
  2. Otherwise, the StorageFactoryClassName is set to BTreeFactory and all properties are passed to Netbeans without modification.

It is beyond the scope of this document to discuss the Netbeans MDR run-time configuration properties.


If the ENKI_HIBERNATE provider is chosen, all properties are passed directly to the Hibernate library, although only those starting with hibernate. are used by Hibernate directly. Note that configuring a second-level cache for Hibernate may cause other properties to be used (hence all are passed).

It is beyond the scope of this document to discuss the Hibernate run-time configuration properties. Commonly used properties include:

  • hibernate.dialect
  • hibernate.cache.*
  • hibernate.default_batch_fetch_size
  • hibernate.jdbc.batch_size

Enki/Hibernate also processes some run-time configuration properties. See EnkiDesign and HibernateMDRepository for details.