Creating an HSQL table (and other databases)
|
Scope/Lifetime |
Live system-wide (i.e. also in other profiles) and permanently (i.e. not just during the profile run/test). |
If phase 4 is activated, you already know about the option of automatically creating a database node with fields in the target structure for existing database tables (via the context menu of the target structure).
If phase 4 is activated, you also have the option to proceed the other way. That is, you can create a node with fields in the target structure and then automatically create a table in an integrated HSQL database (with fields that match the fields in your target node). This is a convenient and intuitive way to build a database structure for your profile in the background. In addition, you do not have to worry about access rights or asking your database administrator for resources. The administrator simply does not need to get involved, since you only use internal data structures for which you already have all the necessary access rights (if you have them).
The following section describes the procedure for creating an HSQL node (and thus an HSQL table).
Create a new node with any number of fields in the target structure.
Select the database alias hsql in the attributes of target node Node. This alias is already available by default.
Then you can use the context menu of the node Node to generate an HSQL table.
Another dialogue opens. Click (1) and (2) there. After that, (3) is filled automatically. Use (4) to complete the process.
You have now created a functional HSQL table and your node Node with its fields is connected to it (via the node and field attributes as you know it from 'normal' database nodes).
Other database types
You can also use other databases for this mechanism instead of the internal HSQL database. Simply use the alias of the desired database instead of hsql in the above description.
How the data types of structure fields are translated for the respective data type of the selected database, see (3), can be controlled via the configuration file ./etc/admin/datawizard/db_datatatypes.properties.
# Avaiable types to define: (String, Integer, Double, Date, Boolean, TimeStamp, Float, BigDecimal, BigInteger, Blob)# Holders which will be replaced:# %n% for single values (length)# %p% total number of digits# %s% number of digits in the fractional part# # Composition:# specific String of a databasedriver . datatype = String to use## DB2 Datatypesdb2.String=VARCHAR(%n%)db2.Integer=INTEGERdb2.Double=DOUBLEdb2.Date=DATEdb2.Boolean=SMALLINTdb2.TimeStamp=TIMESTAMPdb2.Float=REALdb2.BigDecimal=DECIMAL(%p%,%s%)db2.BigInteger=BIGINTdb2.Blob=BLOB# MYSQLmysql.String=VARCHAR(%n%)mysql.Integer=INTEGER(%n%)mysql.Double=DOUBLE(%p%,%s%)mysql.Date=DATEmysql.Boolean=SMALLINT(%n%)mysql.TimeStamp=TIMESTAMPmysql.Float=FLOAT(%p%,%s%)mysql.BigDecimal=DECIMAL(%p%,%s%)mysql.BigInteger=BIGINT(%n%)mysql.Blob=BLOB#Postgrespostgres.String=VARCHAR(%n%)postgres.Integer=INTEGERpostgres.Double=DOUBLE PRECISIONpostgres.Date=DATEpostgres.Boolean=BOOLEANpostgres.TimeStamp=TIMESTAMPpostgres.Float=REALpostgres.BigDecimal=NUMERIC(%p%,%s%)postgres.BigInteger=BIGINTpostgres.Blob=BYTEA# MariaDBmariadb.String=VARCHAR(%n%)mariadb.Integer=INTEGER(%n%)mariadb.Double=DOUBLE(%p%,%s%)mariadb.Date=DATEmariadb.Boolean=SMALLINT(%n%)mariadb.TimeStamp=TIMESTAMPmariadb.Float=FLOAT(%p%,%s%)mariadb.BigDecimal=DECIMAL(%p%,%s%)mariadb.BigInteger=BIGINT(%n%)mariadb.Blob=BLOB#Oracleoracle.String=VARCHAR2(%n% CHAR)oracle.Integer=INTEGERoracle.Double=DOUBLE PRECISIONoracle.Date=DATEoracle.Boolean=SMALLINToracle.TimeStamp=TIMESTAMPoracle.Float=FLOAToracle.BigDecimal=DECIMAL(%p%,%s%)oracle.BigInteger=BIGINToracle.Blob=BLOB#MSSqlsqlserver.String=VARCHAR(%n%)sqlserver.Integer=INTsqlserver.Double=FLOAT(53)sqlserver.Date=DATEsqlserver.Boolean=SMALLINTsqlserver.TimeStamp=TIMESTAMPsqlserver.Float=FLOAT(53)sqlserver.BigDecimal=DECIMAL(%p%,%s%)sqlserver.BigInteger=BIGINTsqlserver.Blob=VARBINARY(MAX)