diff --git a/ebean-api/src/main/java/io/ebean/BeanFinder.java b/ebean-api/src/main/java/io/ebean/BeanFinder.java index 771736947..7c5416363 100644 --- a/ebean-api/src/main/java/io/ebean/BeanFinder.java +++ b/ebean-api/src/main/java/io/ebean/BeanFinder.java @@ -1,6 +1,5 @@ package io.ebean; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.List; import java.util.Optional; @@ -81,7 +80,6 @@ public abstract class BeanFinder { *

* Equivalent to {@link Database#reference(Class, Object)} */ - @Nonnull public T ref(I id) { return db().reference(type, id); } @@ -111,7 +109,6 @@ public abstract class BeanFinder { /** * Retrieves all entities of the given type. */ - @Nonnull public List findAll() { return query().findList(); } diff --git a/ebean-api/src/main/java/io/ebean/DB.java b/ebean-api/src/main/java/io/ebean/DB.java index 9bcfb047d..c855b9c1e 100644 --- a/ebean-api/src/main/java/io/ebean/DB.java +++ b/ebean-api/src/main/java/io/ebean/DB.java @@ -6,7 +6,6 @@ import io.ebean.plugin.Property; import io.ebean.text.csv.CsvReader; import io.ebean.text.json.JsonContext; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.persistence.OptimisticLockException; import javax.persistence.PersistenceException; @@ -523,7 +522,6 @@ public final class DB { * @param bean The entity bean to check uniqueness on * @return a set of Properties if constraint validation was detected or empty list. */ - @Nonnull public static Set checkUniqueness(Object bean) { return getDefault().checkUniqueness(bean); } @@ -531,7 +529,6 @@ public final class DB { /** * Same as {@link #checkUniqueness(Object)}. but with given transaction. */ - @Nonnull public static Set checkUniqueness(Object bean, Transaction transaction) { return getDefault().checkUniqueness(bean, transaction); } diff --git a/ebean-api/src/main/java/io/ebean/Database.java b/ebean-api/src/main/java/io/ebean/Database.java index 68efaf11e..b0c862f56 100644 --- a/ebean-api/src/main/java/io/ebean/Database.java +++ b/ebean-api/src/main/java/io/ebean/Database.java @@ -10,7 +10,6 @@ import io.ebean.plugin.SpiServer; import io.ebean.text.csv.CsvReader; import io.ebean.text.json.JsonContext; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.persistence.OptimisticLockException; import javax.persistence.PersistenceException; @@ -949,7 +948,6 @@ public interface Database { * @param beanType the type of entity bean * @param id the id value */ - @Nonnull T reference(Class beanType, Object id); /** @@ -1295,13 +1293,11 @@ public interface Database { * @param bean The entity bean to check uniqueness on * @return a set of Properties if constraint validation was detected or empty list. */ - @Nonnull Set checkUniqueness(Object bean); /** * Same as {@link #checkUniqueness(Object)}. but with given transaction. */ - @Nonnull Set checkUniqueness(Object bean, Transaction transaction); /** diff --git a/ebean-api/src/main/java/io/ebean/DtoQuery.java b/ebean-api/src/main/java/io/ebean/DtoQuery.java index 69ed034ef..e46ee7105 100644 --- a/ebean-api/src/main/java/io/ebean/DtoQuery.java +++ b/ebean-api/src/main/java/io/ebean/DtoQuery.java @@ -1,6 +1,5 @@ package io.ebean; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.List; import java.util.Optional; @@ -43,7 +42,6 @@ public interface DtoQuery extends CancelableQuery { /** * Execute the query returning a list. */ - @Nonnull List findList(); /** @@ -53,7 +51,6 @@ public interface DtoQuery extends CancelableQuery { * resultSet and potentially connection and MUST be closed. We should use * QueryIterator in a try with resource block. */ - @Nonnull QueryIterator findIterate(); /** @@ -63,7 +60,6 @@ public interface DtoQuery extends CancelableQuery { * resultSet and potentially connection and MUST be closed. We should use * the Stream in a try with resource block. */ - @Nonnull Stream findStream(); /** @@ -105,7 +101,6 @@ public interface DtoQuery extends CancelableQuery { /** * Execute the query returning an optional bean. */ - @Nonnull Optional findOneOrEmpty(); /** diff --git a/ebean-api/src/main/java/io/ebean/Ebean.java b/ebean-api/src/main/java/io/ebean/Ebean.java index eabc3c5b4..f1ce4aac3 100644 --- a/ebean-api/src/main/java/io/ebean/Ebean.java +++ b/ebean-api/src/main/java/io/ebean/Ebean.java @@ -6,7 +6,6 @@ import io.ebean.plugin.Property; import io.ebean.text.csv.CsvReader; import io.ebean.text.json.JsonContext; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.persistence.OptimisticLockException; import javax.persistence.PersistenceException; @@ -506,7 +505,6 @@ public final class Ebean { * @param bean The entity bean to check uniqueness on * @return a set of Properties if constraint validation was detected or empty list. */ - @Nonnull public static Set checkUniqueness(Object bean) { return getDefault().checkUniqueness(bean); } @@ -514,7 +512,6 @@ public final class Ebean { /** * Same as {@link #checkUniqueness(Object)}. but with given transaction. */ - @Nonnull public static Set checkUniqueness(Object bean, Transaction transaction) { return getDefault().checkUniqueness(bean, transaction); } diff --git a/ebean-api/src/main/java/io/ebean/EmptyPagedList.java b/ebean-api/src/main/java/io/ebean/EmptyPagedList.java index bbf72a731..74886c985 100644 --- a/ebean-api/src/main/java/io/ebean/EmptyPagedList.java +++ b/ebean-api/src/main/java/io/ebean/EmptyPagedList.java @@ -1,6 +1,5 @@ package io.ebean; -import javax.annotation.Nonnull; import java.util.Collections; import java.util.List; import java.util.concurrent.Future; @@ -25,13 +24,11 @@ public class EmptyPagedList implements PagedList { // do nothing } - @Nonnull @Override public Future getFutureCount() { return null; } - @Nonnull @Override public List getList() { return Collections.emptyList(); diff --git a/ebean-api/src/main/java/io/ebean/ExpressionList.java b/ebean-api/src/main/java/io/ebean/ExpressionList.java index e91846e08..80587ebf2 100644 --- a/ebean-api/src/main/java/io/ebean/ExpressionList.java +++ b/ebean-api/src/main/java/io/ebean/ExpressionList.java @@ -6,7 +6,6 @@ import io.ebean.search.TextCommonTerms; import io.ebean.search.TextQueryString; import io.ebean.search.TextSimple; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.persistence.NonUniqueResultException; import java.sql.Connection; @@ -327,7 +326,6 @@ public interface ExpressionList { * * @see Query#findList() */ - @Nonnull List findList(); /** @@ -335,7 +333,6 @@ public interface ExpressionList { * * @see Query#findIds() */ - @Nonnull List findIds(); /** @@ -351,7 +348,6 @@ public interface ExpressionList { * * @see Query#findSet() */ - @Nonnull Set findSet(); /** @@ -359,7 +355,6 @@ public interface ExpressionList { * * @see Query#findMap() */ - @Nonnull Map findMap(); /** @@ -392,7 +387,6 @@ public interface ExpressionList { * * @return the list of values for the selected property */ - @Nonnull List findSingleAttributeList(); /** @@ -429,7 +423,6 @@ public interface ExpressionList { /** * Execute the query returning an optional bean. */ - @Nonnull Optional findOneOrEmpty(); /** @@ -442,7 +435,6 @@ public interface ExpressionList { * * @return a Future object for the row count query */ - @Nonnull FutureRowCount findFutureCount(); /** @@ -455,7 +447,6 @@ public interface ExpressionList { * * @return a Future object for the list of Id's */ - @Nonnull FutureIds findFutureIds(); /** @@ -468,7 +459,6 @@ public interface ExpressionList { * * @return a Future object for the list result of the query */ - @Nonnull FutureList findFutureList(); /** @@ -499,7 +489,6 @@ public interface ExpressionList { * @return The PagedList * @see Query#findPagedList() */ - @Nonnull PagedList findPagedList(); /** @@ -509,7 +498,6 @@ public interface ExpressionList { * It will execute the query against the history returning the versions of the bean. *

*/ - @Nonnull List> findVersions(); /** @@ -519,13 +507,11 @@ public interface ExpressionList { * It will execute the query against the history returning the versions of the bean. *

*/ - @Nonnull List> findVersionsBetween(Timestamp start, Timestamp end); /** * Add some filter predicate expressions to the many property. */ - @Nonnull ExpressionList filterMany(String manyProperty); /** diff --git a/ebean-api/src/main/java/io/ebean/ExtendedServer.java b/ebean-api/src/main/java/io/ebean/ExtendedServer.java index 59b1c678e..9decb9b27 100644 --- a/ebean-api/src/main/java/io/ebean/ExtendedServer.java +++ b/ebean-api/src/main/java/io/ebean/ExtendedServer.java @@ -1,6 +1,5 @@ package io.ebean; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.persistence.NonUniqueResultException; import java.time.Clock; @@ -82,7 +81,6 @@ public interface ExtendedServer { * * @see Query#findIds() */ - @Nonnull List
findIds(Query query, Transaction transaction); /** @@ -100,7 +98,6 @@ public interface ExtendedServer { * @see Query#findEach(Consumer) * @see Query#findEachWhile(Predicate) */ - @Nonnull QueryIterator findIterate(Query query, Transaction transaction); /** @@ -112,7 +109,6 @@ public interface ExtendedServer { * Note that the stream needs to be closed so use with try with resources. *

*/ - @Nonnull Stream findStream(Query query, Transaction transaction); /** @@ -125,7 +121,6 @@ public interface ExtendedServer { *

* Note that the stream needs to be closed so use with try with resources. */ - @Nonnull @Deprecated Stream findLargeStream(Query query, Transaction transaction); @@ -210,7 +205,6 @@ public interface ExtendedServer { * It will execute the query against the history returning the versions of the bean. *

*/ - @Nonnull List> findVersions(Query query, Transaction transaction); /** @@ -235,7 +229,6 @@ public interface ExtendedServer { * @return the list of fetched beans. * @see Query#findList() */ - @Nonnull List findList(Query query, Transaction transaction); /** @@ -251,7 +244,6 @@ public interface ExtendedServer { * @return a Future object for the row count query * @see Query#findFutureCount() */ - @Nonnull FutureRowCount findFutureCount(Query query, Transaction transaction); /** @@ -267,7 +259,6 @@ public interface ExtendedServer { * @return a Future object for the list of Id's * @see Query#findFutureIds() */ - @Nonnull FutureIds findFutureIds(Query query, Transaction transaction); /** @@ -284,7 +275,6 @@ public interface ExtendedServer { * @return a Future object for the list result of the query * @see Query#findFutureList() */ - @Nonnull FutureList findFutureList(Query query, Transaction transaction); /** @@ -316,7 +306,6 @@ public interface ExtendedServer { * @return The PagedList * @see Query#findPagedList() */ - @Nonnull PagedList findPagedList(Query query, Transaction transaction); /** @@ -341,7 +330,6 @@ public interface ExtendedServer { * @return the set of fetched beans. * @see Query#findSet() */ - @Nonnull Set findSet(Query query, Transaction transaction); /** @@ -358,7 +346,6 @@ public interface ExtendedServer { * @return the map of fetched beans. * @see Query#findMap() */ - @Nonnull Map findMap(Query query, Transaction transaction); /** @@ -391,7 +378,6 @@ public interface ExtendedServer { * @return the list of values for the selected property * @see Query#findSingleAttributeList() */ - @Nonnull List
findSingleAttributeList(Query query, Transaction transaction); /** @@ -419,7 +405,6 @@ public interface ExtendedServer { /** * Similar to findOne() but returns an Optional (rather than nullable). */ - @Nonnull Optional findOneOrEmpty(Query query, Transaction transaction); /** @@ -463,7 +448,6 @@ public interface ExtendedServer { * @return the list of fetched MapBean. * @see SqlQuery#findList() */ - @Nonnull List findList(SqlQuery query, Transaction transaction); /** diff --git a/ebean-api/src/main/java/io/ebean/FetchGroup.java b/ebean-api/src/main/java/io/ebean/FetchGroup.java index 95ea70412..5eb749048 100644 --- a/ebean-api/src/main/java/io/ebean/FetchGroup.java +++ b/ebean-api/src/main/java/io/ebean/FetchGroup.java @@ -2,8 +2,6 @@ package io.ebean; import io.ebean.service.SpiFetchGroupQuery; -import javax.annotation.Nonnull; - /** * Defines what part of the object graph to load (select and fetch clauses). *

@@ -83,7 +81,6 @@ public interface FetchGroup { * * @return The FetchGroup with the given select clause */ - @Nonnull static FetchGroup of(Class cls, String select) { return XServiceProvider.fetchGroupOf(cls, select); } @@ -108,7 +105,6 @@ public interface FetchGroup { * * @return The FetchGroupBuilder with the given select clause which we will add fetch clauses to */ - @Nonnull static FetchGroupBuilder of(Class cls) { return XServiceProvider.fetchGroupOf(cls); } diff --git a/ebean-api/src/main/java/io/ebean/FetchGroupBuilder.java b/ebean-api/src/main/java/io/ebean/FetchGroupBuilder.java index 121cceb53..aeda3e7e5 100644 --- a/ebean-api/src/main/java/io/ebean/FetchGroupBuilder.java +++ b/ebean-api/src/main/java/io/ebean/FetchGroupBuilder.java @@ -1,7 +1,5 @@ package io.ebean; -import javax.annotation.Nonnull; - /** * Builds a FetchGroup by adding fetch clauses. *

@@ -28,80 +26,67 @@ public interface FetchGroupBuilder { /** * Specify specific properties to select (top level properties). */ - @Nonnull FetchGroupBuilder select(String select); /** * Fetch all the properties at the given path. */ - @Nonnull FetchGroupBuilder fetch(String path); /** * Fetch the path with the nested fetch group. */ - @Nonnull FetchGroupBuilder fetch(String path, FetchGroup nestedGroup); /** * Fetch the path using a query join with the nested fetch group. */ - @Nonnull FetchGroupBuilder fetchQuery(String path, FetchGroup nestedGroup); /** * Fetch the path lazily with the nested fetch group. */ - @Nonnull FetchGroupBuilder fetchLazy(String path, FetchGroup nestedGroup); /** * Fetch the path including specified properties. */ - @Nonnull FetchGroupBuilder fetch(String path, String properties); /** * Fetch the path including all its properties using a query join. */ - @Nonnull FetchGroupBuilder fetchQuery(String path); /** * Fetch the path including all its properties using L2 cache. * Cache misses fallback to fetchQuery(). */ - @Nonnull FetchGroupBuilder fetchCache(String path); /** * Fetch the path including specified properties using a query join. */ - @Nonnull FetchGroupBuilder fetchQuery(String path, String properties); /** * Fetch the path including specified properties using L2 cache. * Cache misses fallback to fetchQuery(). */ - @Nonnull FetchGroupBuilder fetchCache(String path, String properties); /** * Fetch the path including all its properties lazily. */ - @Nonnull FetchGroupBuilder fetchLazy(String path); /** * Fetch the path including specified properties lazily. */ - @Nonnull FetchGroupBuilder fetchLazy(String path, String properties); /** * Build and return the FetchGroup. */ - @Nonnull FetchGroup build(); } diff --git a/ebean-api/src/main/java/io/ebean/Finder.java b/ebean-api/src/main/java/io/ebean/Finder.java index cc5ef87f6..68b0fe203 100644 --- a/ebean-api/src/main/java/io/ebean/Finder.java +++ b/ebean-api/src/main/java/io/ebean/Finder.java @@ -1,6 +1,5 @@ package io.ebean; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.List; @@ -139,7 +138,6 @@ public class Finder { *

* Equivalent to {@link Database#reference(Class, Object)} */ - @Nonnull public T ref(I id) { return db().reference(type, id); } @@ -166,7 +164,6 @@ public class Finder { /** * Retrieves all entities of the given type. */ - @Nonnull public List all() { return query().findList(); } diff --git a/ebean-api/src/main/java/io/ebean/PagedList.java b/ebean-api/src/main/java/io/ebean/PagedList.java index 662f426f8..f4e1d3610 100644 --- a/ebean-api/src/main/java/io/ebean/PagedList.java +++ b/ebean-api/src/main/java/io/ebean/PagedList.java @@ -1,6 +1,5 @@ package io.ebean; -import javax.annotation.Nonnull; import java.util.List; import java.util.concurrent.Future; @@ -116,13 +115,11 @@ public interface PagedList { * * } */ - @Nonnull Future getFutureCount(); /** * Return the list of entities for this page. */ - @Nonnull List getList(); /** diff --git a/ebean-api/src/main/java/io/ebean/Query.java b/ebean-api/src/main/java/io/ebean/Query.java index 0dc86905e..eee7bf8ff 100644 --- a/ebean-api/src/main/java/io/ebean/Query.java +++ b/ebean-api/src/main/java/io/ebean/Query.java @@ -1,6 +1,5 @@ package io.ebean; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.persistence.NonUniqueResultException; import java.sql.Connection; @@ -689,7 +688,6 @@ public interface Query extends CancelableQuery { * This query will execute against the Database that was used to create it. *

*/ - @Nonnull
List findIds(); /** @@ -727,7 +725,6 @@ public interface Query extends CancelableQuery { * * } */ - @Nonnull QueryIterator findIterate(); /** @@ -749,7 +746,6 @@ public interface Query extends CancelableQuery { * * } */ - @Nonnull Stream findStream(); /** @@ -772,7 +768,6 @@ public interface Query extends CancelableQuery { * * } */ - @Nonnull @Deprecated Stream findLargeStream(); @@ -882,7 +877,6 @@ public interface Query extends CancelableQuery { * * } */ - @Nonnull List findList(); /** @@ -898,7 +892,6 @@ public interface Query extends CancelableQuery { * * } */ - @Nonnull Set findSet(); /** @@ -918,7 +911,6 @@ public interface Query extends CancelableQuery { * * } */ - @Nonnull Map findMap(); /** @@ -951,7 +943,6 @@ public interface Query extends CancelableQuery { * * @return the list of values for the selected property */ - @Nonnull List findSingleAttributeList(); /** @@ -1049,7 +1040,6 @@ public interface Query extends CancelableQuery { /** * Execute the query returning an optional bean. */ - @Nonnull Optional findOneOrEmpty(); /** @@ -1064,7 +1054,6 @@ public interface Query extends CancelableQuery { * It will execute the query against the history returning the versions of the bean. *

*/ - @Nonnull List> findVersions(); /** @@ -1074,7 +1063,6 @@ public interface Query extends CancelableQuery { * It will execute the query against the history returning the versions of the bean. *

*/ - @Nonnull List> findVersionsBetween(Timestamp start, Timestamp end); /** @@ -1132,7 +1120,6 @@ public interface Query extends CancelableQuery { * * @return a Future object for the row count query */ - @Nonnull FutureRowCount findFutureCount(); /** @@ -1145,7 +1132,6 @@ public interface Query extends CancelableQuery { * * @return a Future object for the list of Id's */ - @Nonnull FutureIds findFutureIds(); /** @@ -1157,7 +1143,6 @@ public interface Query extends CancelableQuery { * * @return a Future object for the list result of the query */ - @Nonnull FutureList findFutureList(); /** @@ -1187,7 +1172,6 @@ public interface Query extends CancelableQuery { * * @return The PagedList */ - @Nonnull PagedList findPagedList(); /** diff --git a/ebean-api/src/main/java/io/ebean/SqlQuery.java b/ebean-api/src/main/java/io/ebean/SqlQuery.java index 9a878f233..d7e184257 100644 --- a/ebean-api/src/main/java/io/ebean/SqlQuery.java +++ b/ebean-api/src/main/java/io/ebean/SqlQuery.java @@ -1,6 +1,5 @@ package io.ebean; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.io.Serializable; import java.math.BigDecimal; @@ -42,7 +41,6 @@ public interface SqlQuery extends Serializable, CancelableQuery { /** * Execute the query returning a list. */ - @Nonnull List findList(); /** @@ -119,7 +117,6 @@ public interface SqlQuery extends Serializable, CancelableQuery { /** * Execute the query returning an optional row. */ - @Nonnull Optional findOneOrEmpty(); /** diff --git a/ebean-api/src/main/java/io/ebean/plugin/BeanType.java b/ebean-api/src/main/java/io/ebean/plugin/BeanType.java index 661b370d2..e7f324a56 100644 --- a/ebean-api/src/main/java/io/ebean/plugin/BeanType.java +++ b/ebean-api/src/main/java/io/ebean/plugin/BeanType.java @@ -8,7 +8,6 @@ import io.ebean.event.BeanPersistController; import io.ebean.event.BeanPersistListener; import io.ebean.event.BeanQueryAdapter; -import javax.annotation.Nonnull; import java.util.Collection; import java.util.List; import java.util.function.Consumer; @@ -21,7 +20,6 @@ public interface BeanType { /** * Return the short name of the bean type. */ - @Nonnull String name(); /** @@ -35,7 +33,6 @@ public interface BeanType { /** * Return the full name of the bean type. */ - @Nonnull String fullName(); /** @@ -49,7 +46,6 @@ public interface BeanType { /** * Return the class type this BeanDescriptor describes. */ - @Nonnull Class type(); /** @@ -76,7 +72,6 @@ public interface BeanType { /** * Return all the properties for this bean type. */ - @Nonnull Collection allProperties(); /** diff --git a/ebean-api/src/main/java/io/ebean/plugin/Property.java b/ebean-api/src/main/java/io/ebean/plugin/Property.java index 50a1ebc3d..d37fa2959 100644 --- a/ebean-api/src/main/java/io/ebean/plugin/Property.java +++ b/ebean-api/src/main/java/io/ebean/plugin/Property.java @@ -1,7 +1,5 @@ package io.ebean.plugin; -import javax.annotation.Nonnull; - /** * Property of a entity bean that can be read. */ @@ -10,7 +8,6 @@ public interface Property { /** * Return the name of the property. */ - @Nonnull String name(); /** @@ -24,7 +21,6 @@ public interface Property { /** * Return the type of the property. */ - @Nonnull Class type(); /**