I need to store logical conditions in a database. for example: (condition1 || condition2) && condition3 should be stored in the database.
I plan to create a table [ ExpressionTree ] to handle the structure:
Id condition combinationId nextId(FK->[Condition2Combination.Id]) operator (AND, OR, null)
If (condition 1 || condition2) && condition3 in the [ExpressionTree] table, the entries should be:
Id conditionId combinationId nextId operator 1 condition1 combination1 2 OR 2 condition2 combination1 3 AND 3 condition3 combination1 null null
But the decision is not good, what is your suggestion? Thanks!
java design database database-design
ε’ ε£° θΏ Shengyuan Lu
source share