Improve error message when trying to use predicates etc when creating FetchGroup

This commit is contained in:
rob bygrave
2019-08-20 22:47:14 +12:00
parent 4a3eabbd6b
commit e08333ef26
@@ -138,321 +138,321 @@ class DefaultFetchGroupQuery<T> implements SpiFetchGroupQuery<T> {
@Override
public Query<T> copy() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setRawSql(RawSql rawSql) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> asOf(Timestamp asOf) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> asDraft() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public <D> DtoQuery<D> asDto(Class<D> dtoClass) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public UpdateQuery<T> asUpdate() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public void cancel() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setPersistenceContextScope(PersistenceContextScope scope) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setDocIndexName(String indexName) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public ExpressionFactory getExpressionFactory() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public boolean isAutoTuned() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setAutoTune(boolean autoTune) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setAllowLoadErrors() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setLazyLoadBatchSize(int lazyLoadBatchSize) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setIncludeSoftDeletes() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setDisableReadAuditing() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> apply(FetchPath fetchPath) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> usingTransaction(Transaction transaction) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> usingConnection(Connection connection) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Nonnull
@Override
public <A> List<A> findIds() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Nonnull
@Override
public QueryIterator<T> findIterate() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public void findEach(Consumer<T> consumer) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public void findEachWhile(Predicate<T> consumer) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Nonnull
@Override
public List<T> findList() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Nonnull
@Override
public Set<T> findSet() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Nonnull
@Override
public <K> Map<K, T> findMap() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Nonnull
@Override
public <A> List<A> findSingleAttributeList() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public <A> A findSingleAttribute() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public boolean isCountDistinct() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public boolean exists() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Nullable
@Override
public T findOne() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Nonnull
@Override
public Optional<T> findOneOrEmpty() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Nonnull
@Override
public List<Version<T>> findVersions() {
throw new RuntimeException("Not allowed on fetch group query ");
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("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public int delete() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public int delete(Transaction transaction) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public int update() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public int update(Transaction transaction) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public int findCount() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Nonnull
@Override
public FutureRowCount<T> findFutureCount() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Nonnull
@Override
public FutureIds<T> findFutureIds() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Nonnull
@Override
public FutureList<T> findFutureList() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Nonnull
@Override
public PagedList<T> findPagedList() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setParameter(String name, Object value) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setParameter(int position, Object value) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setId(Object id) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Object getId() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> where(Expression expression) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public ExpressionList<T> where() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public ExpressionList<T> text() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public ExpressionList<T> filterMany(String propertyName) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public ExpressionList<T> having() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> having(Expression addExpressionToHaving) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> orderBy(String orderByClause) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> order(String orderByClause) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public OrderBy<T> order() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public OrderBy<T> orderBy() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setOrder(OrderBy<T> orderBy) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setOrderBy(OrderBy<T> orderBy) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setDistinct(boolean isDistinct) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setCountDistinct(CountDistinctOrder orderBy) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
@@ -462,7 +462,7 @@ class DefaultFetchGroupQuery<T> implements SpiFetchGroupQuery<T> {
@Override
public Query<T> setFirstRow(int firstRow) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
@@ -472,67 +472,67 @@ class DefaultFetchGroupQuery<T> implements SpiFetchGroupQuery<T> {
@Override
public Query<T> setMaxRows(int maxRows) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setMapKey(String mapKey) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setBeanCacheMode(CacheMode beanCacheMode) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setUseQueryCache(CacheMode queryCacheMode) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setUseDocStore(boolean useDocStore) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setReadOnly(boolean readOnly) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setLoadBeanCache(boolean loadBeanCache) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setTimeout(int secs) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setBufferFetchSizeHint(int fetchSize) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public String getGeneratedSql() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> forUpdate() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> forUpdateNoWait() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> forUpdateSkipLocked() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
@@ -542,51 +542,51 @@ class DefaultFetchGroupQuery<T> implements SpiFetchGroupQuery<T> {
@Override
public ForUpdate getForUpdateMode() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> alias(String alias) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setBaseTable(String baseTable) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Class<T> getBeanType() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setInheritType(Class<? extends T> type) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Class<? extends T> getInheritType() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public QueryType getQueryType() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> setDisableLazyLoading(boolean disableLazyLoading) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Set<String> validate() {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> orderById(boolean orderById) {
throw new RuntimeException("Not allowed on fetch group query ");
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
}