001    package org.tynamo.descriptor.annotation;
002    
003    import java.lang.annotation.ElementType;
004    import java.lang.annotation.Retention;
005    import java.lang.annotation.RetentionPolicy;
006    import java.lang.annotation.Target;
007    
008    @Retention(RetentionPolicy.RUNTIME)
009    @Target({ElementType.FIELD, ElementType.METHOD})
010    @DescriptorAnnotation(CollectionDescriptorAnnotationHandler.class)
011    public @interface Collection
012    {
013    
014            public static final String DEFAULT_inverse = "";
015            public static final String DEFAULT_addExpression = "";
016            public static final String DEFAULT_removeExpression = "";
017            public static final String DEFAULT_swapExpression = "";
018    
019            /**
020             * The field in the other end of the realtionship. Required for @OneToMany @Collection(child=false)
021             *
022             * @return
023             */
024            public String inverse() default "";
025    
026            /**
027             * Child collections will not allow you to choose from all possible instances of the element type, only to create new
028             * instances and remove instances from the collection.
029             *
030             * @return
031             */
032            public boolean child() default false;
033    
034            public String addExpression() default "";
035    
036            public String removeExpression() default "";
037    
038            public String swapExpression() default "";
039    
040            public boolean allowRemove() default true;
041    
042    }