diff --git a/pom.xml b/pom.xml index 273173ad5..33828a722 100644 --- a/pom.xml +++ b/pom.xml @@ -38,6 +38,12 @@ 1.0 + + org.avaje.ebean + ebean-annotation + 1.1-SNAPSHOT + + org.avaje avaje-datasource-api @@ -170,7 +176,7 @@ 1.4.192 provided - + org.xerial sqlite-jdbc @@ -310,5 +316,5 @@ - + diff --git a/src/main/java/com/avaje/ebean/annotation/Aggregation.java b/src/main/java/com/avaje/ebean/annotation/Aggregation.java deleted file mode 100644 index aeb4147c1..000000000 --- a/src/main/java/com/avaje/ebean/annotation/Aggregation.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify a property to be an aggregation formula. - *

- * The aggregation formula should be a sum, count, avg, min or max. - * By default aggregation properties are treated as transient and not - * included in a query. To populate the aggregation property it must be - * explicitly included in the select(). - *

- *

- *

Example:

- *
{@code
- *
- * @Aggregation("count(details)")
- * Long totalCount;
- *
- * @Aggregation("sum(details.quantity*details.unitPrice)")
- * Long totalAmount;
- *
- * }
- *

- *

Example query

- *
{@code
- *
- *  List list = Ebean.find(TEventOne.class)
- *       .select("name, totalCount, totalUnits, totalAmount")
- *       .where()
- *         .startsWith("logs.description", "a")
- *       .having()
- *         .ge("count", 1)
- *       .orderBy().asc("name")
- *       .findList();
- *
- * }
- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface Aggregation { - - /** - * Aggregation formula using sum, count, avg, min, max. - */ - String value(); -} diff --git a/src/main/java/com/avaje/ebean/annotation/Cache.java b/src/main/java/com/avaje/ebean/annotation/Cache.java deleted file mode 100644 index 59be62ef3..000000000 --- a/src/main/java/com/avaje/ebean/annotation/Cache.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify the default cache use specific entity type. - */ -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Cache { - - /** - * Set this to true to enable the use of query cache. - *

- * By default query caching is disabled as the query cache invalidates - * frequently and so it is typically used for specific bean types and cases. - *

- */ - boolean enableQueryCache() default false; - - /** - * Set this to false to disable the use of bean cache. - *

- * By default bean caching is expected so this defaults to true. We might - * set this to false on a bean type that we want to use query caching but no - * bean caching (and this is expected to be a rare case). - *

- *

- * When bean caching is enabled by default "find by id" and "find by unique natural key" - * queries will try to use the bean cache. We use {@link com.avaje.ebean.Query#setUseCache(boolean)} - * with false for the case when we do NOT want to use the bean cache. - *

- */ - boolean enableBeanCache() default true; - - /** - * Specify the property that is a natural unique identifier for the bean. - *

- * When a findUnique() query is used with this property as the sole expression - * then there will be a lookup into the L2 natural key cache. - *

- */ - String naturalKey() default ""; - - /** - * When set to true the beans returned from a query will default to be - * readOnly. - *

- * If the bean is readOnly and has no relationships then it may be sharable. - *

- *

- * If you try to modify a readOnly bean it will throw an - * IllegalStateException. - *

- */ - boolean readOnly() default false; - -} diff --git a/src/main/java/com/avaje/ebean/annotation/CacheBeanTuning.java b/src/main/java/com/avaje/ebean/annotation/CacheBeanTuning.java deleted file mode 100644 index b1a299f51..000000000 --- a/src/main/java/com/avaje/ebean/annotation/CacheBeanTuning.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Cache tuning hints for the L2 bean cache of a specific entity type. - *

- * Note that this is not useful when distributed L2 bean caches are used like - * ElasticSearch, Hazelcast, Ignite etc. - *

- */ -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface CacheBeanTuning { - - /** - * The maximum size for the cache. - *

- * This defaults to 0 which means unlimited. - *

- */ - int maxSize() default 0; - - /** - * The maximum time (in seconds) that a cache entry is allowed to stay in the - * cache when it has not been accessed. - *

- * This defaults to 0 which means unlimited. - *

- */ - int maxIdleSecs() default 0; - - /** - * The maximum time (in seconds) a cache entry is allowed to stay in the - * cache. - *

- * This is not generally required as the cache entries are automatically - * evicted when related data changes are committed. - *

- *

- * This defaults to 0 which means unlimited. - *

- */ - int maxSecsToLive() default 0; - - /** - * The frequency (in seconds) that cache trimming should occur. - *

- * This is a hint for cache implementations that use background cache trimming. - *

- */ - int trimFrequency() default 0; -} diff --git a/src/main/java/com/avaje/ebean/annotation/CacheQueryTuning.java b/src/main/java/com/avaje/ebean/annotation/CacheQueryTuning.java deleted file mode 100644 index bf43ef9fc..000000000 --- a/src/main/java/com/avaje/ebean/annotation/CacheQueryTuning.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify cache tuning for query caching on a specific entity type. - *

- * If this is not specified then the system default settings are used. - *

- */ -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface CacheQueryTuning { - - /** - * The maximum size for the cache. - *

- * This defaults to 0 which means unlimited. - *

- */ - int maxSize() default 0; - - /** - * The maximum time (in seconds) that a cache entry is allowed to stay in the - * cache when it has not been accessed. - *

- * This defaults to 0 which means unlimited. - *

- */ - int maxIdleSecs() default 0; - - /** - * The maximum time (in seconds) a cache entry is allowed to stay in the - * cache. - *

- * This is not generally required as the cache entries are automatically - * evicted when related data changes are committed. - *

- *

- * This defaults to 0 which means unlimited. - *

- */ - int maxSecsToLive() default 0; - - /** - * The frequency (in seconds) that cache trimming should occur. - *

- * This is a hint for cache implementations that use background cache trimming. - *

- */ - int trimFrequency() default 0; -} diff --git a/src/main/java/com/avaje/ebean/annotation/ChangeLog.java b/src/main/java/com/avaje/ebean/annotation/ChangeLog.java deleted file mode 100644 index 9fa699498..000000000 --- a/src/main/java/com/avaje/ebean/annotation/ChangeLog.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marks an entity bean as being included in the change logging. - */ -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface ChangeLog { - - /** - * Specify if inserts should be explicitly Included or Excluded. - *

- * If not defined explicitly then the server default behaviour defined - * on ServerConfig is used. - *

- */ - ChangeLogInsertMode inserts() default ChangeLogInsertMode.DEFAULT; - - /** - * When specified only include update requests that have at least one - * of the given properties as a dirty property. - *

- * This provides a way to filter requests to include in the change log such that - * only updates that include at least one of the given properties is included - * in the change log. - *

- */ - String[] updatesThatInclude() default {}; -} diff --git a/src/main/java/com/avaje/ebean/annotation/ChangeLogInsertMode.java b/src/main/java/com/avaje/ebean/annotation/ChangeLogInsertMode.java deleted file mode 100644 index 2cb17e9de..000000000 --- a/src/main/java/com/avaje/ebean/annotation/ChangeLogInsertMode.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.avaje.ebean.annotation; - -/** - * The mode used to determine if inserts should be included or not for a given bean type. - */ -public enum ChangeLogInsertMode { - - /** - * Use the default behaviour as defined on ServerConfig. - */ - DEFAULT, - - /** - * Include inserts in the change log. - */ - INCLUDE, - - /** - * Exclude inserts in the change log. - */ - EXCLUDE -} diff --git a/src/main/java/com/avaje/ebean/annotation/CreatedTimestamp.java b/src/main/java/com/avaje/ebean/annotation/CreatedTimestamp.java deleted file mode 100644 index d53e62baf..000000000 --- a/src/main/java/com/avaje/ebean/annotation/CreatedTimestamp.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * For a timestamp property that is set to the datetime when the entity is - * created/inserted. - *

- * This is effectively an alias for @WhenCreated which was added as it hints - * towards a better naming convention (WhenCreated, WhenModified). - *

- *

- * An alternative to using this annotation would be to use insertable=false, - * updateable=false with @Column and have the DB insert the current time - * (default value on the DB column is SYSTIME etc). - *

- *

- * The downside to this approach is that the inserted entity does not have the - * timestamp value after the insert has occurred. You need to fetch the entity - * back to get the inserted timestamp if you want to used it. - *

- *

- *

Example:

- *
{@code
- *
- *   @CreatedTimestamp
- *   Timestamp whenCreated;
- *
- * }
- */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface CreatedTimestamp { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/DbArray.java b/src/main/java/com/avaje/ebean/annotation/DbArray.java deleted file mode 100644 index 8d3fd5d24..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DbArray.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify a collection property that will be stored into a DB ARRAY type. - *

- * If the target database does not support ARRAY type (so not Postgres) - * then the collection will be stored in JSON format into a VARCHAR column. - *

- *

- *

Example:

- *
{@code
- *
- * // Store as ARRAY of UUID on Postgres
- * @DbArray
- * List uids = new ArrayList<>();
- *
- * // Store as ARRAY on Postgres
- * @DbArray
- * List phoneNumbers = new ArrayList<>();
- *
- * // Store as ARRAY of INTEGER on Postgres
- * @DbArray
- * List someLongs = new ArrayList<>();
- *
- * }
- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface DbArray { - - /** - * For VARCHAR storage specify the column length (defaults to 1000). - */ - int length() default 0; -} diff --git a/src/main/java/com/avaje/ebean/annotation/DbComment.java b/src/main/java/com/avaje/ebean/annotation/DbComment.java deleted file mode 100644 index e5bac32e5..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DbComment.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * A database table or column comment. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE}) -public @interface DbComment { - - /** - * The database table or column comment. - */ - String value(); -} \ No newline at end of file diff --git a/src/main/java/com/avaje/ebean/annotation/DbEnumType.java b/src/main/java/com/avaje/ebean/annotation/DbEnumType.java deleted file mode 100644 index 88d7b8f6c..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DbEnumType.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.avaje.ebean.annotation; - -/** - * Specify the DB storage type used to with @DbEnumValue. - */ -public enum DbEnumType { - - /** - * Store values as database INTEGER. - */ - INTEGER, - - /** - * Store values as database VARCHAR. - */ - VARCHAR -} diff --git a/src/main/java/com/avaje/ebean/annotation/DbEnumValue.java b/src/main/java/com/avaje/ebean/annotation/DbEnumValue.java deleted file mode 100644 index b4c1a1679..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DbEnumValue.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify a method on an Enum that returns the value that should be stored in the DB. - *

- * This is the preferred option for mapping Enum's to DB values (preferred over the JPA - * standard @Enumerated and Ebean's @EnumValue annotations). - *

- *

Example:

- *
{@code
- *
- *   public enum Status {
- *     NEW("N"),
- *     ACTIVE("A"),
- *     INACTIVE("I");
- *
- *     String dbValue;
- *     Status(String dbValue) {
- *       this.dbValue = dbValue;
- *     }
- *
- *     @DbEnumValue
- *     public String getValue() {
- *       return dbValue;
- *     }
- *   }
- *
- * }
- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.METHOD) -public @interface DbEnumValue { - - /** - * Specify the database type used to store the values (VARCHAR or INTEGER). - */ - DbEnumType storage() default DbEnumType.VARCHAR; - -} \ No newline at end of file diff --git a/src/main/java/com/avaje/ebean/annotation/DbHstore.java b/src/main/java/com/avaje/ebean/annotation/DbHstore.java deleted file mode 100644 index 87ede7183..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DbHstore.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Used for mapping a Map type property to Postgres HSTORE data type. - *

- * The Map property should have keys and values of type String. - *

- *

- *

Example:

- *
{@code
- *
- *   @DbHstore
- *   Map tags;
- *
- * }
- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface DbHstore { - - /** - * For VARCHAR storage specify the column length (defaults to 1000). - */ - int length() default 0; -} diff --git a/src/main/java/com/avaje/ebean/annotation/DbJson.java b/src/main/java/com/avaje/ebean/annotation/DbJson.java deleted file mode 100644 index 07cf1564e..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DbJson.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify a property holding JSON content. - *

- * By default the content will be stored in a DB Clob except on Postgres where DB JSON type is used. - *

- *

Example:

- *
{@code
- *
- * // Store as JSON on Postgres or Clob on other databases
- * @DbJson
- * Map content;
- *
- * }
- *

- *

Example with JSONB storage

- *
{@code
- *
- * // Store as JSONB on Postgres or Clob on other databases
- * @DbJson(storage = DbJsonType.JSONB)
- * Map content;
- *
- * }
- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface DbJson { - - /** - * Specify the database type used to store the JSON content. - */ - DbJsonType storage() default DbJsonType.JSON; - - /** - * For VARCHAR storage specify the column length (defaults to 3000). - */ - int length() default 0; -} diff --git a/src/main/java/com/avaje/ebean/annotation/DbJsonB.java b/src/main/java/com/avaje/ebean/annotation/DbJsonB.java deleted file mode 100644 index 418294006..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DbJsonB.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify a property holding JSON content. - *

- * The content will be stored on Postgres using it's JSONB type and as Clob for other databases. - *

- *

- * This is equivalent to using @DbJson(storage = DbJsonType.JSONB) - *

- *

- *

Example:

- *
{@code
- *
- * // Store as JSONB on Postgres or Clob on other databases
- * @DbJsonB
- * Map content;
- *
- * }
- *

- *

Equivalent to:

- *
{@code
- *
- * // Store as JSONB on Postgres or Clob on other databases
- * @DbJson(storage = DbJsonType.JSONB)
- * Map content;
- *
- * }
- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface DbJsonB { - - /** - * For VARCHAR storage specify the column length. - */ - int length() default 0; -} diff --git a/src/main/java/com/avaje/ebean/annotation/DbJsonType.java b/src/main/java/com/avaje/ebean/annotation/DbJsonType.java deleted file mode 100644 index 75ee1d930..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DbJsonType.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.avaje.ebean.annotation; - -/** - * Specify the DB storage type used to store JSON content. - */ -public enum DbJsonType { - - /** - * Store as JSON on Postgres and for other databases store as CLOB. - */ - JSON, - - /** - * Store as JSONB on Postgres and for other databases store as CLOB. - */ - JSONB, - - /** - * Store as database VARCHAR. - */ - VARCHAR, - - /** - * Store as database CLOB. - */ - CLOB, - - /** - * Store as database BLOB. - */ - BLOB -} diff --git a/src/main/java/com/avaje/ebean/annotation/DocCode.java b/src/main/java/com/avaje/ebean/annotation/DocCode.java deleted file mode 100644 index 582ba71f2..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DocCode.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Used to indicate that a particular string property should be treated as a 'code' and not analysed for text searching. - *

- * By default all Id properties and all Enum properties are treated as 'code' and not analysed. - *

- */ -@Target({ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface DocCode { - - /** - * Set to true to have the property additionally stored separately from _source. - */ - boolean store() default false; - - /** - * Set a boost value specific to this property. - */ - float boost() default 1; - - /** - * Set a value to use instead of null. - */ - String nullValue() default ""; -} \ No newline at end of file diff --git a/src/main/java/com/avaje/ebean/annotation/DocEmbedded.java b/src/main/java/com/avaje/ebean/annotation/DocEmbedded.java deleted file mode 100644 index 5cfd92ce7..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DocEmbedded.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify the property is included in the parent document store index. - *
{@code
- *
- *
- * @DocStore
- * @Entity @Table(name = "o_order")
- * public class Order {
- *
- *   ...
- *   // include some customer details including
- *   // nested billingAddress
- *   @DocEmbedded(doc = "id,status,name,billingAddress(*,country(*)")
- *   @ManyToOne
- *   Customer customer;
- *
- *
- * }
- */ -@Target({ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface DocEmbedded { - - /** - * The properties on the embedded bean to include in the index. - */ - String doc() default ""; - -} diff --git a/src/main/java/com/avaje/ebean/annotation/DocMapping.java b/src/main/java/com/avaje/ebean/annotation/DocMapping.java deleted file mode 100644 index 10c1fc857..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DocMapping.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify the entity type maps to a document store (like ElasticSearch). - */ -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface DocMapping { - - /** - * The property name the mapping applies to. - */ - String name(); - - /** - * Mapping options. - */ - DocProperty options(); -} diff --git a/src/main/java/com/avaje/ebean/annotation/DocProperty.java b/src/main/java/com/avaje/ebean/annotation/DocProperty.java deleted file mode 100644 index ee4aaa21b..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DocProperty.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify the entity type maps to a document store (like ElasticSearch). - */ -@Target({ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface DocProperty { - - /** - * Set this to true to indicate that this property should be un-analysed. - */ - boolean code() default false; - - /** - * Set this to true to get an additional un-analysed 'raw' field to use for sorting etc. - */ - boolean sortable() default false; - - /** - * Set to true to have the property additionally stored separately from _source. - */ - boolean store() default false; - - /** - * Set a boost value specific to this property. - */ - float boost() default 1; - - /** - * Set a value to use instead of null. - */ - String nullValue() default ""; - - /** - * Set this to false to exclude this from the _all property. - */ - boolean includeInAll() default true; - - /** - * The analyzer to use. - */ - String analyzer() default ""; - - /** - * The analyzer to use for searches. - */ - String searchAnalyzer() default ""; - - /** - * The index options for this property. - */ - Option options() default Option.DEFAULT; - - /** - * Set this to false such that doc values are not stored separately for this property. - */ - boolean docValues() default true; - - /** - * Set a copyTo field. - */ - String copyTo() default ""; - - /** - * Set to false to disable the field from indexing, it will only be get/set in _source. - */ - boolean enabled() default true; - - /** - * Set to false such that norms are not stored. - */ - boolean norms() default true; - - /** - * Index options for a property. - */ - enum Option { - - /** - * Only index the doc number. - */ - DOCS, - - /** - * Doc number and term frequencies are indexed. - */ - FREQS, - - /** - * Doc number, term frequencies and term positions are indexed. - */ - POSITIONS, - - /** - * Doc number, term frequencies, term positions and start/end offsets are indexed. - */ - OFFSETS, - - /** - * Use the default which means analysed string properties use POSITIONS as the default and all other types use DOCS. - */ - DEFAULT - } -} diff --git a/src/main/java/com/avaje/ebean/annotation/DocSortable.java b/src/main/java/com/avaje/ebean/annotation/DocSortable.java deleted file mode 100644 index ba554c1c5..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DocSortable.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Used to indicate that a particular string property should support sorting. What this typically means is that - * for ElasticSearch an additional 'raw' field is added that stores the un-analysed value. This un-analysed value - * can be used for sorting etc and the original field used for text searching. - *

- * For example, customer name and product name are good candidates for marking with @DocSortable. - *

- */ -@Target({ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface DocSortable { - - /** - * Set to true to have the property additionally stored separately from _source. - */ - boolean store() default false; - - /** - * Set a boost value specific to this property. - */ - float boost() default 1; - - /** - * Set a value to use instead of null. - */ - String nullValue() default ""; -} diff --git a/src/main/java/com/avaje/ebean/annotation/DocStore.java b/src/main/java/com/avaje/ebean/annotation/DocStore.java deleted file mode 100644 index 808c35977..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DocStore.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify the entity type maps to a document store (like ElasticSearch). - */ -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface DocStore { - - /** - * A unique Id used when queuing reindex events. - */ - String queueId() default ""; - - /** - * The ElasticSearch index name. If left unspecified the short name of the bean type is used. - */ - String indexName() default ""; - - /** - * The ElasticSearch index type. If left unspecified the short name of the bean type is used. - */ - String indexType() default ""; - - /** - * The number of shards this index should use. - */ - int shards() default 0; - - /** - * The number of replicas this index should use. - */ - int replicas() default 0; - - /** - * Additional mapping that can be defined on the properties. - */ - DocMapping[] mapping() default {}; - - /** - * Specify the behavior when bean Insert, Update, Delete events occur. - */ - DocStoreMode persist() default DocStoreMode.DEFAULT; - - /** - * Specify the behavior when bean Insert occurs. - */ - DocStoreMode insert() default DocStoreMode.DEFAULT; - - /** - * Specify the behavior when bean Update occurs. - */ - DocStoreMode update() default DocStoreMode.DEFAULT; - - /** - * Specify the behavior when bean Delete occurs. - */ - DocStoreMode delete() default DocStoreMode.DEFAULT; - - /** - * Specify to include only some properties in the doc store document. - *

- * If this is left as default then all scalar properties are included, - * all @ManyToOne properties are included with just the nested id property - * and no @OneToMany properties are included. - *

- *

- * Note that typically DocStoreEmbedded is used on @ManyToOne and @OneToMany - * properties to indicate what part of the nested document should be included. - *

- *

Example:

- *
{@code
-   *
-   * // only include the customer id and name
-   * @DocStore(doc = "id,name")
-   * @Entity @Table(name = "o_order")
-   * public class Customer {
-   *
-   * }
- */ - String doc() default ""; -} diff --git a/src/main/java/com/avaje/ebean/annotation/DocStoreMode.java b/src/main/java/com/avaje/ebean/annotation/DocStoreMode.java deleted file mode 100644 index 03297dbc6..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DocStoreMode.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.avaje.ebean.annotation; - -/** - * Defines the behavior options when a Insert, Update or Delete event occurs - * on a bean with an associated ElasticSearch index. - *

- * For some indexes or some transactions it can be beneficial to queue the event - * for later processing rather than look to update ElasticSearch at that time. - *

- */ -public enum DocStoreMode { - - /** - * Add the event to the queue for processing later (delaying the update to the document store). - */ - QUEUE, - - /** - * Update the document store when transaction succeeds. - */ - UPDATE, - - /** - * Ignore the event and not update the document store. - *

- * This can be used on a index or for a transaction where you want to have more - * manual programmatic control over the updating of the document store. Say you want to - * IGNORE on a particular transaction and instead manually queue a bulk update. - *

- */ - IGNORE, - - /** - * The actual mode of QUEUE, UPDATE or IGNORE is set from the default configuration. - */ - DEFAULT - -} diff --git a/src/main/java/com/avaje/ebean/annotation/Draft.java b/src/main/java/com/avaje/ebean/annotation/Draft.java deleted file mode 100644 index 26f7c3398..000000000 --- a/src/main/java/com/avaje/ebean/annotation/Draft.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marks a boolean property on a @Draftable bean that indicates if the bean instance is a 'draft' or 'live' bean. - * The property is transient and has no underlying DB column. - *

- * For beans returned from an asDraft() query this property will be set to true. - *

- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface Draft { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/DraftDirty.java b/src/main/java/com/avaje/ebean/annotation/DraftDirty.java deleted file mode 100644 index 1ae2e895a..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DraftDirty.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marks a boolean property on a @Draftable bean that only exists on the 'draft' table - * and is used to detect when a draft has unpublished changes. - *

- * This property will automatically have it's value set to true when a draft is saved and - * automatically have it's value set to false when the bean is published. - *

- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface DraftDirty { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/DraftOnly.java b/src/main/java/com/avaje/ebean/annotation/DraftOnly.java deleted file mode 100644 index 5c7029bdb..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DraftOnly.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marks a property on a @Draftable bean that only exists on the 'draft' and not the 'live' table. - *

- * Typically this would be used on a property that is used as part of application 'workflow' such as - * a publish workflow status or when publish timestamp. - *

- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface DraftOnly { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/DraftReset.java b/src/main/java/com/avaje/ebean/annotation/DraftReset.java deleted file mode 100644 index 6063cf081..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DraftReset.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marks a property on a @Draftable bean that is set to null on the 'draft bean' on publish. - *

- * This is expected to be put on properties that get 'reset' or 'cleared' after a publish. - * These properties might represent a publish comment or publish timestamp. - *

- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface DraftReset { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/Draftable.java b/src/main/java/com/avaje/ebean/annotation/Draftable.java deleted file mode 100644 index 15e14369b..000000000 --- a/src/main/java/com/avaje/ebean/annotation/Draftable.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Used to indicate an entity bean that has 'draftable' support. - *

- * This means that a second set of tables is created to hold draft versions of - * the rows and that these can then be published which effectively copies/transfers - * the values from the 'draft' table to the 'live' table. - *

- *

- * Ebean Query supports 'find as draft' which builds the resulting object graph using - * the draft tables. This object graph is typically edited, approved in some application - * specific manor and then published. - *

- *

- * EbeanServer has a publish method which transfers/copies the draft object graph to - * the 'live' tables. - *

- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface Draftable { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/DraftableElement.java b/src/main/java/com/avaje/ebean/annotation/DraftableElement.java deleted file mode 100644 index a932c8e36..000000000 --- a/src/main/java/com/avaje/ebean/annotation/DraftableElement.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Used to indicate an entity bean that has 'draftable' support but it not a 'top level' - * (or root level) bean but instead child related to another @Draftable entity bean. - *

- * Relationships to @DraftableElements (@OneToMany, @ManyToMany etc) are automatically - * deemed to have Cascade.ALL for save and delete (as well as orphan removal mode). - *

- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface DraftableElement { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/EbeanDDL.java b/src/main/java/com/avaje/ebean/annotation/EbeanDDL.java deleted file mode 100644 index a22f22e15..000000000 --- a/src/main/java/com/avaje/ebean/annotation/EbeanDDL.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.avaje.ebean.annotation; - -import javax.validation.constraints.NotNull; -/** - * special validation group for @NotNull annotation to enforce NOT NULL generation on DDL. - * Normally if you put the {@link NotNull} annotation on a property, Ebean will only generate a - * NOT NULL in DDL if you do not change the validation-groups! - */ -public interface EbeanDDL { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/EmbeddedColumns.java b/src/main/java/com/avaje/ebean/annotation/EmbeddedColumns.java deleted file mode 100644 index b63ecfebf..000000000 --- a/src/main/java/com/avaje/ebean/annotation/EmbeddedColumns.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify property name to db column mapping for Embedded beans. - *

- * This is designed to be easier to use than the AttributeOverride annotation in - * standard JPA. - *

- */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface EmbeddedColumns { - - /** - * A list of property names mapped to DB columns. - *

- * For example currency=IN_CURR, amount=IN_AMOUNT - *

- *

- * Where currency and amount are properties and IN_CURR and IN_AMOUNT are the - * respective DB columns these properties will be mapped to. - *

- */ - String columns() default ""; - -} diff --git a/src/main/java/com/avaje/ebean/annotation/Encrypted.java b/src/main/java/com/avaje/ebean/annotation/Encrypted.java deleted file mode 100644 index 25c1697c0..000000000 --- a/src/main/java/com/avaje/ebean/annotation/Encrypted.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify that the property is stored in encrypted form. - */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Encrypted { - - /** - * When true try to use DB encryption rather than local java encryption. - */ - boolean dbEncryption() default true; - - /** - * Used to specify the DB column length. - */ - int dbLength() default 0; -} diff --git a/src/main/java/com/avaje/ebean/annotation/EnumValue.java b/src/main/java/com/avaje/ebean/annotation/EnumValue.java deleted file mode 100644 index d34294327..000000000 --- a/src/main/java/com/avaje/ebean/annotation/EnumValue.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Enables you to specify a value to use to persist for an enum value. - *
{@code
- *
- * public enum Status {
- *
- *   @EnumValue("N")
- *   NEW,
- *
- *   @EnumValue("A")
- *   ACTIVE,
- *
- *   @EnumValue("I")
- *   INACTIVE,
- * }
- *
- * }
- *

- * This is an alternative to using the JPA standard approach or Ebean's - * {@link DbEnumValue} annotation. - *

- *

- * Note that if all the EnumValue values are parsable as Integers then Ebean - * will persist and fetch them as integers - otherwise they will be persisted - * and fetched as strings. - *

- */ -@Target({ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface EnumValue { - - /** - * Specify the value to persist for a specific enum value. - *

- * If all the values are parsable as Integers then Ebean will persist and - * fetch them as integers rather than strings. - *

- */ - String value(); -} diff --git a/src/main/java/com/avaje/ebean/annotation/Expose.java b/src/main/java/com/avaje/ebean/annotation/Expose.java deleted file mode 100644 index 829540724..000000000 --- a/src/main/java/com/avaje/ebean/annotation/Expose.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/* - Copied from gson!!! - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface Expose { - - /** - * If {@code true}, the field marked with this annotation is written out in the JSON while - * serializing. If {@code false}, the field marked with this annotation is skipped from the - * serialized output. Defaults to {@code true}. - */ - boolean serialize() default true; - - /** - * If {@code true}, the field marked with this annotation is deserialized from the JSON. - * If {@code false}, the field marked with this annotation is skipped during deserialization. - * Defaults to {@code true}. - */ - boolean deserialize() default true; -} \ No newline at end of file diff --git a/src/main/java/com/avaje/ebean/annotation/History.java b/src/main/java/com/avaje/ebean/annotation/History.java deleted file mode 100644 index 9548b3cf1..000000000 --- a/src/main/java/com/avaje/ebean/annotation/History.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marks an entity bean as having history support. - *

- * In Postgres for example this means there is an associated history table which is - * typically automatically populated via database triggers. - *

- */ -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface History { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/HistoryExclude.java b/src/main/java/com/avaje/ebean/annotation/HistoryExclude.java deleted file mode 100644 index bae53aa35..000000000 --- a/src/main/java/com/avaje/ebean/annotation/HistoryExclude.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marks a property as being excluded from history. - *

- * This means the property values are not maintained in the history table. Typically this - * would be placed on relatively large properties (Clobs, Blobs, large varchar columns etc) - * that are considered not interesting enough to maintain history on excluding them reduces - * underlying database costs. - *

- *

- * When placed on a ManyToMany this means that the intersection table does not have history - * support. - *

- */ -@Target({ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface HistoryExclude { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/Index.java b/src/main/java/com/avaje/ebean/annotation/Index.java deleted file mode 100644 index 426320f5f..000000000 --- a/src/main/java/com/avaje/ebean/annotation/Index.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Repeatable; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * An annotation for declaring an index. - * - * @author rvbiljouw - */ -@Target({ElementType.TYPE, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -@Repeatable(Indices.class) -public @interface Index { - - /** - * Name of the index. If left blank a name is derived using the built in naming convention. - */ - String name() default ""; - - /** - * If set true indicates this is a unique index. - */ - boolean unique() default false; - - /** - * When placed on the class (rather than field) you can specify the columns - * to include in the index in order. - *

- * Wnen placed on a field, and columnNames are specified, the field-column has to be included. - * You can use "${fa}" for alias - */ - String[] columnNames() default {}; - -} diff --git a/src/main/java/com/avaje/ebean/annotation/Indices.java b/src/main/java/com/avaje/ebean/annotation/Indices.java deleted file mode 100644 index 0e74559f7..000000000 --- a/src/main/java/com/avaje/ebean/annotation/Indices.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * An annotation for declaring multiple indices at class or field level. - * - * @author Roland Praml, FOCONIS AG - */ -@Target({ElementType.TYPE, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Indices { - - /** - * Array with {@link Index} definitions. - */ - Index[] value() default {}; -} diff --git a/src/main/java/com/avaje/ebean/annotation/JsonIgnore.java b/src/main/java/com/avaje/ebean/annotation/JsonIgnore.java deleted file mode 100644 index 822882a0c..000000000 --- a/src/main/java/com/avaje/ebean/annotation/JsonIgnore.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Similar to Jackson JsonIgnore but provides the option to just ignore serialize or deserialize. - *

- * This provides the same features as Expose but from the opposite perspective which is probably - * more common and more familiar to Jackson users. - *

- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface JsonIgnore { - - /** - * If {@code true}, the field marked with this annotation is written out in the JSON while - * serializing. If {@code false}, the field marked with this annotation is skipped from the - * serialized output. Defaults to {@code false}. - */ - boolean serialize() default false; - - /** - * If {@code true}, the field marked with this annotation is deserialized from the JSON. - * If {@code false}, the field marked with this annotation is skipped during deserialization. - * Defaults to {@code false}. - */ - boolean deserialize() default false; -} diff --git a/src/main/java/com/avaje/ebean/annotation/PrivateOwned.java b/src/main/java/com/avaje/ebean/annotation/PrivateOwned.java deleted file mode 100644 index a7d58f978..000000000 --- a/src/main/java/com/avaje/ebean/annotation/PrivateOwned.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify that the elements of a OneToMany are private owned. - *

- * This means that if they are removed from the List/Set/Map they will be - * deleted when their parent object is saved. - *

- *

- * This could also be described as deleting orphans - in that beans removed from - * the List/Set/Map will be deleted automatically when the parent bean is saved. - * They are considered 'orphans' when they have been removed from the collection - * in that they are no longer associated/linked to their parent bean. - *

- */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface PrivateOwned { - - /** - * Set this to false if you don't want cascade REMOVE on this relationship. - *

- * That is, by default PrivateOwned implicitly adds a cascade REMOVE to the - * relationship and if you don't want that you need to set this to false. - *

- */ - boolean cascadeRemove() default true; - -} diff --git a/src/main/java/com/avaje/ebean/annotation/ReadAudit.java b/src/main/java/com/avaje/ebean/annotation/ReadAudit.java deleted file mode 100644 index 33d51159f..000000000 --- a/src/main/java/com/avaje/ebean/annotation/ReadAudit.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marks an entity bean as being included in read auditing. - */ -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface ReadAudit { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/SoftDelete.java b/src/main/java/com/avaje/ebean/annotation/SoftDelete.java deleted file mode 100644 index 3cc7a1f35..000000000 --- a/src/main/java/com/avaje/ebean/annotation/SoftDelete.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Used to indicate a property on an entity bean used to control 'soft delete' - * (also known as 'logical delete'). - *

- * The property should be of type boolean. - *

- *
{@code
- *
- * @SoftDelete
- * boolean deleted;
- *
- * }
- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface SoftDelete { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/Sql.java b/src/main/java/com/avaje/ebean/annotation/Sql.java deleted file mode 100644 index a37c70d96..000000000 --- a/src/main/java/com/avaje/ebean/annotation/Sql.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Mark and entity bean that is used solely via RawSql. - *

- * This means the entity bean has no base table specified (via @Table). - *

- */ -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Sql { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/UpdateMode.java b/src/main/java/com/avaje/ebean/annotation/UpdateMode.java deleted file mode 100644 index 0353737bc..000000000 --- a/src/main/java/com/avaje/ebean/annotation/UpdateMode.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specify the update mode for the specific entity type. - *

- * Control whether all 'loaded' properties are included in an Update or whether - * just properties that have changed will be included in the update. - *

- *

- * Note that the default can be set via ebean.properties. - *

- *

- *

- * ## Set to update all loaded properties
- * ebean.updateChangesOnly=false
- * 
- */ -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface UpdateMode { - - /** - * Set to false if you want to include all the 'loaded' properties in the - * update. Otherwise, just the properties that have changed will be included - * in the update. - */ - boolean updateChangesOnly() default true; - -} diff --git a/src/main/java/com/avaje/ebean/annotation/UpdatedTimestamp.java b/src/main/java/com/avaje/ebean/annotation/UpdatedTimestamp.java deleted file mode 100644 index 8a181369e..000000000 --- a/src/main/java/com/avaje/ebean/annotation/UpdatedTimestamp.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * For a timestamp property that is set to the datetime when the entity was last - * updated. - *

- * This is effectively an alias for @WhenModified which was added as it hints - * towards a better naming convention (WhenCreated, WhenModified). - *

- */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface UpdatedTimestamp { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/View.java b/src/main/java/com/avaje/ebean/annotation/View.java deleted file mode 100644 index 0b41ba2b9..000000000 --- a/src/main/java/com/avaje/ebean/annotation/View.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotate an entity bean with @View to indicates the bean is based on a view. - *

- * As such typically the view is defined in extra-ddl.xml using - * create or replace view .... - *

- *

- * When using extra-ddl.xml Ebean will run the resulting DDL script after the - * create-all DDL (which is typically used during development) and for - * DB Migration will copy the scripts as repeatable migration scripts that - * will be run by FlywayDb (or Ebean's own migration runner) when their MD5 hash changes. - *

- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface View { - - /** - * The name of the view this entity bean is based on. - */ - String name(); - - /** - * Tables this view is dependent on. - *

- * This is used with l2 caching to invalidate the query cache. Changes to these - * tables invalidate the query cache for the entity based on this view. - *

- */ - String[] dependentTables() default {}; -} diff --git a/src/main/java/com/avaje/ebean/annotation/WhenCreated.java b/src/main/java/com/avaje/ebean/annotation/WhenCreated.java deleted file mode 100644 index 6779254d1..000000000 --- a/src/main/java/com/avaje/ebean/annotation/WhenCreated.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * For a timestamp property that is set to the datetime when the entity is - * created/inserted. - *

- * This is effectively an alias for @CreatedTimestamp and added to hint - * towards a better naming convention (WhenCreated, WhenModified). - *

- *

- * An alternative to using this annotation would be to use insertable=false, - * updateable=false with @Column and have the DB insert the current time - * (default value on the DB column is SYSTIME etc). - *

- *

- * The downside to this approach is that the inserted entity does not have the - * timestamp value after the insert has occurred. You need to fetch the entity - * back to get the inserted timestamp if you want to used it. - *

- *

- *

Example:

- *
{@code
- *
- *   @WhenCreated
- *   Timestamp whenCreated;
- *
- * }
- */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface WhenCreated { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/WhenModified.java b/src/main/java/com/avaje/ebean/annotation/WhenModified.java deleted file mode 100644 index 3e9838816..000000000 --- a/src/main/java/com/avaje/ebean/annotation/WhenModified.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * For a timestamp property that is set to the datetime when the entity was last modified. - *

- * This is effectively an alias for @UpdatedTimestamp and added to hint - * towards a better naming convention (WhenCreated, WhenModified). - *

- */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface WhenModified { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/WhoCreated.java b/src/main/java/com/avaje/ebean/annotation/WhoCreated.java deleted file mode 100644 index 8bb199834..000000000 --- a/src/main/java/com/avaje/ebean/annotation/WhoCreated.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Mapped onto a entity bean property that represents the user id of - * who created the entity> - *

- * To use this annotation you need to implement CurrentUserProvider. - * The type of the bean property should match the type returned by - * CurrentUserProvider. - *

- *

Example:

- *
{@code
- *
- *   @WhoCreated
- *   String whoCreated;
- *
- * }
- */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface WhoCreated { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/WhoModified.java b/src/main/java/com/avaje/ebean/annotation/WhoModified.java deleted file mode 100644 index 5bd2c9de0..000000000 --- a/src/main/java/com/avaje/ebean/annotation/WhoModified.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.avaje.ebean.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Mapped onto a entity bean property that represents the user id of - * who last modified the entity> - *

- * To use this annotation you need to implement CurrentUserProvider. - * The type of the bean property should match the type returned by - * CurrentUserProvider. - *

- *

Example:

- *
{@code
- *
- *   @WhoModified
- *   String whoModified;
- *
- * }
- */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface WhoModified { - -} diff --git a/src/main/java/com/avaje/ebean/annotation/package.html b/src/main/java/com/avaje/ebean/annotation/package.html deleted file mode 100644 index a3cb62253..000000000 --- a/src/main/java/com/avaje/ebean/annotation/package.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - Extra deployment annotations - - -Extra deployment annotations - -

- Extra deployment annotations for entity beans. -

- - -