Database types for non text properties.

Confluence User - 29 Oct, 2021

Our department is currently analyzing Joget in order to decide wether to start using it.

We have seen that user defined data fields are always stored as text database fields (VARCHAR2 in Oracle) even if they are dates or numbers.

We have investigated the community version source  code and we have discovered that plugins (org.joget.apps.form.lib.DatePicker) convert from the right data type (java.sql.Date / Time / Timestamp ) to String (VARCHAR2) and the data exchange between classes is performed by using org.joget.apps.form.model.FormRowSet (extends java.util.List) class objects, containing org.joget.apps.form.model.FormRow (extends java.util.Properties) class objects, which are key/value dictionaries where both key and value are java.lang.String class objects. We have also checked the <wflow>/app_forms/*.hbm.xml files, containing the database table definitions, and they also use "text" data type for all user defined fields.

We need to know if this behaviour (storing all user-defined data as text in the database) is intended, and if the Professional and Enterprise versions also behave this way, and if there is any plan on changin this behaviour in the future.

Thank you.

server;database;mapper

1


01 Nov, 2021
confluenceUser
confluenceUser

I think it is longtext by default for maximum flexibility and for developers or even business users to be able to use Joget easily.

So far I have changed a few columns from the default "longtext" to the likes of "double / date time / varchar(255)".

Whats important is that in the joget app form where it writes the data into, I make sure that I add the corresponding validator so that when Joget saves the data, it does not break / hit error the database.

So long that at the app layer (joget) and db layer are in sync, then it would work fine.


RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print