Interface IPluginEntitiesConnectionRetVal

  • All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    PluginEntitiesConnectionRetVal

    public interface IPluginEntitiesConnectionRetVal
    extends Serializable
    For use by an entities plugin. This defines the connection details for establishing a connection to the database where the plugin entities are stored.
    Author:
    XIMA MEDIA GmbH
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default Map<String,​Object> getAdditionalProperties()
      This method lets you pass additional properties to the persistence provider (which is currently Hibernate).
      default EDatenbankTyp getDatabaseType()
      Different database management systems behave slightly differently, so we need to know about which type of database we are connecting to.
      default DataSource getDataSource()
      This method returns a custom data source for connecting to the database where you would like to save the plugin entities.
      default boolean isUseSystemDatabase()
      You may want to save you entities in the same database that is used by formcycle.
    • Method Detail

      • getDataSource

        default DataSource getDataSource()
        This method returns a custom data source for connecting to the database where you would like to save the plugin entities. Ignored if isUseSystemDatabase() returns true.

        This method may create a new data source (which is potentially a costly operation): the system will call this method only once when the plugin is initialized.

        Returns:
        The data source used to connect to the database that will store the plugin entities. If isUseSystemDatabase() returns false, this must not return null, or an exception will be thrown when the plugin is initialized. If isUseSystemDatabase() returns true, the returned value is ignored.
      • isUseSystemDatabase

        default boolean isUseSystemDatabase()
        You may want to save you entities in the same database that is used by formcycle. To do so, have this method return true. If you do, the getDataSource() will be ignored, but you can still use getAdditionalProperties() or getDataSource() to customize the database connection. Also, make sure you use unique names for the tables of your entities that do not conflict with existing formcycle table names. For example, consider prepending a prefix to all table names.

        On the other hand, if you return false here, you need to specify a getDataSource().

        Returns:
        true to use the formcycle system database, or false otherwise.
      • getDatabaseType

        default EDatenbankTyp getDatabaseType()
        Different database management systems behave slightly differently, so we need to know about which type of database we are connecting to. If you do not specify a type explicitly, the system will try to guess the type, but note that this may fail for some types of database management systems.
        Returns:
        The database type to which we are connecting, or null to guess the type.
      • getAdditionalProperties

        default Map<String,​Object> getAdditionalProperties()
        This method lets you pass additional properties to the persistence provider (which is currently Hibernate). These properties override any settings made by formcycle. Property keys you can use include, but are not limited to, the options found in Environment.
        Returns:
        Additional properties for use by the persistence provider. If null or empty, no additional properties are set.