Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
semint-kprime-arm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pedot Nicola
semint-kprime-arm
Commits
f85989a1
Commit
f85989a1
authored
4 years ago
by
npedot
Browse files
Options
Downloads
Patches
Plain Diff
adds parse inclusion,double inclusion,multivalued schema constraint
parent
d2a08206
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/kotlin/unibz.cs.semint.kprime/domain/ddl/SchemaCmdParser.kt
+18
-2
18 additions, 2 deletions
...tlin/unibz.cs.semint.kprime/domain/ddl/SchemaCmdParser.kt
with
18 additions
and
2 deletions
src/main/kotlin/unibz.cs.semint.kprime/domain/ddl/SchemaCmdParser.kt
+
18
−
2
View file @
f85989a1
...
...
@@ -12,10 +12,26 @@ object SchemaCmdParser {
}
fun
parseFunctionals
(
tableName
:
String
,
setExpression
:
String
):
Set
<
Constraint
>
{
return
parseConstraint
(
setExpression
,
tableName
,
Constraint
.
TYPE
.
FUNCTIONAL
.
name
)
}
fun
parseMultivalued
(
tableName
:
String
,
setExpression
:
String
):
Set
<
Constraint
>
{
return
parseConstraint
(
setExpression
,
tableName
,
Constraint
.
TYPE
.
MULTIVALUED
.
name
)
}
fun
parseInclusion
(
tableName
:
String
,
setExpression
:
String
):
Set
<
Constraint
>
{
return
parseConstraint
(
setExpression
,
tableName
,
Constraint
.
TYPE
.
INCLUSION
.
name
)
}
fun
parseDoubleInclusion
(
tableName
:
String
,
setExpression
:
String
):
Set
<
Constraint
>
{
return
parseConstraint
(
setExpression
,
tableName
,
Constraint
.
TYPE
.
DOUBLE_INCLUSION
.
name
)
}
private
fun
parseConstraint
(
setExpression
:
String
,
tableName
:
String
,
type
:
String
):
Set
<
Constraint
>
{
val
constraintsToAdd
=
Constraint
.
set
(
setExpression
)
for
(
constraint
in
constraintsToAdd
)
{
constraint
.
name
=
tableName
+
".functional
"
constraint
.
type
=
Constraint
.
TYPE
.
FUNCTIONAL
.
nam
e
constraint
.
name
=
"$
tableName
.$type
"
constraint
.
type
=
typ
e
constraint
.
source
.
table
=
tableName
constraint
.
target
.
table
=
tableName
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment