/*
 * Copyright 2011 Martin Grotzke
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package de.javakaffee.validation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

/**
 * Is used to mark bean properties as unique compared to other entity instances
 * (like e.g. a username). The validator {@link UniqueKeyValidator} allows
 * annotated bean to use read-only properties (immutable). Also an update of the
 * entity is allowed, without having to use different validation groups for
 * create/edit.
 *
 * @author <a href="mailto:martin.grotzke@googlemail.com">Martin Grotzke</a>
 */
@Constraint(validatedBy = { UniqueKeyValidator.class })
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface UniqueKey {

    String property();

    String message() default "{validation.constraints.UniqueKey.message}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    @Target({ ElementType.TYPE })
    @Retention(RetentionPolicy.RUNTIME)
    @Documented
    @interface List {
        UniqueKey[] value();
    }

}

@@ -931,16 +931,18 @@
 to mark 
+a 
 bean pro
@@ -945,19 +945,35 @@
  propert
-ies
+y (e.g. a username)
  as uniq
@@ -992,16 +992,19 @@
 to other
+%0A *
  entity 
@@ -1016,34 +1016,8 @@
 nces
-%0A * (like e.g. a username)
 . Th
@@ -1061,16 +1061,20 @@
 %7D allows
+ the
 %0A * anno
@@ -1171,82 +1171,13 @@
 owed
-, without having to use different validation groups for%0A * create/edit
 .%0A *
+ 
 %0A * 

Update javadoc