- java.lang.Object
-
- io.github.mmm.entity.bean.sql.constraint.Constraint
-
- Direct Known Subclasses:
CheckConstraint
,ForeignKeyConstraint
,NotNullConstraint
,PrimaryKeyConstraint
,UniqueConstraint
public abstract class Constraint extends Object
AConstraint
on one or multiple columns.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description Constraint(String name, io.github.mmm.value.PropertyPath<?> column)
The constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static String
createName(String prefix, io.github.mmm.property.ReadableProperty<?> property)
protected static String
createName(String prefix, io.github.mmm.property.ReadableProperty<?> property, boolean addProperty)
List<io.github.mmm.value.PropertyPath<?>>
getColumns()
String
getName()
abstract String
getType()
String
toString()
protected void
toString(StringBuilder sb)
protected void
toStringColumns(StringBuilder sb)
-
-
-
Method Detail
-
getName
public String getName()
- Returns:
- the name of the predicate (e.g. "FK_Person_Order").
-
getType
public abstract String getType()
- Returns:
- the type of this
Constraint
(e.g. "CHECK" or "FOREIGN KEY").
-
getColumns
public List<io.github.mmm.value.PropertyPath<?>> getColumns()
- Returns:
- the
List
with theproperties
representing the columns thisConstraint
applies to.
-
toString
protected void toString(StringBuilder sb)
- Parameters:
sb
- theStringBuilder
to append to.
-
toStringColumns
protected void toStringColumns(StringBuilder sb)
- Parameters:
sb
- theStringBuilder
to append to.
-
createName
protected static final String createName(String prefix, io.github.mmm.property.ReadableProperty<?> property)
- Parameters:
prefix
- the constraint prefix (XX_).property
- theReadableProperty
representing the column.- Returns:
- the
Constraint
name
.
-
createName
protected static final String createName(String prefix, io.github.mmm.property.ReadableProperty<?> property, boolean addProperty)
- Parameters:
prefix
- the constraint prefix (XX_).property
- theReadableProperty
representing the column.addProperty
- -true
to add theproperty path
,false
otherwise.- Returns:
- the
Constraint
name
.
-
-