====== HowTo - database integration (DB adapter) ====== The database adapter allows the direct integration of eBiss with a database. ====== Access ====== As a start, data from a simple and flat table 'DbAdapterTest' is to be read here. You define the necessary structure for reading the table 'DbAdapterTest' in [[en:programmierung:typbibliotheken:start|]] (or in the .Net code) as described in [[en:howtos:dbadapter:create_structure|]] and create the DLL, preferably also directly in the type editor. In eBiss use the JobStep [[en:prozessdefinition:jobs:jobsteps:kommunikation:backend:backendobjectretrieverex|]] and select: - **eBiss.DbAdapter.StandardReader** as BackendType and (note with an eBiss version before 3.5.237 ((note with an eBiss version before 3.5.237 (14.1.21) it was nnecessary to reselect the job step once)) ) - then select the type 'eBiss.TypeLib.DbAdapter.SimpleSample' under DocumentTypeName. Define the variables [[en:howtos:dbadapter:dbconnection|]] in the job step or at the system partner. Examples for the variables can be found in the eBiss installation directory e.g. for the SQL-Server under: * StandardTemplates\DBAdapter\MS-SQL\Integrated Security Or you define the variables with the same name at the job step ((An activation from the trace over the variable eBiss.DbAdapter.TraceSql takes place with the True)), s.a. [[en:howtos:dbadapter:extendedvariablehandling|]] . That's it, run the job and the data is in eBiss. Further examples e.g., filter by date, write a read marker, etc. follow. ====== Splitting of messages ====== Splitting messages according to a field value is achieved by setting the attributes * GroupBy and * MapFrameInterchangeReference on the desired field. ====== Overview ====== {{indexmenu>:en:howtos:dbadapter|navbar}} ===== Process automation ===== See here [[en:prozessdefinition:jobs:beispiele:backendintegration]] how to create the job step ===== DB Adapter Attributes ===== Use following attributes of the DB Adapter to configure your plugin: [[en:transformation:mappings:objektdefinition:attribute#dbadapter_attribute|Data type attributes]]. ===== Example of JOIN Attribute ===== If, for example, you want to add information from a second table in the DbAdapter to each position, this can lead to quite a few individual selects. In the case of a customer, 4 condition records are added to each PRICAT position, resulting in 82000 selects for a PRICAT. With the join attribute, it is possible to bypass an additional Select and access the data directly. You can also apply this join attribute more than once and thus include several foreign values directly with the join in the current data record. This has a positive effect on performance. **Example:** The second join is executed with the alias "JT". Below, the JoinFieldContent field refers to the first join, and the DoubleJoinFieldContent field refers to the second join. [Join("JoinTable", "JoinTable.Id = HeaderTable.[Key]")] [Join("JoinTable", "JoinTable.Id = HeaderTable.[Key]", Alias = "JT2")] public class HeaderRecord : IMapObjectItem { [PrimaryKey(PrimaryKeyType.Counter, "Counters", "Name = 'HeaderTable' and @Name = @Name ", "Current_Val")] [MapFrameDocumentNumber] [ReadMarker(ReadMarkerType.StatusTable, "StatusTable", true)] public int Key; public string Name; [ReadMarker(ReadMarkerType.CheckUpdate, 0, 1)] public decimal TestDecimal; [ReadMarker(ReadMarkerType.Timestamp), Where("< $LastExecutionStartDate")] public DateTime ReadTimestamp = new DateTime(1900, 1, 1); [MapExternalName("JoinTable.JoinFieldContent")] public string JoinFieldContent; [MapExternalName("JT2.JoinFieldContent")] public string DoubleJoinFieldContent; public DateTime? NullableDateTimeTest; [MapListType(typeof(DetailRecord)), MapExternalName("DetailTable")] public ArrayList Details; }