Class PluginEntitiesConnectionRetVal
- java.lang.Object
 - 
- de.xima.fc.plugin.models.retval.entities.PluginEntitiesConnectionRetVal
 
 
- 
- All Implemented Interfaces:
 IPluginEntitiesConnectionRetVal,Serializable
public class PluginEntitiesConnectionRetVal extends Object implements IPluginEntitiesConnectionRetVal
A simple implementation ofIPluginEntitiesConnectionRetValyou may use in a plugin.- Author:
 - XIMA MEDIA GmbH
 - See Also:
 - Serialized Form
 
 
- 
- 
Constructor Summary
Constructors Constructor Description PluginEntitiesConnectionRetVal(boolean useSystemDatabase, EDatenbankTyp databaseType, DataSource dataSource, Map<String,Object> additionalProperties) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IPluginEntitiesConnectionRetValforSystemDbWithAdditionalProperties(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).EDatenbankTypgetDatabaseType()Different database management systems behave slightly differently, so we need to know about which type of database we are connecting to.DataSourcegetDataSource()This method returns a custom data source for connecting to the database where you would like to save the plugin entities.booleanisUseSystemDatabase()You may want to save you entities in the same database that is used by FORMCYCLE. 
 - 
 
- 
- 
Constructor Detail
- 
PluginEntitiesConnectionRetVal
public PluginEntitiesConnectionRetVal(boolean useSystemDatabase, EDatenbankTyp databaseType, DataSource dataSource, Map<String,Object> additionalProperties) 
 - 
 
- 
Method Detail
- 
getAdditionalProperties
public Map<String,Object> getAdditionalProperties()
Description copied from interface:IPluginEntitiesConnectionRetValThis 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 inEnvironment.- Specified by:
 getAdditionalPropertiesin interfaceIPluginEntitiesConnectionRetVal- Returns:
 - Additional properties for use by the persistence provider. If 
nullor empty, no additional properties are set. 
 
- 
getDatabaseType
public EDatenbankTyp getDatabaseType()
Description copied from interface:IPluginEntitiesConnectionRetValDifferent 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.- Specified by:
 getDatabaseTypein interfaceIPluginEntitiesConnectionRetVal- Returns:
 - The database type to which we are connecting, or 
nullto guess the type. 
 
- 
getDataSource
public DataSource getDataSource()
Description copied from interface:IPluginEntitiesConnectionRetValThis method returns a custom data source for connecting to the database where you would like to save the plugin entities. Ignored ifIPluginEntitiesConnectionRetVal.isUseSystemDatabase()returnstrue.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.
- Specified by:
 getDataSourcein interfaceIPluginEntitiesConnectionRetVal- Returns:
 - The data source used to connect to the database that will store the plugin entities. If
 
IPluginEntitiesConnectionRetVal.isUseSystemDatabase()returnsfalse, this must not returnnull, or an exception will be thrown when the plugin is initialized. IfIPluginEntitiesConnectionRetVal.isUseSystemDatabase()returnstrue, the returned value is ignored. 
 
- 
isUseSystemDatabase
public boolean isUseSystemDatabase()
Description copied from interface:IPluginEntitiesConnectionRetValYou may want to save you entities in the same database that is used by FORMCYCLE. To do so, have this method returntrue. If you do, theIPluginEntitiesConnectionRetVal.getDataSource()will be ignored, but you can still useIPluginEntitiesConnectionRetVal.getAdditionalProperties()orIPluginEntitiesConnectionRetVal.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
falsehere, you need to specify aIPluginEntitiesConnectionRetVal.getDataSource().- Specified by:
 isUseSystemDatabasein interfaceIPluginEntitiesConnectionRetVal- Returns:
 trueto use the FORMCYCLE system database, orfalseotherwise.
 
- 
forSystemDbWithAdditionalProperties
public static IPluginEntitiesConnectionRetVal forSystemDbWithAdditionalProperties(Map<String,Object> additionalProperties)
Creates a new connection details object for a connection to the FORMCYCLE database. You may also pass additional settings, such asAvailableSettings.HBM2DDL_AUTO.- Parameters:
 additionalProperties- Additional properties that are passed to the JPA provider.- Returns:
 - The connection details for a connection to the system database.
 
 
 - 
 
 -