Class ServiceSessionControl.SessionFactoryConfiguration

    • Field Detail

      • appId

        private final String appId
      • schema

        private final String schema
      • schemaVersion

        private final int schemaVersion
      • registryBuilder

        private org.hibernate.boot.registry.StandardServiceRegistryBuilder registryBuilder
      • metadataSources

        private org.hibernate.boot.MetadataSources metadataSources
      • actualCatalog

        private String actualCatalog
      • actualSchema

        private String actualSchema
      • installedSchemaVersion

        private int installedSchemaVersion
      • useSeparateConnections

        private boolean useSeparateConnections
    • Constructor Detail

      • SessionFactoryConfiguration

        SessionFactoryConfiguration​(String appId,
                                    String schema,
                                    int schemaVersion,
                                    ClassLoader classLoader)
    • Method Detail

      • init

        void init()
      • getSchema

        public String getSchema()
        Get the schema.
      • getAppId

        public String getAppId()
        Get the application id for schema versioning.
      • getSchemaVersion

        public int getSchemaVersion()
        Get the schema version of the current configuration.
      • getInstallMode

        public SchemaGenerator.Mode getInstallMode()
        Get the installation mode that BASE will use when creating the session factory. Returns null if no install/update is needed.
      • getInstalledSchemaVersion

        public int getInstalledSchemaVersion()
        Get the currently installed version of the schema or 0 if not installed.
      • getActualSchema

        public String getActualSchema()
        The actual schema that will be used by BASE.
      • getActualCatalog

        public String getActualCatalog()
        The actual catalog that will be used by BASE.
      • getClassLoader

        public ClassLoader getClassLoader()
        Get the class loader used for accessing mapped classes.
      • setUseSeparateConnections

        public void setUseSeparateConnections​(boolean separate)
        Set to TRUE to use connections separate from BASE connections. If you enable this, you will probably also want to configure connection pooling since the default connection pooling is not recommended for production use. Connection pooling is configured on getRegistryBuilder() object. Basically you need to set the 'connection.provider_class' property to 'org.hibernate.connection.C3P0ConnectionProvider' and some other properties. You'll need to look for this documentation in other places.
      • useSeparateConnections

        public boolean useSeparateConnections()
        Should the session factory be configured to use separate connections or is piggy-backed sessions required?
      • checkLocked

        private void checkLocked​(String method)
        Check that the
      • getRegistryBuilder

        public org.hibernate.boot.registry.StandardServiceRegistryBuilder getRegistryBuilder()
        Get the registry for collecting configuration options. The registry is used for configuration options that go into the hibernate.cfg.xml file. Note that BASE will automatially add configuration options for connecting to the database and the following options will be overwritten:

        hibernate.dialect hibernate.connection_driver_class hibernate.default_catalog hibernate.default_schema hibernate.connection.url hibernate.connection.username hibernate.connection.password

        The registry must be fully configured before calling getMetadataSources(). This method will throw an exception if called in the incorrect order.

      • getMetadataSources

        public org.hibernate.boot.MetadataSources getMetadataSources()
        Get an object for registering mapped entity classes. Once this method has been called it is not possible to modify the registry builder or other configuration settings.