|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.mguennewig.pobjects.metadata.Constraint
de.mguennewig.pobjects.metadata.UniqueConstraint
public class UniqueConstraint
Defines a unique-constraint for an n-tuple of
attributes.
Use Field.isUnique() for a unique constraints on a single field.
| Field Summary |
|---|
| Fields inherited from class de.mguennewig.pobjects.metadata.Constraint |
|---|
MEMBER_NAME |
| Constructor Summary | |
|---|---|
UniqueConstraint(java.lang.String schemaName,
Field[] fields)
Creates a new unique constraint. |
|
UniqueConstraint(java.lang.String schemaName,
Field[] fields,
java.lang.String applyFunction)
Creates a new unique constraint. |
|
| Method Summary | |
|---|---|
void |
check(Record obj)
Checks whether the constraint is fulfilled for the given object. |
java.lang.String |
getApplyFunction()
|
Field |
getField(int i)
|
Field[] |
getFields()
|
Index |
getImplicitIndex()
|
int |
getNumFields()
|
java.lang.String |
name(ClassDecl te,
int variant)
Returns different names depending on variant for the code
generator. |
| Methods inherited from class de.mguennewig.pobjects.metadata.Constraint |
|---|
getSchemaName, isImplicit |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UniqueConstraint(java.lang.String schemaName,
Field[] fields)
schemaName - The constraint name within the database schema.fields - The fields belonging to this constraint.
public UniqueConstraint(java.lang.String schemaName,
Field[] fields,
java.lang.String applyFunction)
schemaName - The constraint name within the database schema.fields - The fields belonging to this constraint.applyFunction - The name of a function to apply to all fields or
null if no function should be applied.| Method Detail |
|---|
public final int getNumFields()
public final Field getField(int i)
public final Field[] getFields()
public final java.lang.String getApplyFunction()
public final Index getImplicitIndex()
public void check(Record obj)
throws PObjConstraintException
object.
As we can't check this in-memory, this method does nothing.
check in class ConstraintPObjConstraintException - when the constraint isn't fulfilled.
public java.lang.String name(ClassDecl te,
int variant)
variant for the code
generator.
name in class Constraintvariant | return value |
|---|---|
Constraint.MEMBER_NAME |
unique< |
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||