public class PluginEntitiesConnectionRetVal extends Object implements IPluginEntitiesConnectionRetVal
IPluginEntitiesConnectionRetVal
you may use in a plugin.Constructor and Description |
---|
PluginEntitiesConnectionRetVal(boolean useSystemDatabase,
EDatenbankTyp databaseType,
DataSource dataSource,
Map<String,Object> additionalProperties) |
Modifier and Type | Method and Description |
---|---|
static IPluginEntitiesConnectionRetVal |
forSystemDbWithAdditionalProperties(Map<String,Object> additionalProperties)
Creates a new connection details object for a connection to the FORMCYCLE database.
|
Map<String,Object> |
getAdditionalProperties()
This method lets you pass additional properties to the persistence provider (which is currently Hibernate).
|
EDatenbankTyp |
getDatabaseType()
Different database management systems behave slightly differently, so we need to know about which type of database
we are connecting to.
|
DataSource |
getDataSource()
This method returns a custom data source for connecting to the database where you would like to save the plugin
entities.
|
boolean |
isUseSystemDatabase()
You may want to save you entities in the same database that is used by FORMCYCLE.
|
public PluginEntitiesConnectionRetVal(boolean useSystemDatabase, EDatenbankTyp databaseType, DataSource dataSource, Map<String,Object> additionalProperties)
public Map<String,Object> getAdditionalProperties()
IPluginEntitiesConnectionRetVal
Environment
.getAdditionalProperties
in interface IPluginEntitiesConnectionRetVal
null
or empty, no additional
properties are set.public EDatenbankTyp getDatabaseType()
IPluginEntitiesConnectionRetVal
getDatabaseType
in interface IPluginEntitiesConnectionRetVal
null
to guess the type.public DataSource getDataSource()
IPluginEntitiesConnectionRetVal
IPluginEntitiesConnectionRetVal.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.
getDataSource
in interface IPluginEntitiesConnectionRetVal
IPluginEntitiesConnectionRetVal.isUseSystemDatabase()
returns false
, this must not return null
, or an exception will be
thrown when the plugin is initialized. If IPluginEntitiesConnectionRetVal.isUseSystemDatabase()
returns true
, the returned value
is ignored.public boolean isUseSystemDatabase()
IPluginEntitiesConnectionRetVal
true
. If you do, the IPluginEntitiesConnectionRetVal.getDataSource()
will be ignored, but you can still use
IPluginEntitiesConnectionRetVal.getAdditionalProperties()
or IPluginEntitiesConnectionRetVal.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 IPluginEntitiesConnectionRetVal.getDataSource()
.
isUseSystemDatabase
in interface IPluginEntitiesConnectionRetVal
true
to use the FORMCYCLE system database, or false
otherwise.public static IPluginEntitiesConnectionRetVal forSystemDbWithAdditionalProperties(Map<String,Object> additionalProperties)
AvailableSettings.HBM2DDL_AUTO
.additionalProperties
- Additional properties that are passed to the JPA provider.Copyright © 2020 XIMA MEDIA GmbH. All rights reserved.