Annotation Type CopeCreateLimit


  • @Target(TYPE)
    @Retention(RUNTIME)
    public @interface CopeCreateLimit
    Specifies the maximum number of items (instances) that can be created over the whole live time of the database schema since its creation. For types without this annotation the limit defaults to Integer.MAX_VALUE. The limit includes
    • items of subtypes of the type and
    • items created by transactions that are subsequently rolled back.
    This annotation is allowed on top-level types only.

    This limit is an upper bound. There is no guarantee, that actually that many items can be created. In particular certain methods of generating primary keys may 'loose' unused ranges of numbers due to caching.

    The value is actually off by one. So @CopeCreateLimit(0) allows you to create one item. And @CopeCreateLimit(Integer.MAX_VALUE) allows you to create 2^31 items, not just 2^31 - 1.

    This annotation may affect your database schema, in particular the type of

    • the primary column of the type and its subtypes,
    • foreign key columns of item fields referring the type or its subtypes, and
    • the sequence for creating primary keys of the type.
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      long value  
    • Element Detail

      • value

        long value