Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javadoc improvement / rename a parameter #9619

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
improve javadoc for first/max results and rename a parameter
gavinking committed Jan 14, 2025
commit 24a6f2a2a924db42b4df062568ec73c016b20980
Original file line number Diff line number Diff line change
@@ -624,7 +624,7 @@ interface FetchReturn extends ResultNode {
NativeQuery<T> addQueryHint(String hint);

@Override
NativeQuery<T> setMaxResults(int maxResult);
NativeQuery<T> setMaxResults(int maxResults);

@Override
NativeQuery<T> setFirstResult(int startPosition);
Original file line number Diff line number Diff line change
@@ -897,7 +897,7 @@ default Query<R> applyLoadGraph(@SuppressWarnings("rawtypes") RootGraph graph) {
// covariant overrides - jakarta.persistence.Query/TypedQuery

@Override
Query<R> setMaxResults(int maxResult);
Query<R> setMaxResults(int maxResults);

@Override
Query<R> setFirstResult(int startPosition);
Original file line number Diff line number Diff line change
@@ -416,25 +416,34 @@ default Stream<R> stream() {
SelectionQuery<R> setReadOnly(boolean readOnly);

/**
* The max number of rows requested for the query results
* The maximum number of query result rows to return.
*
* @return the maximum length of the query result list
*/
int getMaxResults();

/**
* Set the max number of rows requested for the query results. Applied
* to the SQL query
* Set the maximum number of query result rows to return.
*
* @param maxResults the maximum length of the query result list
*/
SelectionQuery<R> setMaxResults(int maxResult);
SelectionQuery<R> setMaxResults(int maxResults);

/**
* The first row position to return from the query results. Applied
* to the SQL query.
* The first query result row to return. The very first row
* of the query result list is considered the zeroth row.
*
* @return the position of the first row to return,
* indexed from zero
*/
int getFirstResult();

/**
* Set the first row position to return from the query results. Applied
* to the SQL query.
* Set the first query result row to return. The very first
* row of the query result list is considered the zeroth row.
*
* @param startPosition the position of the first row to return,
* indexed from zero
*/
SelectionQuery<R> setFirstResult(int startPosition);

Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ default <T> SqmQueryImplementor<T> setResultTransformer(ResultTransformer<T> tra
SqmQueryImplementor<R> setQueryFlushMode(QueryFlushMode queryFlushMode);

@Override
SqmQueryImplementor<R> setMaxResults(int maxResult);
SqmQueryImplementor<R> setMaxResults(int maxResults);

@Override
SqmQueryImplementor<R> setFirstResult(int startPosition);
Original file line number Diff line number Diff line change
@@ -158,8 +158,8 @@ public int getMaxResults() {
}

@Override
public QueryImplementor<R> setMaxResults(int maxResult) {
super.setMaxResults( maxResult );
public QueryImplementor<R> setMaxResults(int maxResults) {
super.setMaxResults( maxResults );
return this;
}

Original file line number Diff line number Diff line change
@@ -350,12 +350,12 @@ public SelectionQuery<R> setFlushMode(FlushModeType flushMode) {
}

@Override
public SelectionQuery<R> setMaxResults(int maxResult) {
if ( maxResult < 0 ) {
public SelectionQuery<R> setMaxResults(int maxResults) {
if ( maxResults < 0 ) {
throw new IllegalArgumentException( "Max results cannot be negative" );
}
getSession().checkOpen();
getQueryOptions().getLimit().setMaxRows(maxResult);
getQueryOptions().getLimit().setMaxRows( maxResults );
return this;
}

Original file line number Diff line number Diff line change
@@ -1642,8 +1642,8 @@ public <S> NativeQueryImplementor<S> setResultTransformer(ResultTransformer<S> t
}

@Override
public NativeQueryImplementor<R> setMaxResults(int maxResult) {
super.setMaxResults( maxResult );
public NativeQueryImplementor<R> setMaxResults(int maxResults) {
super.setMaxResults( maxResults );
return this;
}

Original file line number Diff line number Diff line change
@@ -190,7 +190,7 @@ NativeQueryImplementor<R> addJoin(
NativeQueryImplementor<R> setComment(String comment);

@Override
NativeQueryImplementor<R> setMaxResults(int maxResult);
NativeQueryImplementor<R> setMaxResults(int maxResults);

@Override
NativeQueryImplementor<R> setFirstResult(int startPosition);
Original file line number Diff line number Diff line change
@@ -700,8 +700,8 @@ public SqmQueryImplementor<R> setResultListTransformer(ResultListTransformer<R>
}

@Override
public SqmQueryImplementor<R> setMaxResults(int maxResult) {
super.setMaxResults( maxResult );
public SqmQueryImplementor<R> setMaxResults(int maxResults) {
super.setMaxResults( maxResults );
return this;
}

Original file line number Diff line number Diff line change
@@ -190,8 +190,8 @@ public int getMaxResults() {
}

@Override
public SqmSelectionQueryImplementor<R> setMaxResults(int maxResult) {
getDelegate().setMaxResults( maxResult );
public SqmSelectionQueryImplementor<R> setMaxResults(int maxResults) {
getDelegate().setMaxResults( maxResults );
return this;
}