Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ meta-model.
If you modified the generator and want to re-generate the meta-model, you have
to:
1. Ensure that no more instances of the meta-model exist in the system.
2. Run `FmxNewSQLMetamodelGenerator class>>#regenerateMetaModel`
2. Run `FmxSQLMetamodelGenerator generate.`
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Class {
'tWithColumnReference',
'tWithTableReference',
'namespaceReference',
'tWithNamespaceReference'
'tWithNamespaceReference',
'exclusionConstraint'
],
#category : #FAMIXNGSQLMetamodelGenerator
}
Expand Down Expand Up @@ -107,6 +108,11 @@ FmxSQLStructuralMetamodelGenerator >> defineStructuralEntities [
newClassNamed: #CheckConstraint
comment: self checkConstraintComment.
checkConstraint withTesting.
exclusionConstraint := builder
newClassNamed: #ExclusionConstraint
comment: self exclusionConstraintComment.
exclusionConstraint withTesting.

primaryKeyConstraint := builder
newClassNamed: #PrimaryKeyConstraint
comment: self primaryKeyConstraintComment.
Expand Down Expand Up @@ -181,6 +187,8 @@ FmxSQLStructuralMetamodelGenerator >> defineStructuralHierarchy [
type --|> structuralEntity.
type --|> tAbstractType.

checkConstraint --|> constraint.
exclusionConstraint --|> constraint.
primaryKeyConstraint --|> constraint.
foreignKeyConstraint --|> constraint.
notNullConstraint --|> constraint.
Expand Down Expand Up @@ -261,6 +269,11 @@ FmxSQLStructuralMetamodelGenerator >> entityInNamespaceComment [
^ 'I am a trait that any entity which can be part of a namespace use.'
]

{ #category : #'comments - SQL' }
FmxSQLStructuralMetamodelGenerator >> exclusionConstraintComment [
^ 'I represent an EXCLUSION constraint as defined in SQL standard.'
]

{ #category : #'comments - SQL' }
FmxSQLStructuralMetamodelGenerator >> foreignKeyConstraintComment [
^ 'I represent a FOREIGN KEY constraint as defined in SQL standard.'
Expand Down
7 changes: 7 additions & 0 deletions src/FamixNGSQL/FmxSQLEntity.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ FmxSQLEntity >> isExceptClause [
^ false
]

{ #category : #testing }
FmxSQLEntity >> isExclusionConstraint [

<generated>
^ false
]

{ #category : #testing }
FmxSQLEntity >> isForeignKey [
self deprecated: 'Use #isForeignKeyConstraint instead.' transformWith: '`@receiver isForeignKey' -> '`@receiver isForeignKeyConstraint'.
Expand Down
24 changes: 24 additions & 0 deletions src/FamixNGSQL/FmxSQLExclusionConstraint.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"
I represent a EXCLUSION constraint as defined in SQL standard.
"
Class {
#name : #FmxSQLExclusionConstraint,
#superclass : #FmxSQLConstraint,
#category : #'FamixNGSQL-Entities'
}

{ #category : #meta }
FmxSQLExclusionConstraint class >> annotation [

<MSEClass: #ExclusionConstraint super: #FmxSQLConstraint>
<package: #FamixNGSQL>
<generated>
^self
]

{ #category : #testing }
FmxSQLExclusionConstraint >> isExclusionConstraint [

<generated>
^ true
]
5 changes: 5 additions & 0 deletions src/FamixNGSQL/FmxSQLTable.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ FmxSQLTable >> constraintsSatisfying: aBlock [
^ self constraints select: aBlock
]

{ #category : #accessing }
FmxSQLTable >> exclusionConstraints [
^ self constraintsSatisfying: [ :c | c class = FmxSQLExclusionConstraint ]
]

{ #category : #accessing }
FmxSQLTable >> foreignKeyConstraints [
^ self constraintsSatisfying: [ :c | c class = FmxSQLForeignKeyConstraint ]
Expand Down