/*
* Copyright (c) 2010 Mysema Ltd.
* All rights reserved.
*
*/
package com.mysema.rdfbean.annotations;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @Mixin defines that a property's value is another instance of the same
* subject. Thus it is never used in conjunction with @Predicate. @Mixin
* property's type may not be assignable from the host type (self reference).
* <p>
* Mixin references are useful when there's multiple projections (DTOs) for the
* same underlying resource, e.g. one containing only basic information about
* the subject and another containing everything else. The class containing
* details don't have to repeat info classes properties as it can reuse it using
* @Mixin property.
* </p>
* <p>
* For example
*
* <pre>
* @ClassMapping(ns=OWL.NS, ln="Class")
* public class ClassInfo {
*
* @Id
* private UID id;
*
* @Predicate(ns=RDFS.NS)
* private String label;
* }
*
* @ClassMapping(ns=OWL.NS, ln="Class")
* public class ClassDetails {
*
* @Predicate(ns=RDFS.NS)
* private Set<ClassInfo> subClassOf;
*
* @Mixin
* private ClassInfo info;
*
* @Predicate
* private Set<OWLClass> complementOf = new LinkedHashSet<OWLClass>();
*
* @Predicate
* private Set<OWLClass> disjointWith = new LinkedHashSet<OWLClass>();
*
* ...
* }
* </pre>
*
*
* @author sasa
*/
@Documented
@Target({ METHOD, FIELD, PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface Mixin {
}