File tree Expand file tree Collapse file tree 3 files changed +18
-8
lines changed
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation Expand file tree Collapse file tree 3 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -936,13 +936,12 @@ void addEventBus() {
936936
937937 /**
938938 * For usage with CDI, but outside Quarkus, Jakarta Data
939- * repositories use {@code @PersistenceUnit} to obtain an
940- * {@code EntityManagerFactory} via field injection. So in
941- * that case we will need a {@link DefaultConstructor default
942- * constructor}. We don't do this in Quarkus, because there
943- * we can just inject the {@code StatelessSession} directly,
944- * and so in Quarkus we don't need the default constructor
945- * at all.
939+ * repositories use {@code @PersistenceUnit} to obtain
940+ * an {@code EntityManagerFactory} via field injection.
941+ * So here we need a {@linkplain DefaultConstructor
942+ * default constructor}. We don't need one in Quarkus,
943+ * because in Quarkus we can inject a container-managed
944+ * {@code StatelessSession} directly.
946945 */
947946 boolean needsDefaultConstructor () {
948947 return jakartaDataRepository
Original file line number Diff line number Diff line change 2121
2222/**
2323 * Used by the container to instantiate a Jakarta Data repository.
24+ * This is a constructor with no parameters, used to instantiate
25+ * a repository which then uses field injection to obtain its
26+ * dependencies. By contrast, a {@link RepositoryConstructor} has
27+ * a parameter which accepts the session as an argument, allowing
28+ * direct instantiation or constructor injection. This class is
29+ * only needed because {@code @PersistenceUnit} is incompatible
30+ * with CDI-style constructor injection.
2431 *
2532 * @author Gavin King
2633 */
Original file line number Diff line number Diff line change 1414import static org .hibernate .processor .util .Constants .NONNULL ;
1515
1616/**
17- * A general purpose constructor which accepts the session.
17+ * A general purpose constructor which accepts the session as an
18+ * argument. This constructor is compatible with use via direct
19+ * instantiation or CDI-style constructor injection. By contrast,
20+ * {@link DefaultConstructor} is used to instantiate a repository
21+ * which obtains its session using field injection.
1822 *
1923 * @author Gavin King
2024 */
You can’t perform that action at this time.
0 commit comments