update jdoc of @Find, @HQL, @SQL

This commit is contained in:
Gavin King 2023-07-21 21:32:59 +02:00
parent c15232141d
commit 57cbf2e16a
3 changed files with 22 additions and 5 deletions

View File

@ -113,6 +113,10 @@ import static java.lang.annotation.RetentionPolicy.CLASS;
* {@linkplain jakarta.persistence.criteria.CriteriaBuilder criteria * {@linkplain jakarta.persistence.criteria.CriteriaBuilder criteria
* query}. * query}.
* </ul> * </ul>
* <p>
* As an exception, the method may have at most one parameter of
* type {@code EntityManager}, {@code Session},
* {@code StatelessSession}, or {@code Mutiny.Session}.
* *
* @see HQL * @see HQL
* @see SQL * @see SQL

View File

@ -49,8 +49,9 @@ import static java.lang.annotation.RetentionPolicy.CLASS;
* Alternatively, the type to which the annotated method belongs may * Alternatively, the type to which the annotated method belongs may
* also declare an abstract method with no parameters which returns * also declare an abstract method with no parameters which returns
* one of the types {@link jakarta.persistence.EntityManager}, * one of the types {@link jakarta.persistence.EntityManager},
* {@link org.hibernate.StatelessSession}, * {@link org.hibernate.Session},
* or {@link org.hibernate.Session}, for example: * {@link org.hibernate.StatelessSession}, or {@code Mutiny.Session},
* for example:
* <pre> * <pre>
* EntityManager entityManager(); * EntityManager entityManager();
* </pre> * </pre>
@ -74,7 +75,8 @@ import static java.lang.annotation.RetentionPolicy.CLASS;
* <p> * <p>
* This is reminiscent of traditional DAO-style repositories. * This is reminiscent of traditional DAO-style repositories.
* <p> * <p>
* The return type of an annotated method must be: * For a {@code select} query, the return type of an annotated method
* must be:
* <ul> * <ul>
* <li>an entity type, * <li>an entity type,
* <li>{@link java.util.List}, * <li>{@link java.util.List},
@ -84,6 +86,10 @@ import static java.lang.annotation.RetentionPolicy.CLASS;
* <li>{@link jakarta.persistence.TypedQuery}. * <li>{@link jakarta.persistence.TypedQuery}.
* </ul> * </ul>
* <p> * <p>
* For an {@code insert}, {@code update}, or {@code delete} query,
* the return type of the annotated method must be {@code int} or
* {@code void}.
* <p>
* The method parameters must match the parameters of the HQL query, * The method parameters must match the parameters of the HQL query,
* either by name or by position: * either by name or by position:
* <ul> * <ul>
@ -95,6 +101,8 @@ import static java.lang.annotation.RetentionPolicy.CLASS;
* <p> * <p>
* As an exception, the method may have: * As an exception, the method may have:
* <ul> * <ul>
* <li>a parameter of type {@code EntityManager}, {@code Session},
* {@code StatelessSession}, or {@code Mutiny.Session},
* <li>a parameter with type {@code Page}, and/or * <li>a parameter with type {@code Page}, and/or
* <li>a parameter with type {@code Order<? super E>}, * <li>a parameter with type {@code Order<? super E>},
* {@code List<Order<? super E>>}, or {@code Order<? super E>...} * {@code List<Order<? super E>>}, or {@code Order<? super E>...}

View File

@ -49,8 +49,9 @@ import static java.lang.annotation.RetentionPolicy.CLASS;
* Alternatively, the type to which the annotated method belongs may * Alternatively, the type to which the annotated method belongs may
* also declare an abstract method with no parameters which returns * also declare an abstract method with no parameters which returns
* one of the types {@link jakarta.persistence.EntityManager}, * one of the types {@link jakarta.persistence.EntityManager},
* {@link org.hibernate.StatelessSession}, * {@link org.hibernate.Session},
* or {@link org.hibernate.Session}, for example: * {@link org.hibernate.StatelessSession}, or {@code Mutiny.Session},
* for example:
* <pre> * <pre>
* EntityManager entityManager(); * EntityManager entityManager();
* </pre> * </pre>
@ -91,6 +92,10 @@ import static java.lang.annotation.RetentionPolicy.CLASS;
* <li>a named query parameter of form {@code :name} is matched to * <li>a named query parameter of form {@code :name} is matched to
* the method parameter {@code name}. * the method parameter {@code name}.
* </ul> * </ul>
* <p>
* As an exception, the method may have at most one parameter of
* type {@code EntityManager}, {@code Session},
* {@code StatelessSession}, or {@code Mutiny.Session}.
* *
* @see HQL * @see HQL
* @see Find * @see Find