ConstraintCreator (Neo4j Community 2.1.0-M01 API)
Date: 2014-02-20

org.neo4j.graphdb.schema

## Interface ConstraintCreator

-     public interface ConstraintCreator

  A builder for entering details about a constraint to create. After all details have been entered `create()` must be called for the constraint to actually be created. A constraint creator knows which `label` it is to be created for. All methods except `create()` will return an `ConstraintCreator` which should be used for further interaction. Compatibility note: New methods may be added to this interface without notice, backwards compatibility is only guaranteed for clients of this interface, not for implementors.
  See Also:
    `Schema`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ConstraintCreator` | `assertPropertyIsUnique(String propertyKey)` Imposes a uniqueness constraint for the given property, such that there can be at most one node, having the given label, for any set value of that property key.
    `ConstraintDefinition` | `create()` Creates a constraint with the details specified by the other methods in this interface.

- - ### Method Detail

    - #### assertPropertyIsUnique

          ConstraintCreator assertPropertyIsUnique(String propertyKey)

      Imposes a uniqueness constraint for the given property, such that there can be at most one node, having the given label, for any set value of that property key.
      Returns:
        a `ConstraintCreator` instance to be used for further interaction.

    - #### create

          ConstraintDefinition create()
                                      throws ConstraintViolationException

      Creates a constraint with the details specified by the other methods in this interface.
      Returns:
        the created `constraint`.
      Throws:
        `ConstraintViolationException` - if creating this constraint would violate any existing constraints.

Copyright © 2002–2014 The Neo4j Graph Database Project. All rights reserved.