mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#2422 - Remove extraneous jsr 305 @Nonnull
This commit is contained in:
@@ -101,7 +101,6 @@ import io.ebeaninternal.util.ParamTypeHelper.TypeInfo;
|
||||
import io.ebeanservice.docstore.api.DocStoreIntegration;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.persistence.NonUniqueResultException;
|
||||
import javax.persistence.OptimisticLockException;
|
||||
@@ -1159,7 +1158,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <T> Optional<T> findOneOrEmpty(Query<T> query, Transaction transaction) {
|
||||
return Optional.ofNullable(findOne(query, transaction));
|
||||
@@ -1192,7 +1190,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public <T> Set<T> findSet(Query<T> query, Transaction t) {
|
||||
@@ -1209,7 +1206,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public <K, T> Map<K, T> findMap(Query<T> query, Transaction t) {
|
||||
@@ -1231,7 +1227,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <A, T> List<A> findSingleAttributeList(Query<T> query, Transaction t) {
|
||||
@@ -1295,7 +1290,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <A, T> List<A> findIds(Query<T> query, Transaction t) {
|
||||
return findIdsWithCopy(((SpiQuery<T>) query).copy(), t);
|
||||
@@ -1356,7 +1350,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <T> FutureRowCount<T> findFutureCount(Query<T> q, Transaction t) {
|
||||
SpiQuery<T> copy = ((SpiQuery<T>) q).copy();
|
||||
@@ -1367,7 +1360,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
return queryFuture;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <T> FutureIds<T> findFutureIds(Query<T> query, Transaction t) {
|
||||
SpiQuery<T> copy = ((SpiQuery<T>) query).copy();
|
||||
@@ -1378,7 +1370,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
return queryFuture;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <T> FutureList<T> findFutureList(Query<T> query, Transaction t) {
|
||||
SpiQuery<T> spiQuery = (SpiQuery<T>) query.copy();
|
||||
@@ -1396,7 +1387,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
return queryFuture;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <T> PagedList<T> findPagedList(Query<T> query, Transaction transaction) {
|
||||
SpiQuery<T> spiQuery = (SpiQuery<T>) query;
|
||||
@@ -1410,7 +1400,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
return new LimitOffsetPagedList<>(this, spiQuery);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <T> QueryIterator<T> findIterate(Query<T> query, Transaction t) {
|
||||
SpiOrmQueryRequest<T> request = createQueryRequest(Type.ITERATE, query, t);
|
||||
@@ -1423,13 +1412,11 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <T> Stream<T> findLargeStream(Query<T> query, Transaction transaction) {
|
||||
return findStream(query, transaction);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <T> Stream<T> findStream(Query<T> query, Transaction transaction) {
|
||||
return toStream(findIterate(query, transaction));
|
||||
@@ -1475,7 +1462,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
// no try finally - findEachWhile guarantee's cleanup of the transaction if required
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <T> List<Version<T>> findVersions(Query<T> query, Transaction transaction) {
|
||||
SpiOrmQueryRequest<T> request = createQueryRequest(Type.LIST, query, transaction);
|
||||
@@ -1487,7 +1473,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <T> List<T> findList(Query<T> query, Transaction t) {
|
||||
return findList(query, t, false);
|
||||
@@ -1548,7 +1533,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<SqlRow> findList(SqlQuery query, Transaction t) {
|
||||
RelationalQueryRequest request = new RelationalQueryRequest(this, relationalQueryEngine, query, t);
|
||||
@@ -2271,7 +2255,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
return checkUniqueness(bean, null);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<Property> checkUniqueness(Object bean, Transaction transaction) {
|
||||
EntityBean entityBean = checkEntityBean(bean);
|
||||
|
||||
@@ -56,7 +56,6 @@ import io.ebeanservice.docstore.api.mapping.DocPropertyMapping;
|
||||
import io.ebeanservice.docstore.api.mapping.DocumentMapping;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.persistence.PersistenceException;
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
@@ -1961,7 +1960,6 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
* Return the class type this BeanDescriptor describes.
|
||||
*/
|
||||
@Override
|
||||
@Nonnull
|
||||
public Class<T> type() {
|
||||
return beanType;
|
||||
}
|
||||
@@ -1973,7 +1971,6 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
* instead.
|
||||
*/
|
||||
@Override
|
||||
@Nonnull
|
||||
public String fullName() {
|
||||
return fullName;
|
||||
}
|
||||
@@ -1982,7 +1979,6 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
* Return the short name of the entity bean.
|
||||
*/
|
||||
@Override
|
||||
@Nonnull
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
@@ -2936,7 +2932,6 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public Collection<? extends Property> allProperties() {
|
||||
return propertiesAll();
|
||||
}
|
||||
|
||||
@@ -40,7 +40,6 @@ import io.ebeanservice.docstore.api.mapping.DocPropertyMapping;
|
||||
import io.ebeanservice.docstore.api.mapping.DocPropertyOptions;
|
||||
import io.ebeanservice.docstore.api.support.DocStructure;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.persistence.PersistenceException;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
@@ -813,7 +812,6 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
* Return the name of the property.
|
||||
*/
|
||||
@Override
|
||||
@Nonnull
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
@@ -1299,7 +1297,6 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
* Return the property type.
|
||||
*/
|
||||
@Override
|
||||
@Nonnull
|
||||
public Class<?> type() {
|
||||
return propertyType;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import io.ebeaninternal.api.SpiQueryFetch;
|
||||
import io.ebeaninternal.server.querydefn.OrmQueryDetail;
|
||||
import io.ebeaninternal.server.querydefn.SpiFetchGroup;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.sql.Connection;
|
||||
import java.sql.Timestamp;
|
||||
@@ -234,25 +233,21 @@ final class DefaultFetchGroupQuery<T> implements SpiFetchGroupQuery<T>, SpiQuery
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <A> List<A> findIds() {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public QueryIterator<T> findIterate() {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Stream<T> findStream() {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Stream<T> findLargeStream() {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
@@ -273,25 +268,21 @@ final class DefaultFetchGroupQuery<T> implements SpiFetchGroupQuery<T>, SpiQuery
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<T> findList() {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<T> findSet() {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <K> Map<K, T> findMap() {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <A> List<A> findSingleAttributeList() {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
@@ -318,19 +309,16 @@ final class DefaultFetchGroupQuery<T> implements SpiFetchGroupQuery<T>, SpiQuery
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Optional<T> findOneOrEmpty() {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<Version<T>> findVersions() {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<Version<T>> findVersionsBetween(Timestamp start, Timestamp end) {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
@@ -361,25 +349,21 @@ final class DefaultFetchGroupQuery<T> implements SpiFetchGroupQuery<T>, SpiQuery
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public FutureRowCount<T> findFutureCount() {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public FutureIds<T> findFutureIds() {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public FutureList<T> findFutureList() {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public PagedList<T> findPagedList() {
|
||||
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
|
||||
|
||||
@@ -28,7 +28,6 @@ import io.ebean.text.PathProperties;
|
||||
import io.ebeaninternal.api.SpiQueryFetch;
|
||||
import io.ebeaninternal.server.util.ArrayStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.sql.Connection;
|
||||
import java.sql.Timestamp;
|
||||
@@ -177,7 +176,6 @@ public abstract class TQRootBean<T, R> {
|
||||
* the find methods available on this 'root query bean' instance like findList().
|
||||
* </p>
|
||||
*/
|
||||
@Nonnull
|
||||
public Query<T> query() {
|
||||
return query;
|
||||
}
|
||||
@@ -1621,7 +1619,6 @@ public abstract class TQRootBean<T, R> {
|
||||
/**
|
||||
* Execute the query returning an optional bean.
|
||||
*/
|
||||
@Nonnull
|
||||
public Optional<T> findOneOrEmpty() {
|
||||
return query.findOneOrEmpty();
|
||||
}
|
||||
@@ -1643,7 +1640,6 @@ public abstract class TQRootBean<T, R> {
|
||||
*
|
||||
* @see Query#findList()
|
||||
*/
|
||||
@Nonnull
|
||||
public List<T> findList() {
|
||||
return query.findList();
|
||||
}
|
||||
@@ -1667,7 +1663,6 @@ public abstract class TQRootBean<T, R> {
|
||||
*
|
||||
* }</pre>
|
||||
*/
|
||||
@Nonnull
|
||||
public Stream<T> findStream() {
|
||||
return query.findStream();
|
||||
}
|
||||
@@ -1697,7 +1692,6 @@ public abstract class TQRootBean<T, R> {
|
||||
*
|
||||
* @see Query#findSet()
|
||||
*/
|
||||
@Nonnull
|
||||
public Set<T> findSet() {
|
||||
return query.findSet();
|
||||
}
|
||||
@@ -1710,7 +1704,6 @@ public abstract class TQRootBean<T, R> {
|
||||
*
|
||||
* @see Query#findIds()
|
||||
*/
|
||||
@Nonnull
|
||||
public <A> List<A> findIds() {
|
||||
return query.findIds();
|
||||
}
|
||||
@@ -1736,7 +1729,6 @@ public abstract class TQRootBean<T, R> {
|
||||
*
|
||||
* @see Query#findMap()
|
||||
*/
|
||||
@Nonnull
|
||||
public <K> Map<K, T> findMap() {
|
||||
return query.findMap();
|
||||
}
|
||||
@@ -1777,7 +1769,6 @@ public abstract class TQRootBean<T, R> {
|
||||
*
|
||||
* }</pre>
|
||||
*/
|
||||
@Nonnull
|
||||
public QueryIterator<T> findIterate() {
|
||||
return query.findIterate();
|
||||
}
|
||||
@@ -1798,7 +1789,6 @@ public abstract class TQRootBean<T, R> {
|
||||
*
|
||||
* @return the list of values for the selected property
|
||||
*/
|
||||
@Nonnull
|
||||
public <A> List<A> findSingleAttributeList() {
|
||||
return query.findSingleAttributeList();
|
||||
}
|
||||
@@ -1913,7 +1903,6 @@ public abstract class TQRootBean<T, R> {
|
||||
* It will execute the query against the history returning the versions of the bean.
|
||||
* </p>
|
||||
*/
|
||||
@Nonnull
|
||||
public List<Version<T>> findVersions() {
|
||||
return query.findVersions();
|
||||
}
|
||||
@@ -1925,7 +1914,6 @@ public abstract class TQRootBean<T, R> {
|
||||
* It will execute the query against the history returning the versions of the bean.
|
||||
* </p>
|
||||
*/
|
||||
@Nonnull
|
||||
public List<Version<T>> findVersionsBetween(Timestamp start, Timestamp end) {
|
||||
return query.findVersionsBetween(start, end);
|
||||
}
|
||||
@@ -1936,7 +1924,6 @@ public abstract class TQRootBean<T, R> {
|
||||
* This is the number of 'top level' or 'root level' entities.
|
||||
* </p>
|
||||
*/
|
||||
@Nonnull
|
||||
public int findCount() {
|
||||
return query.findCount();
|
||||
}
|
||||
@@ -1951,7 +1938,6 @@ public abstract class TQRootBean<T, R> {
|
||||
*
|
||||
* @return a Future object for the row count query
|
||||
*/
|
||||
@Nonnull
|
||||
public FutureRowCount<T> findFutureCount() {
|
||||
return query.findFutureCount();
|
||||
}
|
||||
@@ -1966,7 +1952,6 @@ public abstract class TQRootBean<T, R> {
|
||||
*
|
||||
* @return a Future object for the list of Id's
|
||||
*/
|
||||
@Nonnull
|
||||
public FutureIds<T> findFutureIds() {
|
||||
return query.findFutureIds();
|
||||
}
|
||||
@@ -1980,7 +1965,6 @@ public abstract class TQRootBean<T, R> {
|
||||
*
|
||||
* @return a Future object for the list result of the query
|
||||
*/
|
||||
@Nonnull
|
||||
public FutureList<T> findFutureList() {
|
||||
return query.findFutureList();
|
||||
}
|
||||
@@ -2014,7 +1998,6 @@ public abstract class TQRootBean<T, R> {
|
||||
*
|
||||
* @return The PagedList
|
||||
*/
|
||||
@Nonnull
|
||||
public PagedList<T> findPagedList() {
|
||||
return query.findPagedList();
|
||||
}
|
||||
@@ -2047,7 +2030,6 @@ public abstract class TQRootBean<T, R> {
|
||||
/**
|
||||
* Return the type of beans being queried.
|
||||
*/
|
||||
@Nonnull
|
||||
public Class<T> getBeanType() {
|
||||
return query.getBeanType();
|
||||
}
|
||||
@@ -2055,7 +2037,6 @@ public abstract class TQRootBean<T, R> {
|
||||
/**
|
||||
* Return the expression list that has been built for this query.
|
||||
*/
|
||||
@Nonnull
|
||||
public ExpressionList<T> getExpressionList() {
|
||||
return query.where();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,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;
|
||||
@@ -267,7 +266,6 @@ public class TDSpiServer implements SpiServer {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <T> T reference(Class<T> beanType, Object id) {
|
||||
return null;
|
||||
@@ -413,13 +411,11 @@ public class TDSpiServer implements SpiServer {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<Property> checkUniqueness(Object bean) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<Property> checkUniqueness(Object bean, Transaction transaction) {
|
||||
return null;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.tests.query.cache;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.persistence.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -17,7 +16,6 @@ public class Contract {
|
||||
private List<Position> positions;
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "container", fetch = FetchType.LAZY)
|
||||
@Nonnull
|
||||
private List<AclContainerRelation> aclEntries = new ArrayList<>();
|
||||
|
||||
public Long getId() {
|
||||
|
||||
Reference in New Issue
Block a user